diff options
author | Sage Weil <sage@inktank.com> | 2013-07-24 11:55:42 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-24 12:12:38 -0700 |
commit | 27f31895664fa7f10c1617d486f2a6ece0f97091 (patch) | |
tree | d4b67fe2a7cc0679dc281b94484adfae40228b7c | |
parent | 5b0967f03efb1be210b52f24f095f023fe1bc539 (diff) | |
download | ceph-27f31895664fa7f10c1617d486f2a6ece0f97091.tar.gz |
mon/OSDMonitor: search for latest full osdmap if record version is missing
In 97462a3213e5e15812c79afc0f54d697b6c498b1 we tried to search for a
recent full osdmap but were looking at the wrong key. If full_0 was
present we could record that the latest full map was last_committed even
though it wasn't present. This is fixed in 76cd7ac1c, but we need to
compensate for when get_version_latest_full() gives us a back version
number by repeating the search.
Fixes: #5737
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit c2131d4047156aa2964581c9dbd93846382a07e7)
-rw-r--r-- | src/mon/OSDMonitor.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 05cafcd8ff4..ad4e5f1d4a1 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -127,6 +127,16 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) if (latest_full == 0 && get_first_committed() > 1) latest_full = get_first_committed(); + if (latest_full > 0) { + // make sure we can really believe get_version_latest_full(); see + // 76cd7ac1c2094b34ad36bea89b2246fa90eb2f6d + bufferlist test; + get_version_full(latest_full, test); + if (test.length() == 0) { + dout(10) << __func__ << " ignoring recorded latest_full as it is missing; fallback to search" << dendl; + latest_full = 0; + } + } if (get_first_committed() > 1 && latest_full < get_first_committed()) { /* a bug introduced in 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 would lead |