[SERVER-18352] Prevent shards that are in the process of being removed from accepting new chunks Created: 06/May/15 Updated: 07/Mar/19 Resolved: 07/Mar/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Kaloian Manassiev |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
The balancer already won't choose a shard that is 'draining' as the target of any migrations, but if there was already a migration in flight or if a user manually runs moveChunk, the shard will accept and complete the moveChunk operation even while it is draining. |
| Comments |
| Comment by Kaloian Manassiev [ 07/Mar/19 ] |
|
Starting in version 3.4, where the balancer runs on the config server primary, this is no longer a problem. The manual moveChunk command checks whether the requested destination shard is a suitable receiver and if the shard is draining, the move will fail. |
| Comment by Spencer Brody (Inactive) [ 06/May/15 ] |
|
Relevant "TODO" already in the code: https://github.com/mongodb/mongo/blob/v3.0/src/mongo/s/commands_admin.cpp#L1435-L1437 |