]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: check fscid in pending exists in current 52234/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 9 May 2023 13:26:48 +0000 (09:26 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 28 Jun 2023 15:34:59 +0000 (11:34 -0400)
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 <pdonnell@redhat.com>
(cherry picked from commit 3b8b259854895046f19e518d566f713d4d847e79)

src/mon/MDSMonitor.cc

index 638612df8839967a2a0585b436b56c56ea8c929c..e0a4a76937eb40a444b590e6b799b626e3553514 100644 (file)
@@ -1978,7 +1978,6 @@ int MDSMonitor::print_nodes(Formatter *f)
  */
 bool MDSMonitor::maybe_resize_cluster(FSMap &fsmap, fs_cluster_id_t fscid)
 {
-  auto &current_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;