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: v18.1.3~17^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46e428e5e35c4fbfd5a6b0c3aaf7a7684e960af6;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 638612df8839..e0a4a76937eb 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1978,7 +1978,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; @@ -1991,7 +1990,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;