From: Sage Weil Date: Mon, 12 Jun 2017 13:48:16 +0000 (-0400) Subject: mon/MgrStatMonitor: keep mgrstat version ahead of pgmon X-Git-Tag: v12.1.0~179^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=62703782ce242791ee7ee40242b4f1cf659c0e80;p=ceph-ci.git mon/MgrStatMonitor: keep mgrstat version ahead of pgmon Pre-luminous, statfs and getpoolstats come from pgmon, and clients will see and track the paxos version for that. After the switchover, those move to mgrstatmon. If a clients sends a version ahead of the current mgrstat version, it will block until the paxos version catches up, which may be years for an aged cluster. Fix by keeping mgrstat version ahead of pgmon's every time it updates. This only really matters right at the transition point (we don't update before that, and after that pgmon doesn't update). Fixes: http://tracker.ceph.com/issues/20219 Signed-off-by: Sage Weil --- diff --git a/src/mon/MgrStatMonitor.cc b/src/mon/MgrStatMonitor.cc index b82ce6084ce..773e2e2dff3 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());