-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Fully Compatible
-
Repl 2017-10-02, Repl 2017-10-23
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.
- depends on
-
SERVER-31191 Store the collection UUIDs in the CatalogCache
- Closed
- is depended on by
-
SERVER-30599 Get shard key into documentKey and resumeToken in changeStream update, replace, and delete notification entries
- Closed