]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: check fscid in pending exists in current 52233/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:33:56 +0000 (11:33 -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 2ec7a2018409f856909ebb37e1807b15cdd85338..6c5e7cfa4e90b8a80ac9dafe253ab798450c7ba2 100644 (file)
@@ -1962,7 +1962,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;
 
@@ -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;