From decd662b8c1c41ff194bdefb611eee90a060cfae Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sat, 16 Dec 2023 00:26:30 +0000 Subject: [PATCH] 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 --- .../osd/osd_operations/client_request_common.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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(); + } }); }); }); -- 2.47.3