-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
DB Integration & Observability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
Remove the shard eligibility cache (EndOfTransactionMetadataShardCache) and the strip-and-retry logic it supports from the transaction coordinator. The cache is a rollout workaround that is only needed to roll out the end-of-transaction (EOT) feature safely in mixed 9.1/9.0 clusters, and it can be removed once FCV 10 is the latest reachable FCV.
Background
The EOT change stream feature attaches commit-time accounting metadata (endOfTransactionScopes) to the commitTransaction command; each participant echoes it into its commitTransaction oplog entry. commitTransaction is a strict command, so a shard running an older binary (9.0) rejects the new field with IDLUnknownField.
To roll the feature out safely while a cluster can still contain 9.0 shards, the coordinator (introduced in SERVER-137904) attaches the metadata only to shards it believes understand it; on IDLUnknownField it strips the metadata, retries the commit, and records the shard in a process-wide, time-based eligibility cache ({{src/mongo/db/s/end_of_transaction_metadata_shard_cache.
{h,cpp}}}), so that subsequent commits skip the metadata without paying for another failed round trip.
Once FCV 10 is the latest reachable FCV (9.0 is out of the upgrade/downgrade path), every shard understands the field, so the cache, the strip-and-retry, and the mixed-version tests are dead weight.
Scope of Work
* Remove src/mongo/db/s/end_of_transaction_metadata_shard_cache.h/cpp} and end_of_transaction_metadata_shard_cache_test.cpp (plus the BUILD target entry).
* In src/mongo/db/s/transaction_coordinator_util.cpp:
** Drop the EndOfTransactionMetadataShardCache usage (isShardEligible / markShardIneligible) from sendCommit / sendDecisionToShard.
** Remove the strip-and-retry path: the commandObjWithoutEndOfTransactionScopes parameter, the IDLUnknownField handling, the metadata-rejection log (id 13790402) and resetEndOfTransactionMetadataRejectedLogSeveritySuppressor_forTest.
** sendCommit unconditionally attaches endOfTransactionScopes to the write participants' commit commands (the eligibility check is gone).
* Remove the mixed-version jstests that exercise the strip-and-retry: jstests/multiVersion/genericBinVersion/query-execution-change-streams/end_of_transaction_metadata_mixed_version_cluster.js and the replica-set variant.
* Remove/adjust the coordinator unit tests that assert the strip-and-retry and cache behavior.
Acceptance Criteria
* No references to EndOfTransactionMetadataShardCache, isShardEligible or markShardIneligible remain.
* The coordinator attaches the metadata to write participants without any per-shard eligibility check; the commit path has no IDLUnknownField strip-and-retry and no metadata-rejection log.
* Remaining tests pass; the mixed-version strip-and-retry tests are removed.
Technical Notes
* Introduced by SERVER-137904 (epic SPM-4826).
* Blocked on FCV 10 being the latest reachable FCV. Until then a 9.0 shard may still be present (including during upgrade), so the strip-and-retry is still required.
* Keep the write-path gating (featureFlagEndOfTransactionChangeEventSynthesis + allowEndOfTransaction); only the mixed-version eligibility workaround is removed.
- is caused by
-
SERVER-137904 Make txn coordinator compute and send endOfTransaction metadata
-
- Needs Merge
-