Skip to content

Commit 141bc98

Browse files
(DOCS-15399): 6.1 retryable writes errors (#2066)
* (DOCS-15399): 6.1 retryable writes errors * wording * wording and minimalism * fix include name * edits * add clarity * reorder phrases * minimalism * minimalism, formatting * review edits * updates per review * wording * final review edits * minimalism
1 parent cac12c2 commit 141bc98

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

source/core/retryable-writes.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,8 @@ disabled.
366366
To disable retryable writes, specify
367367
:urioption:`retryWrites=false <retryWrites>` in the
368368
:ref:`connection string <mongodb-uri>` for the MongoDB cluster.
369+
370+
Error Handling
371+
~~~~~~~~~~~~~~
372+
373+
.. include:: /includes/6.1-retry-writes-error-handling.rst
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Starting in MongoDB 6.1, if both the first and second attempt of a
2+
retryable write fail without a single write being performed, MongoDB
3+
returns an error with the ``NoWritesPerformed`` label.
4+
5+
The ``NoWritesPerformed`` label differentiates the results of batch
6+
operations like :method:`~db.collection.insertMany()`. In an
7+
``insertMany`` operation, one of the following outcomes can occur:
8+
9+
.. list-table::
10+
:header-rows: 1
11+
12+
* - Outcome
13+
- MongoDB Output
14+
15+
* - No documents are inserted.
16+
- Error returned with ``NoWritesPerformed`` label.
17+
18+
* - Partial work done. (At least one document is inserted, but not
19+
all.)
20+
- Error returned without ``NoWritesPerformed`` label.
21+
22+
* - All documents are inserted.
23+
- Success returned.
24+
25+
Applications can use the ``NoWritesPerformed`` label to definitively
26+
determine that no documents were inserted. This error reporting lets the
27+
application maintain an accurate state of the database when handling
28+
retryable writes.
29+
30+
In previous versions of MongoDB, an error is returned when both the
31+
first and second attempts of a retryable write fail. However, there is
32+
no distinction made to indicate that no writes were performed.

source/release-notes/6.1.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ results in a slower query than one without the option specified.
5151
For an example that uses the ``*UCP`` option, see
5252
:ref:`regex-example-pcre2-ucp`.
5353

54+
.. _release-notes-6.1-replication:
55+
56+
Replication
57+
-----------
58+
59+
.. _release-notes-6.1-retry-writes-errors:
60+
61+
Retryable Writes Error Handling
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63+
64+
.. include:: /includes/6.1-retry-writes-error-handling.rst
5465

5566
General Changes
5667
---------------
@@ -404,4 +415,3 @@ of the related projects.
404415
:hidden:
405416

406417
/release-notes/6.1-compatibility
407-

0 commit comments

Comments
 (0)