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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • ALL
    • Query 2018-04-23

      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.

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

              Created:
              Updated:
              Resolved: