From: Guang Yang Date: Wed, 9 Jul 2014 11:20:36 +0000 (+0000) Subject: Fix the PG listing issue which could miss objects for EC pool (where there is object... X-Git-Tag: v0.84~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2088%2Fhead;p=ceph.git Fix the PG listing issue which could miss objects for EC pool (where there is object shard and generation). Backport: firefly Signed-off-by: Guang Yang (yguang@yahoo-inc.com) --- diff --git a/src/os/ObjectStore.cc b/src/os/ObjectStore.cc index 4e77af93e261..dfd5a33de075 100644 --- a/src/os/ObjectStore.cc +++ b/src/os/ObjectStore.cc @@ -610,7 +610,11 @@ int ObjectStore::collection_list_range(coll_t c, hobject_t start, hobject_t end, snapid_t seq, vector *ls) { vector go; - ghobject_t gstart(start), gend(end); + // Starts with the smallest shard id and generation to + // make sure the result list has the marker object + ghobject_t gstart(start, 0, shard_id_t(0)); + // Exclusive end, choose the smallest end ghobject + ghobject_t gend(end, 0, shard_id_t(0)); int ret = collection_list_range(c, gstart, gend, seq, &go); if (ret == 0) { ls->reserve(go.size()); diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 09cbe8daa501..39e4b7809eb8 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -116,7 +116,11 @@ int PGBackend::objects_list_partial( hobject_t *next) { assert(ls); - ghobject_t _next(begin); + // Starts with the smallest shard id and generation to + // make sure the result list has the marker object ( + // it might have multiple generations though, which would + // be filtered). + ghobject_t _next(begin, 0, shard_id_t(0)); ls->reserve(max); int r = 0; while (!_next.is_max() && ls->size() < (unsigned)min) {