From 3aa345c042b9cbe932cd62dd7c8c473f17aa7bd7 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 9 May 2023 09:26:48 -0400 Subject: [PATCH] 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) --- src/mon/MDSMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 638612df88399..e0a4a76937eb4 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; -- 2.39.5