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

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc1
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      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

              Assignee:
              nathan.myers Nathan Myers
              Reporter:
              tess.avitabile Tess Avitabile
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: