]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix the PG listing issue which could miss objects for EC pool (where there is object... 2088/head
authorGuang Yang <yguang@yahoo-inc.com>
Wed, 9 Jul 2014 11:20:36 +0000 (11:20 +0000)
committerGuang Yang <yguang@yahoo-inc.com>
Thu, 10 Jul 2014 01:05:40 +0000 (01:05 +0000)
Backport: firefly
Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
src/os/ObjectStore.cc
src/osd/PGBackend.cc

index 4e77af93e261e6e8b293385c1a260999f0876e33..dfd5a33de075bbf77bfedd53550c8ac23cadc412 100644 (file)
@@ -610,7 +610,11 @@ int ObjectStore::collection_list_range(coll_t c, hobject_t start, hobject_t end,
                            snapid_t seq, vector<hobject_t> *ls)
 {
   vector<ghobject_t> 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());
index 09cbe8daa5017da3290b87fc5e2764d7dd1768ce..39e4b7809eb8c47db401e7eafa39987ace26147b 100644 (file)
@@ -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) {