@@ -399,3 +399,53 @@ chunk migration failure independently.
399
399
If you encounter this issue, contact the `MongoDB User Group
400
400
<http://groups.google.com/group/mongodb-user>`_ or 10gen support to
401
401
address this issue.
402
+
403
+ How does draining a shard affect the balancing of uneven chunk distribution?
404
+ ----------------------------------------------------------------------------
405
+
406
+ The sharded cluster balancing process controls both migrating chunks
407
+ from decommissioned shards (i.e. draining,) and normal cluster
408
+ balancing activities. Consider the following behaviors for different
409
+ versions of MongoDB in situations where you remove a shard in a
410
+ cluster with an uneven chunk distribution:
411
+
412
+ - After MongoDB 2.2, the balancer first removes the chunks from the
413
+ draining shard and then balances the remaining uneven chunk
414
+ distribution.
415
+
416
+ - Before MongoDB 2.2, the balancer handles the uneven chunk
417
+ distribution and *then* removes the chunks from the draining shard.
418
+
419
+ .. COMMENT: This is probably a knowledge base article, but doesn't belong in
420
+ the documentation here.
421
+
422
+ Although this balancer prioritization is **not** configurable, you can,
423
+ however, achieve the desired behavior with one of the following manual
424
+
425
+ - Option 1
426
+
427
+ #. Stop the balancer.
428
+
429
+ #. Use the :dbcommand:`moveChunk` command to move chunks off of the
430
+ draining shard.
431
+
432
+ #. Restart the balancer.
433
+
434
+ - Option 2
435
+
436
+ #. Set the ``maxSize`` on the new shards to some low value so that
437
+ they cannot accept more chunks. This should stop the balancing
438
+ operation and allow the draining to continue with chunks moved
439
+ to the full shards.
440
+
441
+ #. Restore the original ``maxSize`` on the new shards.
442
+
443
+ .. note::
444
+
445
+ When changing the ``maxSize`` in the :term:`config database`:
446
+
447
+ - in versions 2.0+, run the :dbcommand:`flushRouterConfig` command
448
+ to refresh the :program:`mongos`.
449
+
450
+ - in versions pre-2.0, you need to restart :program:`mongos`.
451
+ solutions:
0 commit comments