Skip to content

Commit 627a449

Browse files
author
Sam Kleinman
committed
updates to tag aware sharding documents
1 parent 945c946 commit 627a449

File tree

3 files changed

+48
-35
lines changed

3 files changed

+48
-35
lines changed

source/administration/tag-aware-sharding.txt

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sharding in MongoDB deployments.
2424

2525
.. note::
2626

27-
Shard key tags are entirely distinct from :ref:`replica set member
27+
Shard key rage tags are entirely distinct from :ref:`replica set member
2828
tags <replica-set-read-preference-tag-sets>`.
2929

3030
Behavior and Operations
@@ -33,20 +33,19 @@ Behavior and Operations
3333
Tags in a sharded cluster are pieces of metadata that dictate the
3434
policy and behavior of the cluster balancer :term:`balancer`. Using
3535
tags, you may associate individual shards in a cluster with one or
36-
more strings, or tags. Then, you can assign this tag string to a range
36+
more tags. Then, you can assign this tag string to a range
3737
of :term:`shard key` values for a sharded collection. When migrating a
3838
chunk, the balancer will select a destination shard based on the
3939
configured tag ranges.
4040

41-
To migrate chunks in a tagged environment, the balancer selects a
42-
target shard with a tag range that has an *upper* bound that *greater
43-
than* the migrating chunk's *lower* bound. If a shard with a matching
44-
tagged range exists, the balancer will migrate the chunk to that
45-
shard.
41+
The balancer migrates chunks in tagged ranges to shards with those
42+
tags, if tagged shards are not balanced. [#specific-tagged-migrations]_
4643

47-
.. note:: The balancer may migrate chunks to tagged shards that
48-
contain values that exceed the upper bound of the selected tag
49-
range.
44+
.. note::
45+
46+
Because a single chunk may span different tagged shard key ranges,
47+
the balancer may migrate chunks to tagged shards that contain
48+
values that exceed the upper bound of the selected tag range.
5049

5150
.. example::
5251

@@ -63,11 +62,20 @@ shard.
6362
values ranging between ``150`` and ``220`` to a shard tagged
6463
``NYC``, since ``150`` is closer to ``200`` than ``300``.
6564

66-
After configuring shard tags, the cluster may take some time to
67-
reach the proper distribution of data, depending on the division of
68-
chunks (i.e. splits) and the current distribution of data in the
69-
cluster. Once configured, the balancer will respect tag ranges during
70-
future :ref:`balancing rounds <sharding-internals-balancing>`.
65+
After configuring tags on shards and ranges of the shard key, the
66+
cluster may take some time to reach the proper distribution of data,
67+
depending on the division of chunks (i.e. splits) and the current
68+
distribution of data in the cluster. Once configured, the balancer
69+
will respect tag ranges during future :ref:`balancing rounds
70+
<sharding-internals-balancing>`.
71+
72+
.. [#specific-tagged-migrations] To migrate chunks in a tagged
73+
environment, the balancer selects a target shard with a tag range
74+
that has an *upper* bound that is *greater than* the migrating
75+
chunk's *lower* bound. If a shard with a matching tagged range
76+
exists, the balancer will migrate the chunk to that shard.
77+
78+
7179

7280
Administer Shard Tags
7381
---------------------
@@ -101,11 +109,11 @@ the ``NRT`` tag from a shard:
101109
Tag a Shard Key Range
102110
~~~~~~~~~~~~~~~~~~~~~
103111

104-
To assign a range of shard key values to a tag, use the
112+
To assign a tag to a range of shard keys use the
105113
:method:`sh.addTagRange()` method when connected to a
106114
:program:`mongos` instance. Any given shard key range may only have
107-
*one* assigned tag. However, you may assign the same tag to multiple
108-
shard key rage.
115+
*one* assigned tag. You cannot overlap defined ranges, or tag the same
116+
range more than once.
109117

110118
.. example::
111119

@@ -122,6 +130,11 @@ shard key rage.
122130
sh.addTagRange("records.users", { zipcode: "11201" }, { zipcode: "11240" }, "NYC")
123131
sh.addTagRange("records.users", { zipcode: "94102" }, { zipcode: "94135" }, "SFO")
124132

133+
.. note::
134+
135+
Shard rages are always inclusive of the lower value and exclusive
136+
of the upper boundary.
137+
125138
Remove a Tag From a Shard Key Range
126139
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127140

source/applications/replication.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ After the :doc:`driver write concern change
2929
</release-notes/drivers-write-concern>` all officially supported
3030
MongoDB drivers enable write concern by default.
3131

32-
Write Propagation
33-
~~~~~~~~~~~~~~~~~
32+
Verify Write Operations
33+
~~~~~~~~~~~~~~~~~~~~~~~
3434

3535
The default write concern confirms write operations only on the
3636
primary. You can configure write concern to confirm write operations
@@ -67,8 +67,8 @@ use the ``wtimeout`` argument. The following example sets the timeout to
6767

6868
db.runCommand( { getLastError: 1, w: 2, wtimeout:5000 } )
6969

70-
Modify Default Write Propagation Operation
71-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
Modify Default Write Concern
71+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7272

7373
You can configure your own "default" :dbcommand:`getLastError`
7474
behavior for a replica set. Use the
@@ -99,8 +99,8 @@ have *no* other arguments.
9999
.. seealso:: :ref:`write-operations-write-concern` and
100100
:ref:`connections-write-concern`
101101

102-
Custom Write Propagation Modes
103-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102+
Custom Write Concerns
103+
~~~~~~~~~~~~~~~~~~~~~
104104

105105
You can use replica set tags to create custom write concerns using the
106106
:data:`~local.system.replset.settings.getLastErrorDefaults` and
@@ -141,7 +141,7 @@ in the :program:`mongo` shell:
141141
.. code-block:: javascript
142142

143143
cfg = rs.conf()
144-
cfg.settings = { getLastErrorModes: { multiUse: { "use": 2 } } }
144+
cfg.settings = { getLastErrorModes: { use2: { "use": 2 } } }
145145
rs.reconfig(cfg)
146146

147147
.. these examples need to be better so that they avoid overwriting
@@ -153,7 +153,7 @@ To use this mode pass the string ``multiUse`` to the ``w`` option of
153153

154154
.. code-block:: javascript
155155

156-
db.runCommand( { getLastError: 1, w: multiUse } )
156+
db.runCommand( { getLastError: 1, w: use2 } )
157157

158158
Specific Custom Write Concerns
159159
``````````````````````````````

source/data-center-awareness.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
:orphan:
2-
2+
33
=====================
44
Data Center Awareness
55
=====================
66

77
.. default-domain:: mongodb
88

9-
MongoDB provides a number of features that allow application developers
10-
and database administrators to customize the behavior of a
9+
MongoDB provides a number of features that allow application
10+
developers and database administrators to customize the behavior of a
1111
:term:`sharded cluster` or :term:`replica set` deployment so that
12-
MongoDB may be "data center aware," or allow operational separation and
13-
segregation based on location.
12+
MongoDB may be *more* "data center aware," or allow operational
13+
separation and segregation based on location.
1414

1515
MongoDB also supports segregation based
1616
on functional parameters, to ensure that certain :program:`mongod`
1717
instances are only used for reporting workloads or that certain
1818
high-frequency portions of a sharded collection only exist on specific
19-
shards.
19+
shards.
2020

21-
Consider the following documents:
21+
Consider the following documents:
2222

23-
.. toctree::
23+
.. toctree::
2424
:maxdepth: 1
25-
25+
2626
/administration/operational-segregation
2727
/administration/tag-aware-sharding
2828
/tutorial/deploy-geographically-distributed-replica-set

0 commit comments

Comments
 (0)