From 2ee61e9857ea37b37074be45e8d19822cef49bf6 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 28 Apr 2016 17:43:05 +0800 Subject: [PATCH] osd: fix problematic got_full_map() logic We shall only clear out requested_full_first/last either we got all we want or we received a map that was newer than requested_full_last. Also we shall increase requested_full_first properly to reflect exactly we have got instead of advancing requested_full_first blindly. NB: if requested_full_first is equal to requested_full_last, we still have one epoch to request. Signed-off-by: xie xingguo --- src/osd/OSD.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 66aebb75e6b..7e04757021f 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4954,23 +4954,18 @@ void OSD::got_full_map(epoch_t e) << ", ignoring" << dendl; return; } - if (e > requested_full_first) { + if (e >= requested_full_last) { dout(10) << __func__ << " " << e << ", requested " << requested_full_first << ".." << requested_full_last << ", resetting" << dendl; requested_full_first = requested_full_last = 0; return; } - if (requested_full_first == requested_full_last) { - dout(10) << __func__ << " " << e << ", requested " << requested_full_first - << ".." << requested_full_last - << ", now done" << dendl; - requested_full_first = requested_full_last = 0; - } else { - dout(10) << __func__ << " " << e << ", requested " << requested_full_first - << ".." << requested_full_last - << ", still need more" << dendl; - ++requested_full_first; - } + + requested_full_first = e + 1; + + dout(10) << __func__ << " " << e << ", requested " << requested_full_first + << ".." << requested_full_last + << ", still need more" << dendl; } void OSD::requeue_failures()