From fa7ef62d2c6759caac3edf89438fec381bd2e755 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Thu, 21 Nov 2024 16:22:47 +0800 Subject: crimson/osd/replicated_recovery_backend: ignore the recovery of delete objects Signed-off-by: Xuehan Xu --- src/crimson/osd/replicated_recovery_backend.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/crimson') diff --git a/src/crimson/osd/replicated_recovery_backend.cc b/src/crimson/osd/replicated_recovery_backend.cc index 31f05836b8e..e969ea17a31 100644 --- a/src/crimson/osd/replicated_recovery_backend.cc +++ b/src/crimson/osd/replicated_recovery_backend.cc @@ -35,6 +35,15 @@ ReplicatedRecoveryBackend::recover_object( logger().debug("recover_object: loading obc: {}", soid); return pg.obc_loader.with_obc(soid, [this, soid, need](auto head, auto obc) { + if (!obc->obs.exists) { + // XXX: this recovery must be triggered by backfills and the corresponding + // object must have been deleted by some client request after the object + // is enqueued for push but before the lock is acquired by the recovery. + // + // Abort the recovery in this case, a "recover_delete" must have been + // added for this object by the client request that deleted it. + return interruptor::now(); + } logger().debug("recover_object: loaded obc: {}", obc->obs.oi.soid); auto& recovery_waiter = get_recovering(soid); recovery_waiter.obc = obc; -- cgit v1.2.3