From: Samuel Just Date: Sat, 16 Dec 2023 00:26:30 +0000 (+0000) Subject: crimson/.../client_request_common: skip non-existent oids in recover_missings X-Git-Tag: v19.3.0~347^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F54931%2Fhead;p=ceph.git crimson/.../client_request_common: skip non-existent oids in recover_missings See comment. Introduced: 38cc750f Fixes: https://tracker.ceph.com/issues/63821 Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/osd_operations/client_request_common.cc b/src/crimson/osd/osd_operations/client_request_common.cc index c406a6c8330b..fb919a1b07cf 100644 --- a/src/crimson/osd/osd_operations/client_request_common.cc +++ b/src/crimson/osd/osd_operations/client_request_common.cc @@ -38,12 +38,22 @@ CommonClientRequest::recover_missings( [pg, soid, head](auto &snaps) mutable { return InterruptibleOperation::interruptor::do_for_each( snaps, - [pg, soid, head](auto &snap) mutable { + [pg, soid, head](auto &snap) mutable -> + InterruptibleOperation::template interruptible_future<> { auto coid = head->obs.oi.soid; coid.snap = snap; auto oid = resolve_oid(head->get_head_ss(), coid); - assert(oid); - return do_recover_missing(pg, *oid); + /* Rollback targets may legitimately not exist if, for instance, + * the object is an rbd block which happened to be sparse and + * therefore non-existent at the time of the specified snapshot. + * In such a case, rollback will simply delete the object. Here, + * we skip the oid as there is no corresponding clone to recover. + * See https://tracker.ceph.com/issues/63821 */ + if (oid) { + return do_recover_missing(pg, *oid); + } else { + return seastar::now(); + } }); }); });