From: Patrick Donnelly Date: Tue, 9 May 2023 13:26:48 +0000 (-0400) Subject: mon/MDSMonitor: check fscid in pending exists in current X-Git-Tag: v16.2.14~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F52233%2Fhead;p=ceph.git mon/MDSMonitor: check fscid in pending exists in current A new file system that's not yet committed may be examined by ::tick. Add a check before looking at the current fsmap. Fixes: https://tracker.ceph.com/issues/59691 Signed-off-by: Patrick Donnelly (cherry picked from commit 3b8b259854895046f19e518d566f713d4d847e79) --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 2ec7a2018409..6c5e7cfa4e90 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1962,7 +1962,6 @@ int MDSMonitor::print_nodes(Formatter *f) */ bool MDSMonitor::maybe_resize_cluster(FSMap &fsmap, fs_cluster_id_t fscid) { - auto ¤t_mds_map = get_fsmap().get_filesystem(fscid)->mds_map; auto&& fs = fsmap.get_filesystem(fscid); auto &mds_map = fs->mds_map; @@ -1975,7 +1974,8 @@ bool MDSMonitor::maybe_resize_cluster(FSMap &fsmap, fs_cluster_id_t fscid) * current batch of changes in pending. This is important if an MDS is * becoming active in the next epoch. */ - if (!current_mds_map.is_resizeable() || + if (!get_fsmap().filesystem_exists(fscid) || + !get_fsmap().get_filesystem(fscid)->mds_map.is_resizeable() || !mds_map.is_resizeable()) { dout(5) << __func__ << " mds_map is not currently resizeable" << dendl; return false;