Skip to content

Commit

Permalink
client: flush the dirty caps immediately when the MDS is stopping
Browse files Browse the repository at this point in the history
Trigger to flush the dirty caps when the MDS is stopping, or the
caps could be dropped if the MDS stopped before the client could
receiving the mdsmap.

Fixes: https://tracker.ceph.com/issues/61914
Signed-off-by: Xiubo Li <xiubli@redhat.com>
  • Loading branch information
lxbsz committed Mar 7, 2024
1 parent 77e6fe2 commit 5061751
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3114,12 +3114,24 @@ void Client::handle_mds_map(const MConstRef<MMDSMap>& m)
continue;
}
if (newstate >= MDSMap::STATE_ACTIVE) {
if (oldstate < MDSMap::STATE_ACTIVE) {
// kick new requests
kick_requests(session.get());
kick_flushing_caps(session.get());
signal_context_list(session->waiting_for_open);
wake_up_session_caps(session.get(), true);
if (oldstate <= MDSMap::STATE_ACTIVE && newstate != oldstate) {
// flush the delayed caps in case this MDS is stopping
for (auto p = delayed_list.begin(); p != delayed_list.end(); ) {
Inode *in = *p;
++p;
if (!mount_aborted && in->auth_cap->session == session.get()) {
in->delay_cap_item.remove_myself();
check_caps(in, CHECK_CAPS_NODELAY);
}
}

if (oldstate < MDSMap::STATE_ACTIVE) {
// kick new requests
kick_requests(session.get());
kick_flushing_caps(session.get());
signal_context_list(session->waiting_for_open);
wake_up_session_caps(session.get(), true);
}
}
connect_mds_targets(mds);
}
Expand Down

0 comments on commit 5061751

Please sign in to comment.