From c7a30b881151e08b37339bb025789921e7115288 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 6 Nov 2013 14:33:03 -0800 Subject: ReplicatedPG: don't skip missing if sentries is empty on pgls Formerly, if sentries is empty, we skip missing. In general, we need to continue adding items from missing until we get to next (returned from collection_list_partial) to avoid missing any objects. Fixes: #6633 Signed-off-by: Samuel Just Reviewed-by: David Zafman --- src/osd/ReplicatedPG.cc | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 48040b68a88..19592a64cea 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -655,19 +655,38 @@ void ReplicatedPG::do_pg_op(OpRequestRef op) map::const_iterator missing_iter = pg_log.get_missing().missing.lower_bound(current); vector::iterator ls_iter = sentries.begin(); + hobject_t _max = hobject_t::get_max(); while (1) { - if (ls_iter == sentries.end()) { - break; - } + const hobject_t &mcand = + missing_iter == pg_log.get_missing().missing.end() ? + _max : + missing_iter->first; + const hobject_t &lcand = + ls_iter == sentries.end() ? + _max : + *ls_iter; hobject_t candidate; - if (missing_iter == pg_log.get_missing().missing.end() || - *ls_iter < missing_iter->first) { - candidate = *(ls_iter++); + if (mcand == lcand) { + candidate = mcand; + if (!mcand.is_max()) { + ls_iter++; + missing_iter++; + } + } else if (mcand < lcand) { + candidate = mcand; + assert(!mcand.is_max()); + ++missing_iter; } else { - candidate = (missing_iter++)->first; + candidate = lcand; + assert(!lcand.is_max()); + ++ls_iter; } + if (candidate >= next) { + break; + } + if (response.entries.size() == list_size) { next = candidate; break; -- cgit v1.2.3