From 41589d40d973a01c5a03d3cb075881e2442e4b61 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 9 Jan 2020 11:54:13 -0800 Subject: [PATCH] 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 --- src/mds/FSMap.cc | 4 ++-- src/mds/FSMap.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.3