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

Allow resuming change stream when resume token's document key does not contain the shard key

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

      It's possible for a collection to be sharded for some period of time before the shard knows that the collection is sharded. Because of this, it's possible for insert notifications to be generated without the shard key for a period of time after the collection has been sharded.

      When the change stream is resumed, it might be resuming on one of these changes, at a future point when the shard knows that the collection is sharded. When this happens, the resume token will not include the full shard key in the documentKey, but the new generated change which we compare the resume token to will. We should allow resuming in this case if the _ids match. This is safe because there must not have been any chunk migrations up until this point (or the shard would have known the collection was sharded, generating shard keys in the documentKey), so the _id should still be unique.

            Assignee:
            bernard.gorman@mongodb.com Bernard Gorman
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: