From: Sage Weil Date: Mon, 10 Apr 2017 21:36:37 +0000 (-0400) Subject: mon/OSDMonitor: tolerate upgrade from post-kraken dev cluster X-Git-Tag: v12.0.3~283^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=32b1b0476ad0d6a50d84732ce96cda6ee09f6bec;p=ceph.git mon/OSDMonitor: tolerate upgrade from post-kraken dev cluster If the 'creating' pgs key is missing, move on without crashing. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7daca9c887d9..af3709a07254 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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 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 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);