ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1026
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add the matching machinery for transaction event sets: one committed transaction is matched by a pool (order-free inside the txn), with the endOfTransaction event asserted last, and re-emitted txn events are deduplicated at the stream level.

      Scope of Work

      * Extend jstests/libs/util/change_stream/change_stream_event.js — CommittedTxnMatcher: pool of the txn's statement matchers + a gated EOT arm (mandatory/optional/absent, derived from the reader config); position-locked while partially matched; getTotalCount() consumption-independent.
      * Extend jstests/libs/util/change_stream/change_stream_matcher.js — uniform polymorphic matcher interface (matches, isDone, getMatchedCount, getTotalCount, skippable, getTxnId, toString; no type checks); SingleChangeStreamMatcher delegation with eager advancement (index moves inside the successful match, no sweep pass); TxnDeduplicator — stream-level dedup keyed on (lsid, txnNumber) of txn-sourced events only, always on.
      * Extend jstests/libs/util/change_stream/change_stream_verifier.js — the per-stream breakdown reports expected-matched and swallowed-duplicates apart (never "5/3 matched").

      Key Contract

      getMatchedCount() is a CONSUMED count: swallowed duplicates count, because the verifier's completeness check (assertMatcherDone) compares it against the number of events the reader actually read. Unit tests encode this explicitly.

      Acceptance Criteria

      * Pool/dedup unit tests pass in the generator test file.
      * change_streams_sharding_fsm passes — this ticket touches matcher files the sharding FSM uses; that regression run is the proof.

      Notes

      * Spike: eot-fsm-spike branch (commits e1e6d20, 14757b0, matcher halves of fe4b6a1).
      * Plan: docs/superpowers/plans/2026-11-05-eot-fsm-test-model.md Task 7.

            Assignee:
            Denis Grebennicov
            Reporter:
            Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: