From 55f79590ee887360ded85fdddbb766e995e60cd7 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 19 Jan 2022 17:27:08 +0800 Subject: [PATCH] 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) --- src/mds/MDCache.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 0385e290b1d17..3e60af417a1c1 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6315,6 +6315,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()) -- 2.39.5