]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clear the recover and check queues in front of identify_files_to_recover() 44655/head
authorXiubo Li <xiubli@redhat.com>
Wed, 19 Jan 2022 09:27:08 +0000 (17:27 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 7 Feb 2022 04:00:09 +0000 (12:00 +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>
src/mds/MDCache.cc

index 9438925ffd65dda3d40f1ba536405eabca9b9a98..0c6ab4568492645e58a766e9c4c938e4dc1c8265 100644 (file)
@@ -6323,6 +6323,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())