• Type: Investigation
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 7

      Original Downstream Change Summary

      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.

            Assignee:
            Unassigned
            Reporter:
            Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: