ExportXMLWordPrintableJSON

    • 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.

            Assignee:
            Jan Steemann
            Reporter:
            Jan Steemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: