Skip to content

Commit 26a8afb

Browse files
author
Sam Kleinman
committed
DOCS-93 resolve sharding todo item.
1 parent d1e310b commit 26a8afb

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

draft/administration/sharding.txt

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,38 @@ Still, you may want to split chunks manually if:
418418
Use :func:`sh.status()` to determine the current chunks ranges across
419419
the cluster.
420420

421-
TODO expand this section
422-
423421
To split chunks manually, use either the :func:`sh.splitAt()` or
424422
:func:`sh.splitFind()` helpers in the :program:`mongo` shell.
425423
These helpers wrap the :dbcommand:`split` command.
426424

427-
TODO: examples of using both helpers.
425+
Use the following command to split the chunk that the document that
426+
matches the ``{ "zipcode": 63109 }`` query statement:
427+
428+
.. code-block:: javascript
429+
430+
sh.splitFind( { "zipcode": 63109 } )
431+
432+
This will split the chunk that contains the *first* document returned
433+
that matches this query into two equal components. MongoDB will split
434+
the chunk so that documents that have half of the shard keys in will
435+
be in one chunk and the documents that have other half of the shard
436+
keys will be a second chunk. The query in :func:`sh.splitFind()` need
437+
not contain the shard key, though it almost always makes sense to
438+
query for the shard key in this case, and including the shard key will
439+
expedite the operation.
440+
441+
However, the location of the document that this query finds with
442+
respect to the other documents in the chunk does not affect how the
443+
chunk splits. Use :func:`sh.splitAt()` to split a chunk in two using
444+
the queried document as the partition point:
445+
446+
.. code-block:: javascript
447+
448+
sh.splitAt( { "zipcode": 63109 } )
428449

429450
.. note::
430451

431-
You cannot merge chunks once you've split them.
452+
You cannot merge or combine chunks once you've split them.
432453

433454
.. _sharding-balancing-modify-chunk-size:
434455

@@ -528,8 +549,6 @@ block until the migration is complete.
528549
Balancer Operations
529550
-------------------
530551

531-
TODO modify this section to include the helper functions in the shell.
532-
533552
This section provides an overview of common administrative procedures
534553
related to balancing and the balancing process.
535554

@@ -584,7 +603,9 @@ Here's what this tells you:
584603

585604
.. note::
586605

587-
The following shell helper will quickyl tell you whether the balancer is running:
606+
Use the :func:`sh.isBalancerRunning()` helper in the
607+
:program:`mongo` shell to determine if the balancer is
608+
running, as follows:
588609

589610
.. code-block:: javascript
590611

0 commit comments

Comments
 (0)