]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: reload obc also when handling ct_error::object_corrupted.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Mar 2021 16:51:22 +0000 (16:51 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 10 May 2021 16:01:32 +0000 (18:01 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/pg.cc

index 82f15ee14be4671baac0c1fade367324d773f47b..99d704bf207ab38324063cafa691f8e2e111f364 100644 (file)
@@ -743,9 +743,18 @@ PG::do_osd_ops_iertr::future<Ret> PG::do_osd_ops_execute(
     });
   }).safe_then_interruptible_tuple([success_func=std::move(success_func)] {
     return std::move(success_func)();
-  }, crimson::ct_error::object_corrupted::handle([m, obc, this] {
-    return repair_object(m, obc->obs.oi.soid, obc->obs.oi.version).then_interruptible([] {
-      return do_osd_ops_iertr::future<Ret>{crimson::ct_error::eagain::make()};
+  }, crimson::ct_error::object_corrupted::handle(
+    [m, obc, rollbacker, this] (const std::error_code& e) mutable {
+    // this is a path for EIO. it's special because we want to fix the obejct
+    // and try again. that is, the layer above `PG::do_osd_ops` is supposed to
+    // restart the execution.
+    return rollbacker.rollback_obc_if_modified(e).then_interruptible(
+      [m, obc, this] {
+      return repair_object(m,
+                           obc->obs.oi.soid,
+                           obc->obs.oi.version).then_interruptible([] {
+        return do_osd_ops_iertr::future<Ret>{crimson::ct_error::eagain::make()};
+      });
     });
   }), OpsExecuter::osd_op_errorator::all_same_way(
     [rollbacker, failure_func=std::move(failure_func), m]