-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Add the end-to-end change stream FSM suite verifying the endOfTransaction event (SPM-4826) on replica sets: prediction per watch mode and reader mode, the gating matrix and equivalence, multi-writer interleave, and resume flavors. Each test builds its own cluster (nodb suite).
Scope of Work
* Create jstests/libs/util/change_stream/change_stream_txn_utils.js — setupTxnFsmCluster (RS branch; kEotMongodParameters flag chain incl. allowEndOfTransaction override; non-vacuous walk regeneration), buildExpectedStreams (per-scope event filter; phantom-block rule: EOT survives only when in-scope statement events remain; structural EOT expectation), verifyTxnContinuous (one reader per eotMode, each with its own fresh matcher and its own expectedTotal; prefixRead; reading-flavor passthrough), txnWatchModeForTestData.
* Extend jstests/libs/util/change_stream/change_stream_reader.js — plumb showEndOfTransaction into the $changeStream spec; open with batchSize: 1 (the 0-or-1-batch matcher contract).
* Create jstests/change_stream_fsm/test_change_stream_txn_fsm_eot.js — C1 prediction matrix (off/required x watch mode), C1 equivalence (whenAvailable = required via the shared builder oracle), C1 gate off (allowEndOfTransaction: false; off = whenAvailable, both EOT-free), C2 multi-writer (2 session-holding writers, arm-per-writer matcher routes by content).
* Create jstests/change_stream_fsm/test_change_stream_txn_fsm_eot_resume.js — C3: prefix reads (resume at every oplog cluster time) and the FOAR flavor (per-event token resumes; mid-txn suppression).
* Create jstests/change_stream_fsm/test_change_stream_txn_fsm_eot_sharded.js — sharded coverage with showEndOfTransaction off (EOT-on sharded rows are gated, see the follow-up ticket).
* Add C5 (filtered equality): three readers, excludeOperationTypes: ["endOfTransaction"] on the whenAvailable/required pair, three-way equality against the off prediction.
* Suite wiring — nodb base suite change_streams_txn_fsm_eot (glob over the e2e files), matrix overrides + mappings + generated suites for watch_collection/watch_db/watch_cluster, resmoke_suite_test BUILD targets, Evergreen *_gen tasks in the query server-divisions tasks file (requires_all_feature_flags tag covers feature-flag exclusion).
* Cleanups: consistent fixture collection naming (RS vs sharded), drop the redundant top-level builder call in verifyTxnContinuous.
Acceptance Criteria
* All three matrix variants pass locally.
* change_streams_sharding_fsm, change_streams_sharding_command_generator, change_streams_txn_command_generator pass (shared files changed).
Notes
* Spike: eot-fsm-spike branch (commits 6f530d2, b9bbeda, 68038ab, f6a07c3, 6e94b2f, e4fb48d, 4eb4bcb, 2a22501, 15e2ba7, 9319007).
* Plan: docs/superpowers/plans/2026-11-05-eot-fsm-test-model.md Tasks 8A, 9, 10, 11A, 12A.
- blocks
-
SERVER-139143 Add sharded-cluster EOT txn FSM coverage (gated on router-side synthesis)
-
- Needs Scheduling
-
- is blocked by
-
SERVER-139141 Add CommittedTxnMatcher pool matching and stream-level txn deduplication to the change stream matchers
-
- Closed
-