From 7572fcdddd26807effa5e26cf5843fa99cffb70a Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Wed, 15 Mar 2023 10:00:29 +0000 Subject: [PATCH] crimson/osd/pg_backend:: rollback to support resolved head Consider the following `resolve_oid()` case: ``` // Because oid.snap > ss.seq, we are trying to read from a snapshot // taken after the most recent write to this object. Read from head. ``` In this case, a no-op is expected as the head object can read from. Signed-off-by: Matan Breizman (cherry picked from commit 18f3a67cb53c473fd74a92ab7d5211dff63b88fa) --- src/crimson/osd/pg_backend.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/crimson/osd/pg_backend.cc b/src/crimson/osd/pg_backend.cc index a441519bab702..1ba05e3429670 100644 --- a/src/crimson/osd/pg_backend.cc +++ b/src/crimson/osd/pg_backend.cc @@ -788,6 +788,13 @@ PGBackend::rollback_iertr::future<> PGBackend::rollback( head, target_coid, [this, &os, &txn, &delta_stats, &osd_op_params] (auto clone_obc) { + if (clone_obc->obs.oi.soid.is_head()) { + // no-op: The resolved oid returned the head object. + logger().debug("PGBackend::rollback: loaded head_obc: {}" + " do nothing", + clone_obc->obs.oi.soid); + return rollback_iertr::now(); + } logger().debug("PGBackend::rollback: loaded clone_obc: {}", clone_obc->obs.oi.soid); // 1) Delete current head -- 2.39.5