From: Sage Weil Date: Thu, 3 Oct 2019 18:00:45 +0000 (-0500) Subject: osd/PrimaryLogPG: skip obcs that don't exist during backfill scan_range X-Git-Tag: v12.2.13~62^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b56cbddd7d26db72557e77eba4ed003d6ce772e0;p=ceph.git osd/PrimaryLogPG: skip obcs that don't exist during backfill scan_range 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 (cherry picked from commit b700c17ec053c8ffb178d6bd44edb2d643fe8fb6) --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 98f51d4d1fb3f..3604551f27c8b 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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;