From dce6f288ad541fe7f0ef8374301cd712dd3bfa39 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 11 Dec 2014 13:05:54 -0800 Subject: [PATCH] ReplicatedPG::scan_range: an object can disappear between the list and the attr get The first item in the range is often last_backfill, upon which writes can be occuring. It's trimmed off on the primary side anyway. Fixes: 10150 Backport: dumpling, firefly, giant Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 95b61a311224..17563b3239b8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -10546,6 +10546,14 @@ void ReplicatedPG::scan_range( } 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. + */ + if (r == -ENOENT) + continue; + assert(r >= 0); object_info_t oi(bl); bi->objects[*p] = oi.version; -- 2.47.3