]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg_backend:: rollback to support resolved head
authorMatan Breizman <mbreizma@redhat.com>
Wed, 15 Mar 2023 10:00:29 +0000 (10:00 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 09:34:47 +0000 (09:34 +0000)
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 <mbreizma@redhat.com>
(cherry picked from commit 18f3a67cb53c473fd74a92ab7d5211dff63b88fa)

src/crimson/osd/pg_backend.cc

index a441519bab70288b37b9804ff2d12a2344f62244..1ba05e34296706758a0db670417ed0b321a6b00a 100644 (file)
@@ -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