From: Patrick Donnelly Date: Thu, 9 Jan 2020 19:54:13 +0000 (-0800) Subject: MDSMonitor: handle standby already without fscid X-Git-Tag: v15.1.0~227^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=41589d40d973a01c5a03d3cb075881e2442e4b61;p=ceph.git MDSMonitor: handle standby already without fscid If prepare_beacon is called on an existing standby's beacon, then it will handle any changes to get_fs() but if there's not been a change to the empty case, the MDSMonitor will assert. Fixes: https://tracker.ceph.com/issues/43542 Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/FSMap.cc b/src/mds/FSMap.cc index acd748f98895..ab81c8d2ee8c 100644 --- a/src/mds/FSMap.cc +++ b/src/mds/FSMap.cc @@ -1057,10 +1057,10 @@ void FSMap::adjust_standby_fscid(mds_gid_t standby_gid, standby_daemon_fscid.at(standby_gid) = fscid; } -void FSMap::clear_standby_fscid(mds_gid_t standby_gid) +std::size_t FSMap::clear_standby_fscid(mds_gid_t standby_gid) { auto count = standby_daemon_fscid.erase(standby_gid); - ceph_assert(count); + return count; } std::vector FSMap::stop(mds_gid_t who) diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index 720b9c82a3c1..1c89bcd36eda 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -186,7 +186,7 @@ public: */ void adjust_standby_fscid(mds_gid_t standby_gid, fs_cluster_id_t fscid); - void clear_standby_fscid(mds_gid_t standby_gid); + std::size_t clear_standby_fscid(mds_gid_t standby_gid); /** * Assign an MDS cluster standby replay rank to a standby daemon