]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: skip obcs that don't exist during backfill scan_range 31029/head
authorSage Weil <sage@redhat.com>
Thu, 3 Oct 2019 18:00:45 +0000 (13:00 -0500)
committerNathan Cutler <ncutler@suse.com>
Mon, 21 Oct 2019 21:05:30 +0000 (23:05 +0200)
We already skip objects we encounter that we do getattr() on and get
ENOENT, but sometimes the object is in our obc cache with exists=false.
Skip those too.

Fixes: https://tracker.ceph.com/issues/42177
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit b700c17ec053c8ffb178d6bd44edb2d643fe8fb6)

src/osd/PrimaryLogPG.cc

index 49134b0079ba528c5ad3b06cfa7d36733456c2df..7eb1671f0c5164dccb56561f82ca2d31e9ed5ab5 100644 (file)
@@ -13327,16 +13327,22 @@ void PrimaryLogPG::scan_range(
     if (is_primary())
       obc = object_contexts.lookup(*p);
     if (obc) {
+      if (!obc->obs.exists) {
+       /* If the object does not exist here, it must have been removed
+        * between the collection_list_partial and here.  This can happen
+        * for the first item in the range, which is usually last_backfill.
+        */
+       continue;
+      }
       bi->objects[*p] = obc->obs.oi.version;
       dout(20) << "  " << *p << " " << obc->obs.oi.version << dendl;
     } else {
       bufferlist bl;
       int r = pgbackend->objects_get_attr(*p, OI_ATTR, &bl);
-
       /* If the object does not exist here, it must have been removed
-        * between the collection_list_partial and here.  This can happen
-        * for the first item in the range, which is usually last_backfill.
-        */
+       * between the collection_list_partial and here.  This can happen
+       * for the first item in the range, which is usually last_backfill.
+       */
       if (r == -ENOENT)
        continue;