dout(10) << __func__ << dendl;
/*
* the monmap may be in one of three places:
+ * 'mon_sync:temp_newer_monmap' - stashed newer map for bootstrap
* 'monmap:<latest_version_no>' - the monmap we'd really like to have
* 'mon_sync:latest_monmap' - last monmap backed up for the last sync
* 'mkfs:monmap' - a monmap resulting from mkfs
ceph_assert(bl.length() > 0);
dout(10) << __func__ << " read last committed monmap ver "
<< latest_ver << dendl;
+
+ // see if there is stashed newer map (see bootstrap())
+ if (store.exists("mon_sync", "temp_newer_monmap")) {
+ bufferlist bl2;
+ int err = store.get("mon_sync", "temp_newer_monmap", bl2);
+ ceph_assert(err == 0);
+ ceph_assert(bl2.length() > 0);
+ MonMap b;
+ b.decode(bl2);
+ if (b.get_epoch() > latest_ver) {
+ dout(10) << __func__ << " using stashed monmap " << b.get_epoch()
+ << " instead" << dendl;
+ bl.claim(bl2);
+ } else {
+ dout(10) << __func__ << " ignoring stashed monmap " << b.get_epoch()
+ << dendl;
+ }
+ }
return 0;
}
}
<< messenger->get_myaddrs()
<< ", monmap is " << monmap->get_addrs(newrank) << ", respawning"
<< dendl;
+
+ if (monmap->get_epoch()) {
+ // store this map in temp mon_sync location so that we use it on
+ // our next startup
+ derr << " stashing newest monmap " << monmap->get_epoch()
+ << " for next startup" << dendl;
+ bufferlist bl;
+ monmap->encode(bl, -1);
+ auto t(std::make_shared<MonitorDBStore::Transaction>());
+ t->put("mon_sync", "temp_newer_monmap", bl);
+ store->apply_transaction(t);
+ }
+
respawn();
}
if (newrank != rank) {