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

Get shard key into documentKey and resumeToken in changeStream 'insert' notification entries

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.6.0-rc1
    • Aggregation Framework
    • None
    • Fully Compatible
    • Repl 2017-10-02, Repl 2017-10-23

    Description

      For a sharded collection, DocumentSourceChangeStream requires the shard key in order to extract the shard key from insert entries. When a DocumentSourceChangeStream is constructed, it should store the shard key for the collection. It can get the shard key by calling CatalogCache::getCollectionRoutingInfo(), which will be modified to include the UUID for the collection, to protect against renames. It is important to store the shard key inside DocumentSourceChangeStream, so that it can continue to extract the shard key from insert entries even after the collection has been dropped and the shard key is no longer available in the CatalogCache.

      Note that if CatalogCache::getCollectionRoutingInfo() returns a mismatched UUID for the namespace, the aggregation should fail.

      Attachments

        Issue Links

          Activity

            People

              nathan.myers Nathan Myers
              tess.avitabile@mongodb.com Tess Avitabile (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: