-
Type:
Investigation
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Developer Tools
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 consistently - both in replica sets and sharded clusters.
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.
Description of Linked Ticket
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.
- depends on
-
SERVER-137116 Set cursor.invalidated on sharded change stream getMore response
-
- Closed
-