Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #15584 from liewegas/wip-20219
mon/MgrStatMonitor: keep mgrstat version ahead of pgmon

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
liewegas committed Jun 12, 2017
2 parents ed249be + 5325460 commit 0c2e02e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mon/MgrStatMonitor.cc
Expand Up @@ -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());
Expand Down
3 changes: 3 additions & 0 deletions src/mon/PGMonitor.cc
Expand Up @@ -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);
Expand Down

0 comments on commit 0c2e02e

Please sign in to comment.