]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: on the cloning path bump obj version closer to its usage
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Apr 2024 13:54:23 +0000 (13:54 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 16 Jun 2024 10:19:56 +0000 (13:19 +0300)
My understanding at the time of writing is this change is a pure
refactoring.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit 99fdc0cc478c169c30627d4436bb7aebd3335c8d)

src/crimson/osd/ops_executer.cc

index 238832443e417cc3b3a01f1d90fcc5044f9558cf..6738b01f7acba0a92810073ea9d54fe3c5208922 100644 (file)
@@ -967,7 +967,6 @@ std::unique_ptr<OpsExecuter::CloningContext> OpsExecuter::execute_clone(
     initial_obs.oi.mtime, // will be replaced in `apply_to()`
     0
   };
-  osd_op_params->at_version.version++;
   encode(cloned_snaps, cloning_ctx->log_entry.snaps);
 
   return cloning_ctx;
@@ -1049,6 +1048,8 @@ ObjectContextRef OpsExecuter::prepare_clone(
   clone_obs.oi.copy_user_bits(obc->obs.oi);
   clone_obs.oi.clear_flag(object_info_t::FLAG_WHITEOUT);
 
+  osd_op_params->at_version.version++;
+
   auto [clone_obc, existed] = pg->obc_registry.get_cached_obc(std::move(coid));
   ceph_assert(!existed);