-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
DB Integration & Observability
-
Minor Change
-
QI 2025-02-17
-
None
-
None
-
None
-
None
-
None
-
None
-
None
This change fixes an inconsistency where the mongos getMore reply for an invalidated change stream omitted cursor.invalidated: true, while the equivalent reply from mongod (first batch and getMore) and the mongos aggregate first-batch reply already set it.
A change stream cursor on a sharded cluster is invalidated by a collection drop/rename or database drop, and the router cursor throws ChangeStreamInvalidated during getMore. The closing reply (already id: 0 with the PBRT set to the invalidate token) now also reports cursor.invalidated: true.
Before: cursor: { id: 0, ns, nextBatch, postBatchResumeToken }
After: cursor: { id: 0, ns, nextBatch, postBatchResumeToken, invalidated: true }
CursorResponse only serializes the field when true, so every other reply (e.g. normal batches, ordinary exhaustion, non-change-stream cursors) remains unchanged.
- is depended on by
-
COMPASS-11286 Investigate changes in SERVER-137116: Set cursor.invalidated on sharded change stream getMore response
-
- Needs Triage
-
-
TOOLS-4420 Investigate changes in SERVER-137116: Set cursor.invalidated on sharded change stream getMore response
-
- Needs Discussion
-