-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
DB Integration & Observability
-
Fully Compatible
-
QE 2026-10-26
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Make the change stream txn unwind stage generate all endOfTransaction events.
For prepared coordinated transactions, the stage creates endOfTransaction accounting control events, and makes these control events trickle down to the already-existing ChangeStreamEndOfTransaction stage, which will ultimately handle them.
This also requires a bypass of accounting control events in the ChangeStreamHandleTopologyChangeV2 stage, because that stage will otherwise read such events and tries to interpret them as topology control events.
For single-shard and replica set transactions, the stage creates a synthetic endOfTransaction oplog entry, which will be picked up by the transform stage and turned into a regular endOfTransaction change event.
If the change stream is opened with showEndOfTransaction: "required" and no endOfTransaction event generation is possible, the unwind txn stage will fail the stream with ChangeStreamFatalError.
For $_passthroughToShard and direct-to-shard change streams, showEndOfTransaction: "required" is implicitly downgraded to the behavior of showEndOfTransaction: "whenavailable", i.e. missing endOfTransaction metadata will not make the stream fail.