]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/pg_backend: tolerate enoent on head in rollback
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 31 Aug 2025 14:01:43 +0000 (22:01 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 2 Sep 2025 06:27:52 +0000 (14:27 +0800)
Currently when rolling back, we tolerate a missing clone (enoent) or a missing snapshot by removing the head.
However, we should also tolerate the case where the head is missing when trying to remove it.

Fixes: https://tracker.ceph.com/issues/72790
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/pg_backend.cc

index 7abf8372c6cc3c44320f3cde822053096f109009..cec03d3c20e06f2e0c84984eaea44d9cc24c9399 100644 (file)
@@ -833,7 +833,14 @@ PGBackend::rollback_iertr::future<> PGBackend::rollback(
                      " because got ENOENT|whiteout on obc lookup",
                      os.oi.soid, snapid);
       return remove(os, txn, osd_op_params, delta_stats,
-                    should_whiteout(ss, snapc), os.oi.size);
+                    should_whiteout(ss, snapc), os.oi.size
+      ).handle_error_interruptible(
+       crimson::ct_error::enoent::handle([] {
+         // We consider rolling back a non-existing head to
+         // non-existing clone as a no-op.
+         return rollback_iertr::now();
+       })
+      );
     }),
     rollback_ertr::pass_further{},
     crimson::ct_error::assert_all{"unexpected error in rollback"}