]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make SnapServer handle old osd maps
authorJohn Spray <john.spray@redhat.com>
Wed, 15 Jul 2015 13:12:41 +0000 (14:12 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 08:05:08 +0000 (09:05 +0100)
(i.e. those missing pools mentioned in the mdsmap)

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

index 557b035c0dbac8546a65c50436b0b4e279dc3591..b5884fab7dce14cfa11a42b2f080bfdfbb7b9c0b 100644 (file)
@@ -46,6 +46,11 @@ void SnapServer::reset_state()
          p != mds->mdsmap->get_data_pools().end();
          ++p) {
       const pg_pool_t *pi = osdmap->get_pg_pool(*p);
+      if (!pi) {
+        // If pool isn't in OSDMap yet then can't have any snaps needing
+        // removal, skip.
+        continue;
+      }
       if (!pi->removed_snaps.empty() &&
           pi->removed_snaps.range_end() > first_free)
         first_free = pi->removed_snaps.range_end();