-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Execution
-
Query 2020-03-23, Query 2020-04-06, Query 2020-04-20
In SERVER-42723, we introduced an improved mechanism for change streams to detect the addition of a new shard to the cluster. This was motivated by the fact that the existing migrateChunkToNewShard mechanism was not sufficient to account for all potential cases. At present, the migrateChunkToNewShard oplog notification still exists in master for backward-compatibility and upgrade purposes, but we may wish to remove this during the 4.5 development cycle.
Alternatively, the two approaches could become complementary. At present, we must always open change stream cursors on all shards, and so the approach implemented by SERVER-42723 is always appropriate. However, in the future we may be able to target single-collection or single-DB streams to a subset of shards based on the historical state of the routing table at the moment from which the stream is resuming. In this scenario, the migrateChunkToNewShard approach is appropriate and the new SERVER-42723 mechanism would only be needed in the case of whole-cluster streams, or when a stream is opened on a database which does not yet exist.
- is related to
-
SERVER-42723 New shard with new database can be ignored by change streams
- Closed
- related to
-
SERVER-33090 $changeStream can fail if a shard was removed
- Backlog
-
SERVER-48386 Adding a new shard while awaiting a future startAtOperationTime can result in unexpected $changeStream events
- Backlog