Skip to content

Commit

Permalink
crimson/osd: remove osd_op_params_t::user_at_version
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
athanatos committed May 10, 2024
1 parent 7e0dde7 commit 85fdada
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/crimson/osd/ops_executer.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,6 @@ OpsExecuter::flush_changes_n_do_ops_effects(
ceph_assert(want_mutate);
}
if (want_mutate) {
if (osd_op_params->user_modify) {
osd_op_params->user_at_version = osd_op_params->at_version.version;
}
maybe_mutated = flush_clone_metadata(
prepare_transaction(ops),
snap_mapper,
Expand Down
1 change: 0 additions & 1 deletion src/crimson/osd/osd_operations/osdop_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct osd_op_params_t {
eversion_t pg_trim_to;
eversion_t min_last_complete_ondisk;
eversion_t last_complete;
version_t user_at_version = 0;
bool user_modify = false;
ObjectCleanRegions clean_regions;
interval_set<uint64_t> modified_ranges;
Expand Down
4 changes: 2 additions & 2 deletions src/crimson/osd/pg_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ PGBackend::mutate_object(
if (obc->obs.exists) {
obc->obs.oi.prior_version = obc->obs.oi.version;
obc->obs.oi.version = osd_op_p.at_version;
if (osd_op_p.user_at_version > obc->obs.oi.user_version)
obc->obs.oi.user_version = osd_op_p.user_at_version;
if (osd_op_p.user_modify)
obc->obs.oi.user_version = osd_op_p.at_version.version;
obc->obs.oi.last_reqid = osd_op_p.req_id;
obc->obs.oi.mtime = osd_op_p.mtime;
obc->obs.oi.local_mtime = ceph_clock_now();
Expand Down

0 comments on commit 85fdada

Please sign in to comment.