]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check rejoin_ack_gather before enter rejoin_gather_finish 45161/head
authorchencan <chen.can2@zte.com.cn>
Wed, 2 Dec 2020 07:55:32 +0000 (15:55 +0800)
committerDan van der Ster <daniel.vanderster@cern.ch>
Fri, 25 Feb 2022 08:23:48 +0000 (09:23 +0100)
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 adf46a839e61e4d760eb1d7bef06a7b38e4e886a..4e41cf3a56506f343988423ed12acbbe4669fe0a 100644 (file)
@@ -5323,7 +5323,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();
@@ -5345,7 +5345,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();
 }
 
@@ -6001,7 +6001,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();
          })
        )