The test removes a shard and tries to put it back again. However, it is possible that the migration cleanup task has not yet completed so attempting to re-add the shard will result to "local database exist in another shard" error.
The test attempts to prevent this by checking the currOp for the cleanup task:
https://github.com/mongodb/mongo/blob/r3.3.14/jstests/sharding/remove2.js#L26-L30
But the issue here is that the balancer can run with
{ _waitForDelete: true }and this will mean that the cleanup will happen inline with moveChunk and the check above will not catch this.
- is related to
-
SERVER-8836 sharding/remove2.js failing on Windows with "local database 'test' exists"
- Closed