The goal of this task is to change how sharded local collections are dropped. We can see this function as a sequence of three operations:
- Clear the in-memory filtering metadata.
- Dropping the local Collection.
- Clearing the routing information (in-memory and persisted (i.e. config.cache.*)).
The idea is to swap 2 and 3, so we clear the routing information first and then we drop the local collection, so if the collection to be dropped doesn't exist on that shard (i.e. in this path we throw an exception that is captured in an upper level) we don't forget to clear the routing information (i.e. we don't leave garbage behind).
Affected versions: all versions since 5.0.