Originally, I was thinking _configsvrCreateCommand, _configsvrDropCollection, and _configsvrDropDatabase should send the dbVersion when targeting the primary shard, since a concurrent movePrimary could happen.
Then I realized _configsvrDropCollection and _configsvrDropDatabase already take a database distlock, which movePrimary also takes, and therefore it's not possible for a movePrimary to happen concurrently with these.
So, the easiest thing is to make _configsvrCreateCommand, which targets the primary shard to place the new collection on, also take the database distlock, probably around here.
- is duplicated by
-
SERVER-30402 createCollection on mongos can create an unreachable collection if movePrimary has been called
- Closed
- is related to
-
SERVER-35226 now that createCollection and createDatabase in sharding take an in-memory lock, increase threadCount and iterations in fsm workloads
- Closed