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 <sjust@redhat.com>
(cherry picked from commit
85fdadab2adcfbec83a82c6f1bae1f4f31a96f54)
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,
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;
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();