]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix stale iterator during fs rm
authorJohn Spray <john.spray@redhat.com>
Tue, 21 Feb 2017 15:51:47 +0000 (15:51 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 22 Feb 2017 09:51:48 +0000 (09:51 +0000)
We were failing out any standbys in the map for
the removed filesystem, while looping over the
mds_info -- this could have crashed.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/FSCommands.cc

index 693bf0d5e36e106aeb42bb12aec228d83087c0a8..b48ee11a25efa83ad8a6dc91c23f0d702d463d19 100644 (file)
@@ -551,13 +551,17 @@ class RemoveFilesystemHandler : public FileSystemCommandHandler
       fsmap.set_legacy_client_fscid(FS_CLUSTER_ID_NONE);
     }
 
+    std::vector<mds_gid_t> to_fail;
     // There may be standby_replay daemons left here
     for (const auto &i : fs->mds_map.get_mds_info()) {
       assert(i.second.state == MDSMap::STATE_STANDBY_REPLAY);
+      to_fail.push_back(i.first);
+    }
 
+    for (const auto &gid : to_fail) {
       // Standby replays don't write, so it isn't important to
       // wait for an osdmap propose here: ignore return value.
-      mon->mdsmon()->fail_mds_gid(i.first);
+      mon->mdsmon()->fail_mds_gid(gid);
     }
 
     fsmap.erase_filesystem(fs->fscid);