]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: tolerate upgrade from post-kraken dev cluster 14442/head
authorSage Weil <sage@redhat.com>
Mon, 10 Apr 2017 21:36:37 +0000 (17:36 -0400)
committerSage Weil <sage@redhat.com>
Mon, 17 Apr 2017 21:33:09 +0000 (17:33 -0400)
If the 'creating' pgs key is missing, move on without crashing.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index 7daca9c887d965314b620749f84266a9ed71f462..af3709a07254e9bf3a1d1a8238b522f63f2e5834 100644 (file)
@@ -247,12 +247,17 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
        ceph::features::mon::FEATURE_LUMINOUS)) {
     bufferlist bl;
     mon->store->get(OSD_PG_CREATING_PREFIX, "creating", bl);
-    auto p = bl.begin();
-    std::lock_guard<std::mutex> l(creating_pgs_lock);
-    creating_pgs.decode(p);
-    dout(7) << __func__ << " loading creating_pgs last_scan_epoch "
-           << creating_pgs.last_scan_epoch
-           << " with " << creating_pgs.pgs.size() << " pgs" << dendl;
+    if (bl.length()) {
+      auto p = bl.begin();
+      std::lock_guard<std::mutex> l(creating_pgs_lock);
+      creating_pgs.decode(p);
+      dout(7) << __func__ << " loading creating_pgs last_scan_epoch "
+             << creating_pgs.last_scan_epoch
+             << " with " << creating_pgs.pgs.size() << " pgs" << dendl;
+    } else {
+      dout(1) << __func__ << " missing creating pgs; upgrade from post-kraken?"
+             << dendl;
+    }
   }
 
   // walk through incrementals
@@ -264,7 +269,8 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
     assert(err == 0);
     assert(inc_bl.length());
 
-    dout(7) << "update_from_paxos  applying incremental " << osdmap.epoch+1 << dendl;
+    dout(7) << "update_from_paxos  applying incremental " << osdmap.epoch+1
+           << dendl;
     OSDMap::Incremental inc(inc_bl);
     err = osdmap.apply_incremental(inc);
     assert(err == 0);