You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/change-streams/README.rst
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The definition of MATCH or MATCHES in the Spec Test Runner is as follows:
63
63
64
64
- MATCH takes two values, ``expected`` and ``actual``
65
65
- Notation is "Assert [actual] MATCHES [expected]
66
-
- Assertion passes if ``expected`` is a subset of ``actual``, with the values ``42`` and ``"42"`` acting as placeholders for "any value"
66
+
- Assertion passes if ``expected`` is a subset of ``actual``, with the value ``42`` acting as placeholders for "any value"
67
67
68
68
Pseudocode implementation of ``actual`` MATCHES ``expected``:
69
69
@@ -149,6 +149,20 @@ Although synchronous drivers must provide a `non-blocking mode of iteration <../
149
149
150
150
If the test expects an error and one was not thrown by either creating the change stream or executing the test's operations, iterating the change stream once allows for an error to be thrown by a ``getMore`` command. If the test does not expect any error, the change stream should be iterated only until it returns as many result documents as are expected by the test.
151
151
152
+
Testing on Sharded Clusters
153
+
---------------------------
154
+
155
+
When writing data on sharded clusters, majority-committed data does not always show up in the response of the first
156
+
``getMore`` command after the data is written. This is because in sharded clusters, no data from shard A may be returned
157
+
until all other shard reports an entry that sorts after the change in shard A.
158
+
159
+
To account for this, drivers MUST NOT rely on change stream documents in certain batches. For example, if expecting two
160
+
documents in a change stream, these may not be part of the same ``getMore`` response, or even be produced in two
161
+
subsequent ``getMore`` responses. Drivers MUST allow for a ``getMore`` to produce empty batches when testing on a
162
+
sharded cluster. By default, this can take up to 10 seconds, but can be controlled by enabling the ``writePeriodicNoops``
163
+
server parameter and configuring the ``periodNoopIntervalSecs`` parameter. Choosing lower values allows for running
0 commit comments