Fix change stream restart with conflicting resume options and centralize V2TargeterLogCodes

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-04-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

        1. Fix change stream cursor handling and consolidate log codes

      This change improves the robustness of change stream operations by addressing several cursor management issues:

      • Clear conflicting resume options (`startAtOperationTime`, `startAfter`) before setting `resumeAfter` to match server-side behavior
      • Preserve `aggregateOptions` when storing cursor information and merge them properly during cursor recreation
      • Update cursor objects in-place to maintain reference chains, ensuring callers always have the latest cursor ID
      • Add debug logging for open cursor tracking to improve observability
      • Consolidate V2 targeter log codes into a centralized `V2TargeterLogCodes` object and update all test files to use the shared constants

      These fixes ensure change streams handle resume tokens correctly and maintain proper cursor state throughout their lifecycle.

            Assignee:
            Denis Grebennicov
            Reporter:
            Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: