Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49349

ChangeStreams cannot resume from CursorNotFound errors in MongoDB 4.4

    • Type: Icon: Question Question
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Query
    • Fully Compatible

      Starting with MongoDB 4.4, drivers use the updated change stream specification (DRIVERS-907) to determine whether an error encountered while iterating a change stream is 'resumable'. Essentially, in MongoDB 4.4 and later, drivers will check command errors returned by the server for the ResumableChangeStreamError error label - if this label is present, then the error shall be considered resumable and the driver will re-create the change stream cursor.
      Pre MongoDB 4.4, drivers used much broader criteria for determining change stream resumability. Specifically, CursorNotFound (thrown if the driver tries to iterate a cursor that has already been killed on the server) errors were resumable but with the use of error labels, and the updated change stream resume process this is no longer the case. Consequently, MongoDB 4.4-era drivers might break existing applications that rely on change stream resumability when encountering CursorNotFound exceptions.
      It is expected that drivers seldom attempt to iterate cursors that have already been killed on the server so this backward breaking behavior change will not result in any application/user-visible errors.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            prashant.mital Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: