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

Allow $changeStream resume attempts to proceed if the initial stream documents have the same clusterTime as the resume token but lower-sorting UUIDs

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.7.4
    • None
    • Aggregation Framework
    • None
    • Fully Compatible
    • ALL
    • Query 2018-04-23

    Description

      When determining whether it is possible to resume a change stream, we currently reject the resume attempt and uassert if a document observed in the stream has the same clusterTime but a different UUID than the resume token. However, in the case of the new whole-database and cluster-wide change streams running on a sharded cluster, this is a legitimate scenario; we may observe operations from multiple shards that occurred at the same time on different namespaces.

      To ensure correct resume semantics, we should continue to examine subsequent documents in the stream if the current document's UUID sorts before the resume token's, implying that we should expect to see the resume token later. However, if the document's UUID sorts after the resume token's UUID, then we will never see the token and can safely reject the resume attempt.

      Attachments

        Activity

          People

            bernard.gorman@mongodb.com Bernard Gorman
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: