From: Samuel Just Date: Sat, 30 Mar 2024 23:49:34 +0000 (-0700) Subject: osd/ECBackend: simplfy pg_committed_to handling X-Git-Tag: v20.0.0~707^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a6da03104cfcbf57ec0f19c5551d26b5863ec7d0;p=ceph.git osd/ECBackend: simplfy pg_committed_to handling See comment for details. Modifies ECBackend::submit_transaction to use the passed pg_committed_to unconditionally, adds a comment to explain, and adds a comment to RMWPipeline::pg_committed_to to clarify that it may lag PeeringState::pg_committed_to. Signed-off-by: Samuel Just --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index cab6bbb3acbe..fa2570aba42a 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1485,7 +1485,15 @@ void ECBackend::submit_transaction( op->delta_stats = delta_stats; op->version = at_version; op->trim_to = trim_to; - op->pg_committed_to = std::max(pg_committed_to, rmw_pipeline.committed_to); + /* We update PeeringState::pg_committed_to via the callback + * invoked from ECBackend::handle_sub_write_reply immediately + * before updating rmw_pipeline.commited_to via + * rmw_pipeline.check_ops()->try_finish_rmw(), so these will + * *usually* match. However, the PrimaryLogPG::submit_log_entries + * pathway can perform an out-of-band log update which updates + * PeeringState::pg_committed_to independently. Thus, the value + * passed in is the right one to use. */ + op->pg_committed_to = pg_committed_to; op->log_entries = log_entries; std::swap(op->updated_hit_set_history, hset_history); op->on_all_commit = on_all_commit; diff --git a/src/osd/ECCommon.h b/src/osd/ECCommon.h index 2727b76d2430..7ff9cae7646a 100644 --- a/src/osd/ECCommon.h +++ b/src/osd/ECCommon.h @@ -522,7 +522,17 @@ struct ECCommon { osd_reqid_t reqid; ZTracer::Trace trace; - eversion_t pg_committed_to; /// Soon to be generated internally + /** + * pg_commited_to + * + * Represents a version v such that all v' < v handled by RMWPipeline + * have fully committed. This may actually lag + * PeeringState::pg_committed_to if PrimaryLogPG::submit_log_entries + * submits an out-of-band log update. + * + * Soon to be generated internally. + */ + eversion_t pg_committed_to; /// Ancillary also provided from submit_transaction caller std::map obc_map;