summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-11-06 23:33:03 +0100
committerSamuel Just <sam.just@inktank.com>2013-11-07 02:55:12 +0100
commitc7a30b881151e08b37339bb025789921e7115288 (patch)
tree55255e3983a3acead812b4cf85e74b5afd26e549
parentPG: fix operator<<,log_wierdness log bound warning (diff)
downloadceph-c7a30b881151e08b37339bb025789921e7115288.tar.xz
ceph-c7a30b881151e08b37339bb025789921e7115288.zip
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 <sam.just@inktank.com> Reviewed-by: David Zafman <david.zafman@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc33
1 files 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<hobject_t, pg_missing_t::item>::const_iterator missing_iter =
pg_log.get_missing().missing.lower_bound(current);
vector<hobject_t>::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;