From: Xiubo Li Date: Wed, 19 Jan 2022 09:27:08 +0000 (+0800) Subject: mds: clear the recover and check queues in front of identify_files_to_recover() X-Git-Tag: v17.2.4~203^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0fc870818e837a43346a04433b176641abd3a1d;p=ceph.git mds: clear the recover and check queues in front of identify_files_to_recover() If the monitor sends rejoin mdsmap twice just before the first time hasn't finished yet, it may run identify_files_to_recover() twice. Since the rejoin_recover_q and rejoin_check_q were vector so there could be duplicated inodes. Fixes: https://tracker.ceph.com/issues/53741 Signed-off-by: Xiubo Li (cherry picked from commit d82bdd8e4255585512a963c87c8300be8dc26420) --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8696c6d929aa8..b6df1cda0e4f7 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6324,6 +6324,11 @@ void MDCache::identify_files_to_recover() { dout(10) << "identify_files_to_recover" << dendl; int count = 0; + + // Clear the recover and check queues in case the monitor sends rejoin mdsmap twice. + rejoin_recover_q.clear(); + rejoin_check_q.clear(); + for (auto &p : inode_map) { CInode *in = p.second; if (!in->is_auth())