From a6da03104cfcbf57ec0f19c5551d26b5863ec7d0 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sat, 30 Mar 2024 16:49:34 -0700 Subject: [PATCH] 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 --- src/osd/ECBackend.cc | 10 +++++++++- src/osd/ECCommon.h | 12 +++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index cab6bbb3acb..fa2570aba42 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 2727b76d243..7ff9cae7646 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; -- 2.47.3