The setShardVersion command makes sure that the mongod isn't in the critical section before running. If it is in the critical section, it blocks until the critical section terminates. In 2.2 and prior we go into a loop, releasing and re-acquiring the global write lock until we are no longer in the critical section. Instead, we should block on a condition variable that we notify on when the critical section has terminated.
- related to
-
SERVER-7493 Possible for read starvation to cause migration to get stuck in critical section
- Closed