From 738f947aa9f8720a9e7cc31e3793a07226953474 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 9 Mar 2017 22:14:41 +0800 Subject: [PATCH] mon/OSDMonitor: update comment in update_from_paxos() this change updates the comment for 7fb3804fb, 97462a3 and e807770, to reflect the reason why we need to fix latest_full in current code. as the fix is not a workaround for cuttlefish anymore, it resolves the issue where 0. mon.c has a latest_full of 5 1. mon.c is shutdown and out of sync with the quorum 2. mon.c starts sync 3. mon.c now has osdmap[31..50], and the latest_full is still 5. Signed-off-by: Kefu Chai --- src/mon/OSDMonitor.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c6453f3478b78..028ef88338b4f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -191,16 +191,14 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) if (get_first_committed() > 1 && latest_full < get_first_committed()) { - /* a bug introduced in 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 would lead - * us to not update the on-disk latest_full key. Upon trim, the actual - * version would cease to exist but we would still point to it. This - * makes sure we get it pointing to a proper version. - */ + // the monitor could be just sync'ed with its peer, and the latest_full key + // is not encoded in the paxos commits in encode_pending(), so we need to + // make sure we get it pointing to a proper version. version_t lc = get_last_committed(); version_t fc = get_first_committed(); dout(10) << __func__ << " looking for valid full map in interval" - << " [" << fc << ", " << lc << "]" << dendl; + << " [" << fc << ", " << lc << "]" << dendl; latest_full = 0; for (version_t v = lc; v >= fc; v--) { @@ -212,9 +210,6 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) } } - // if we trigger this, then there's something else going with the store - // state, and we shouldn't want to work around it without knowing what - // exactly happened. assert(latest_full > 0); auto t(std::make_shared()); put_version_latest_full(t, latest_full); -- 2.39.5