-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
v5.0
-
Query Execution 2021-05-17, Query Execution 2021-05-31
Currently, when a collection migrates to a new shard, an event is generated that passes through the pipeline to the mongoS, where it is consumed by the DocumentSourceUpdateOnAddShard stage. But when we start pushing down user-defined $match filters to the shard, we can no longer guarantee that the event will make it as far as DSUOAS, and migration events may therefore be missed.
We should move our handling of the kNewShardDetected event out of the change stream pipeline.