]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clear the recover and check queues in front of identify_files_to_recover() 46682/head
authorXiubo Li <xiubli@redhat.com>
Wed, 19 Jan 2022 09:27:08 +0000 (17:27 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 15 Jun 2022 01:56:22 +0000 (09:56 +0800)
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 <xiubli@redhat.com>
(cherry picked from commit d82bdd8e4255585512a963c87c8300be8dc26420)

src/mds/MDCache.cc

index 0385e290b1d177d9bd7dbf6154b447341a2a6a8d..3e60af417a1c1fb579377f0aa654e340790227bc 100644 (file)
@@ -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())