Shard Drain/ Removal issue
If we have more shards, and if want to remove few shards (more than 1), we use below command.
db.adminCommand( { removeShard : "Shardname" } )
Ex, if I have Shard 1, 2, 3, 4, 5. want to remove Shard 2 & 5.
I want to remove one shard at a time to minimize impact to users , then want to remove, say Shard 2, then want to remove Shard 5.
If we do this, some chunks from Shard#2 also get moved to "Shard#5", which is suppose to removed later. This causes Shard#5 chunk size increase. Then takes more time.
Offcourse we can remove more than 1 shard in parellel (from version 4.4 onwards), but it may cause performance issue since balancer will be busy migrating chunks.
So, it will be good, mongo an add new command, "mark the shards to be removed". No new chunks should move to these shards. Then we can remove 1 shard at time, to reduce performance impact.
Thanks
Rama