From 62703782ce242791ee7ee40242b4f1cf659c0e80 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 12 Jun 2017 09:48:16 -0400 Subject: [PATCH 1/2] 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 --- src/mon/MgrStatMonitor.cc | 5 +++++ 1 file changed, 5 insertions(+) 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()); From 5325460b3921d0e10074f2dc852fee330ac603c5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 12 Jun 2017 09:48:48 -0400 Subject: [PATCH 2/2] mon/PGMonitor: assert PGMonitor stops proposing after luminous One hacky exception here for the rebuild-mondb case. Signed-off-by: Sage Weil --- src/mon/PGMonitor.cc | 3 +++ 1 file changed, 3 insertions(+) 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);