]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: switch submit_mutex to fair mutex for MDLog 49633/head
authorXiubo Li <xiubli@redhat.com>
Mon, 6 Dec 2021 00:59:36 +0000 (08:59 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 5 Jan 2023 04:03:15 +0000 (12:03 +0800)
commitd9b3bff6218ee09c07daebd78678efb84fbe9249
treeb0936c148e4b80dcbb2be6b6a61f9a8f159e1e3b
parenta2608025ef194c271a5089d2b8edd8d094ef860e
mds: switch submit_mutex to fair mutex for MDLog

The implementations of the Mutex (e.g. std::mutex in C++) do not
guarantee fairness, they do not guarantee that the lock will be
acquired by threads in the order that they called the lock().

In most case this works well, but in overload case the client
requests handling thread and _submit_thread could always successfully
acquire the submit_mutex in a long time, which could make the
MDLog::trim() get stuck. That means the MDS daemons will fill journal
logs into the metadata pool, but couldn't trim the expired segments
in time.

This will switch the submit_mutex to fair mutex and it could make
sure that the all the submit_mutex waiters are in FIFO order and
could get a change to be excuted in time.

Fixes: https://tracker.ceph.com/issues/58000
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 0366b807c50345aebdc7b83103568468186ebe57)
src/mds/MDLog.h