]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check rejoin_ack_gather before enter rejoin_gather_finish 42938/head
authorchencan <chen.can2@zte.com.cn>
Wed, 2 Dec 2020 07:55:32 +0000 (15:55 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 26 Aug 2021 16:30:02 +0000 (12:30 -0400)
Fixes: https://tracker.ceph.com/issues/48422
Signed-off-by: chencan <chen.can2@zte.com.cn>
(cherry picked from commit 88548775330f66226b4e58a34256f1cc5a72221f)

src/mds/MDCache.cc

index b368dff83ebe0057c45dd8180808b7d7329d45ae..e9cbf7141c4c3b1f9cd3ce276078a8fd68e79108 100644 (file)
@@ -5327,7 +5327,7 @@ void MDCache::rejoin_open_ino_finish(inodeno_t ino, int ret)
   cap_imports_num_opening--;
 
   if (cap_imports_num_opening == 0) {
-    if (rejoin_gather.empty())
+    if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid()))
       rejoin_gather_finish();
     else if (rejoin_gather.count(mds->get_nodeid()))
       process_imported_caps();
@@ -5349,7 +5349,7 @@ void MDCache::rejoin_open_sessions_finish(map<client_t,pair<Session*,uint64_t> >
   dout(10) << "rejoin_open_sessions_finish" << dendl;
   mds->server->finish_force_open_sessions(session_map);
   rejoin_session_map.swap(session_map);
-  if (rejoin_gather.empty())
+  if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid()))
     rejoin_gather_finish();
 }
 
@@ -5973,7 +5973,7 @@ bool MDCache::open_undef_inodes_dirfrags()
   MDSGatherBuilder gather(g_ceph_context,
       new MDSInternalContextWrapper(mds,
        new LambdaContext([this](int r) {
-           if (rejoin_gather.empty())
+           if (rejoin_gather.empty() && rejoin_ack_gather.count(mds->get_nodeid()))
              rejoin_gather_finish();
          })
        )