]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../client_request_common: skip non-existent oids in recover_missings 54931/head
authorSamuel Just <sjust@redhat.com>
Sat, 16 Dec 2023 00:26:30 +0000 (00:26 +0000)
committerSamuel Just <sjust@redhat.com>
Sat, 16 Dec 2023 00:29:59 +0000 (16:29 -0800)
See comment.

Introduced: 38cc750f
Fixes: https://tracker.ceph.com/issues/63821
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/client_request_common.cc

index c406a6c8330b2a9823fdb77d9c6dd83e3e61651d..fb919a1b07cfd14b384383978977537d3c0b6216 100644 (file)
@@ -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();
+         }
        });
       });
     });