Skip to content

Commit 012dcf5

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-19212 change stream events and orphans (#740)
* DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans * DOCSP-19212-change-stream-events-and-orphans Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 1ced371 commit 012dcf5

8 files changed

+56
-25
lines changed

source/administration/change-streams-production-recommendations.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ Change Stream Optimization
9999

100100
.. include:: /includes/change-streams-optimization.rst
101101

102+
Change Streams and Orphan Documents
103+
-----------------------------------
104+
105+
.. include:: /includes/change-streams-and-orphans.rst

source/changeStreams.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,11 @@ versions, change streams opened on a single collection
10451045
(:method:`db.collection.watch()`) would inherit that collection's
10461046
default collation.
10471047

1048+
Change Streams and Orphan Documents
1049+
-----------------------------------
1050+
1051+
.. include:: /includes/change-streams-and-orphans.rst
1052+
10481053
.. toctree::
10491054
:titlesonly:
10501055
:hidden:

source/core/distributed-queries.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ Read operations from secondary members of replica sets may not reflect
3838
the current state of the primary. Read preferences that direct read
3939
operations to different servers may result in non-monotonic reads.
4040

41-
.. versionchanged:: 3.6
42-
43-
Starting in MongoDB 3.6, clients can use :ref:`causally consistent
44-
<causal-consistency>` sessions, which provides various guarantees,
45-
including monotonic reads.
41+
Clients can use :ref:`causally consistent <causal-consistency>`
42+
sessions, which provides various guarantees including monotonic reads.
4643

4744
You can configure the read preference on a per-connection or
4845
per-operation basis. For more information on read preference or on the
@@ -67,7 +64,6 @@ For more information on replica sets and write operations, see
6764
:doc:`/replication` and
6865
:doc:`/reference/write-concern`.
6966

70-
7167
.. _read-operations-sharded-clusters:
7268

7369
Read Operations to Sharded Clusters
@@ -104,10 +100,7 @@ replica sets may not reflect the current state of the primary. Read
104100
preferences that direct read operations to different servers may result
105101
in non-monotonic reads.
106102

107-
108103
.. note::
109-
110-
Starting in MongoDB 3.6,
111104

112105
- Clients can use :ref:`causally consistent <causal-consistency>`
113106
sessions, which provides various guarantees, including monotonic
@@ -164,6 +157,9 @@ For more information, see :doc:`/sharding` and
164157

165158
:ref:`retryable-writes`
166159

160+
Change Streams and Orphan Documents
161+
-----------------------------------
167162

163+
.. include:: /includes/change-streams-and-orphans.rst
168164

169165
.. _read-operations-connection-pooling:

source/core/sharding-balancer-administration.txt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Sharded Cluster Balancer
1313
:depth: 1
1414
:class: singlecol
1515

16-
1716
The MongoDB balancer is a background process that monitors the number of
1817
:term:`chunks <chunk>` on each :term:`shard`. When the number of chunks on a
1918
given shard reaches specific :ref:`migration thresholds
@@ -60,18 +59,15 @@ Chunk migrations carry some overhead in terms of bandwidth and
6059
workload, both of which can impact database performance. [#auto-distribute]_ The
6160
:term:`balancer` attempts to minimize the impact by:
6261

63-
- Restricting a shard to at most one migration at any given time; i.e.
64-
a shard cannot participate in multiple chunk migrations at the same
65-
time. To migrate multiple chunks from a shard, the balancer migrates
66-
the chunks one at a time.
67-
68-
.. versionchanged:: 3.4
62+
- Restricting a shard to at most one migration at any given time.
63+
Specifically, a shard cannot participate in multiple chunk migrations
64+
at the same time. To migrate multiple chunks from a shard, the
65+
balancer migrates the chunks one at a time.
6966

70-
Starting in MongoDB 3.4, MongoDB can perform parallel chunk
71-
migrations. Observing the restriction that a shard can participate
72-
in at most one migration at a time, for a sharded cluster with *n*
73-
shards, MongoDB can perform at most *n/2* (rounded down)
74-
simultaneous chunk migrations.
67+
MongoDB can perform parallel chunk migrations, but a shard can
68+
participate in at most one migration at a time. For a sharded cluster
69+
with *n* shards, MongoDB can perform at most *n/2* (rounded down)
70+
simultaneous chunk migrations.
7571

7672
See also :ref:`chunk-migration-queuing`.
7773

@@ -260,8 +256,6 @@ testing purposes. For more information, see
260256
Chunk Migration and Replication
261257
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262258

263-
.. versionchanged:: 3.4
264-
265259
During chunk migration, the ``_secondaryThrottle`` value determines
266260
when the migration proceeds with next document in the chunk.
267261

@@ -282,7 +276,6 @@ In the :data:`config.settings` collection:
282276
does not wait for replication to a secondary and instead continues
283277
with the next document.
284278

285-
286279
To update the ``_secondaryThrottle`` parameter for the balancer, see
287280
:ref:`sharded-cluster-config-secondary-throttle` for an example.
288281

@@ -335,6 +328,11 @@ with :parameter:`rangeDeleterBatchSize` and
335328
collection targeted for deletes, range deletion processes may
336329
not proceed.
337330

331+
Change Streams and Orphan Documents
332+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333+
334+
.. include:: /includes/change-streams-and-orphans.rst
335+
338336
.. _sharding-shard-size:
339337

340338
Shard Size

source/core/transactions.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,21 @@ Storage Engines
819819

820820
.. include:: /includes/extracts/transactions-inmemory-txn-page.rst
821821

822+
Limit Critical Section Wait Time
823+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
824+
825+
Starting in MongoDB 5.2 (and 5.0.4):
826+
827+
- When a query accesses a shard, a :ref:`chunk migration
828+
<migrate-chunks-sharded-cluster>` or :ref:`DDL operation
829+
<transactions-operations-ddl>` may hold the critical section for the
830+
collection.
831+
832+
- To limit the time a shard waits for a critical section within a
833+
transaction, use the
834+
:parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`
835+
parameter.
836+
822837
Additional Transactions Topics
823838
------------------------------
824839

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Starting in MongoDB 5.3, during :ref:`chunk migration
2+
<chunk-migration-procedure>`, :ref:`change stream <changeStreams>`
3+
events are not generated for updates to :term:`orphaned documents
4+
<orphaned document>`.

source/release-notes/5.3-compatibility.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ single document.
3535

3636
See :parameter:`indexMaxNumGeneratedKeysPerDocument`.
3737

38+
Change Streams and Orphan Documents
39+
-----------------------------------
40+
41+
.. include:: /includes/change-streams-and-orphans.rst
42+
3843
Intra-Cluster Authentication
3944
----------------------------
4045

@@ -46,4 +51,3 @@ Starting in MongoDB 5.3.0, 5.2.1, and 5.0.6, the :dbcommand:`dbStats`
4651
command and the :method:`db.stats()` method only report free space
4752
assigned to collections if the :ref:`freeStorage <dbStats-freeStorage>`
4853
parameter is set to 1.
49-

source/tutorial/migrate-chunks-in-sharded-cluster.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,8 @@ balancer proceeds with the next document in the migrating chunk. See
9191
cursors manually.
9292

9393
.. todo:: insert link to killing a cursor.
94+
95+
Change Streams and Orphan Documents
96+
-----------------------------------
97+
98+
.. include:: /includes/change-streams-and-orphans.rst

0 commit comments

Comments
 (0)