]> git.apps.os.sepia.ceph.com Git - ceph.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>
Wed, 1 May 2024 07:12:17 +0000 (07:12 +0000)
My understanding at the time of writing is this change is a pure
refactoring.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/ops_executer.cc

index 6b0c4cf7ee269d52bd09b3acd805f58d55bb70e3..94b82116f59567df23c4203b32eb106a2b9fc782 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;
@@ -1050,6 +1049,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);