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

Allow sharded $changeStream to continue if collection is dropped and resharded before documentKey is obtained

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: 3.6.0-rc2
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • Query 2018-05-07

      At present, we uassert if the current UUID of the sharded namespace on which the $changeStream is running differs from the UUID found in the oplog entry, implying that the collection was dropped and resharded before we had a chance to obtain the shard key fields for the documentKey. This prevents $changeStream from returning the remaining oplog entries leading up to the original collection's invalidation.

      However, given that:

      ... it should be safe to simply return _id for the documentKey and allow $changeStream to proceed. This would bring sharded $changeStream into alignment with the behaviour on a single replica set, where dropping and recreating a collection in this way does not prevent $changeStream from retrieving the remainder of the old collection's oplog entries.

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: