]> 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...
authorGuang Yang <yguang@yahoo-inc.com>
Wed, 9 Jul 2014 11:20:36 +0000 (11:20 +0000)
committerSage Weil <sage@redhat.com>
Sat, 2 Aug 2014 00:07:36 +0000 (17:07 -0700)
Backport: firefly
Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
(cherry picked from commit 228760ce3a7109f50fc0f8e3c4a5697a423cb08f)

src/os/ObjectStore.cc
src/osd/PGBackend.cc

index e4e22572d59e575f11daddfbe0f078ff9c7867a7..afa90b16e495f7e4a3f1aa1774b22724f714a7d0 100644 (file)
@@ -144,7 +144,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 e1aceef4ac9b09585c65c5cb791a35960035b795..e93f05d268528a3c20fb207d2be7e4e92ffeece8 100644 (file)
@@ -115,7 +115,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) {