-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Replication
-
None
-
None
-
None
-
None
-
None
-
None
-
None
SERVER-128128 added participant-failover detection for sharded transactions. The implementation has one follow-up cleanup site once 9.0 becomes last-LTS (so pre-9.0 binaries can no longer share a cluster).
Background
A participant attaches its replication term to transaction statement responses via $replData.term (written via ReplSetMetadata::appendTermOnly), and the router reads it back with readTermOnly into ParsedParticipantResponseMetadata::observedTerm. The router validates the term in TransactionRouter::Router::_validateAndRecordParticipantTerm to detect a participant that changed primaries mid-transaction.
$replData was chosen over a new top-level IDL reply field because it exists on all branches (v7.0, v8.0, v8.3, master) and term is already an existing sub-field, making the approach safe across mixed-version clusters with no FCV gate needed.
One TODO site (tagged TODO SERVER-130162 in source)
Router: replace tolerance with uassert
File: src/mongo/s/transaction_router.cpp, _validateAndRecordParticipantTerm
// observedTerm is absent when the responding participant does not report a term in $replData // (e.g. an older binary). There is nothing to validate then. // TODO SERVER-130162: Once 9.0 becomes lastLTS, all participants are guaranteed to send // $replData.term; make observedTerm required and remove this early return. >if (!observedTerm) { return; }
Replace the early-return with a uassert that observedTerm is present, making term validation strict.
Note
Verify the multiversion test matrix no longer pairs the new binary against pre-9.0 binaries before merging, to avoid burn-in failures.
- related to
-
SERVER-130332 Switch participant term transport from $replData.term to dedicated participantTerm field once 9.0 is last-LTS
-
- Blocked
-