diff --git a/src/mon/MgrStatMonitor.cc b/src/mon/MgrStatMonitor.cc index b82ce6084ceee..773e2e2dff316 100644 --- a/src/mon/MgrStatMonitor.cc +++ b/src/mon/MgrStatMonitor.cc @@ -100,6 +100,11 @@ void MgrStatMonitor::create_pending() void MgrStatMonitor::encode_pending(MonitorDBStore::TransactionRef t) { ++version; + if (version < mon->pgmon()->get_last_committed()) { + // fast-forward to pgmon version to ensure clients don't see a + // jump back in time for MGetPoolStats and MStatFs. + version = mon->pgmon()->get_last_committed() + 1; + } dout(10) << " " << version << dendl; bufferlist bl; ::encode(pending_digest, bl, mon->get_quorum_con_features()); diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index fc46cbf92d069..6937887c5f3c0 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -467,6 +467,9 @@ void PGMonitor::encode_pending(MonitorDBStore::TransactionRef t) return; } + assert(mon->osdmon()->osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS || + pending_inc.version == 1 /* rebuild-mondb.yaml case */); + version_t version = pending_inc.version; dout(10) << __func__ << " v " << version << dendl; assert(get_last_committed() + 1 == version);