Skip to content

Commit 85fdada

Browse files
committed
crimson/osd: remove osd_op_params_t::user_at_version
osd_op_params_t::user_at_version was populated from osd_op_params_t::at_version before the call to prepare_transaction, which incremented osd_op_params_t::at_version.version. As a result, the value stored in object_info_t::user_version ended up one version behind object_info_t::version. The log entry, on the other hand, ended up with the correct version as OpsExecutor::prepare_transaction populates it directly from at_version. As a result, the primary could return different versions to the client depending on whether the IO was already in the log. This commit eliminates osd_op_params_t::user_at_version and updates PGBackend::mutate_object to behave like prepare_transaction. Because the prior commit removes the prepare_transaction increment, this isn't strictly necessary, but it is simpler. Fixes: https://tracker.ceph.com/issues/65857 Signed-off-by: Samuel Just <[email protected]>
1 parent 7e0dde7 commit 85fdada

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

src/crimson/osd/ops_executer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,6 @@ OpsExecuter::flush_changes_n_do_ops_effects(
520520
ceph_assert(want_mutate);
521521
}
522522
if (want_mutate) {
523-
if (osd_op_params->user_modify) {
524-
osd_op_params->user_at_version = osd_op_params->at_version.version;
525-
}
526523
maybe_mutated = flush_clone_metadata(
527524
prepare_transaction(ops),
528525
snap_mapper,

src/crimson/osd/osd_operations/osdop_params.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ struct osd_op_params_t {
1414
eversion_t pg_trim_to;
1515
eversion_t min_last_complete_ondisk;
1616
eversion_t last_complete;
17-
version_t user_at_version = 0;
1817
bool user_modify = false;
1918
ObjectCleanRegions clean_regions;
2019
interval_set<uint64_t> modified_ranges;

src/crimson/osd/pg_backend.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ PGBackend::mutate_object(
165165
if (obc->obs.exists) {
166166
obc->obs.oi.prior_version = obc->obs.oi.version;
167167
obc->obs.oi.version = osd_op_p.at_version;
168-
if (osd_op_p.user_at_version > obc->obs.oi.user_version)
169-
obc->obs.oi.user_version = osd_op_p.user_at_version;
168+
if (osd_op_p.user_modify)
169+
obc->obs.oi.user_version = osd_op_p.at_version.version;
170170
obc->obs.oi.last_reqid = osd_op_p.req_id;
171171
obc->obs.oi.mtime = osd_op_p.mtime;
172172
obc->obs.oi.local_mtime = ceph_clock_now();

0 commit comments

Comments
 (0)