]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: skip obcs that don't exist during backfill scan_range 31030/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:06:44 +0000 (23:06 +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 98f51d4d1fb3f76c0f0c3415b7b7dda6b3a3673e..3604551f27c8b7c66906734551fa46403ab3b2cf 100644 (file)
@@ -12618,16 +12618,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;