-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.3.3
-
Component/s: Aggregation Framework, Sharding
-
Labels:
-
Query Optimization
-
ALL
The checks that we do to enforce certain collections are not sharded on mongos rely on consulting the catalog cache. This is not guaranteed to be up to date and we also don't want to pay for a hard refresh on each query.
The observable effects of this are that you can drop a sharded collection transitioning from sharded -> unsharded without every mongos knowing this happened. This means that mongos processes which have not observed this drop will incorrectly reject requests to use it in stages which can't use sharded collections like $lookup and $out.
If you instead shard ac collection and transition from unshared -> sharded then everything will work fine since the shard versioning protocol will retry the entire command and the second time the mongos will know that the namespace is sharded.