Skip to content

Commit b643abf

Browse files
authored
DRIVERS-3007: Rename WriteConcernFailed to WriteConcernTimeout (#1761)
1 parent a31e69a commit b643abf

File tree

7 files changed

+18
-24
lines changed

7 files changed

+18
-24
lines changed

source/read-write-concern/read-write-concern.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ writeConcernError but may not be exhaustive. Note that some errors have been abb
427427
- `{ok:1, writeConcernError: {code: 11600, codeName: "InterruptedAtShutdown"}}`
428428
- `{ok:1, writeConcernError: {code: 11601, codeName: "Interrupted"}}`
429429
- `{ok:1, writeConcernError: {code: 11602, codeName: "InterruptedDueToReplStateChange"}}`
430-
- `{ok:1, writeConcernError: {code: 64, codeName: "WriteConcernFailed", errmsg: "waiting for replication timed out", errInfo: {wtimeout: True}}}`
431-
- `{ok:1, writeConcernError: {code: 64, codeName: "WriteConcernFailed", errmsg: "multiple errors reported : {...} at shardName1 :: and :: {...} at shardName2"}}`[^1]
430+
- `{ok:1, writeConcernError: {code: 64, codeName: "WriteConcernTimeout", errmsg: "waiting for replication timed out", errInfo: {wtimeout: True}}}`
431+
- `{ok:1, writeConcernError: {code: 64, codeName: "WriteConcernTimeout", errmsg: "multiple errors reported : {...} at shardName1 :: and :: {...} at shardName2"}}`[^1]
432432
- `{ok:1, writeConcernError: {code: 50, codeName: "MaxTimeMSExpired"}}`
433433
- `{ok:1, writeConcernError: {code: 100, codeName: "UnsatisfiableWriteConcern", errmsg: "Not enough data-bearing nodes"}}`
434434
- `{ok:1, writeConcernError: {code: 79, codeName: "UnknownReplWriteConcern"}}`
@@ -533,6 +533,8 @@ instance, we send it.
533533

534534
## Changelog
535535

536+
- 2025-02-25: Rename WriteConcernFailed to WriteConcernTimeout
537+
536538
- 2015-10-16: ReadConcern of local is no longer allowed to be used when talking with MaxWireVersion \< 4.
537539

538540
- 2016-05-20: Added note about helpers for commands that write accepting a writeConcern parameter.
@@ -579,7 +581,7 @@ instance, we send it.
579581
- 2024-10-30: Remove reference to getLastError
580582

581583
[^1]: This is only possible in a sharded cluster. When a write is routed to multiple shards and more than one shard
582-
returns a writeConcernError, then mongos will construct a new writeConcernError with the "WriteConcernFailed" error
584+
returns a writeConcernError, then mongos will construct a new writeConcernError with the "WriteConcernTimeout" error
583585
code and an errmsg field contains the stringified writeConcernError from each shard. Note that each shard may return
584586
a different writeConcernError.
585587

source/retryable-writes/tests/unified/insertOne-serverErrors.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/retryable-writes/tests/unified/insertOne-serverErrors.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ tests:
339339
- { _id: 2, x: 22 }
340340
- { _id: 3, x: 33 } # The write was still applied.
341341
-
342-
description: 'InsertOne fails after WriteConcernError WriteConcernFailed'
342+
description: 'InsertOne fails after WriteConcernError WriteConcernTimeout'
343343
operations:
344344
-
345345
name: failPoint
@@ -353,7 +353,6 @@ tests:
353353
failCommands: [ insert ]
354354
writeConcernError:
355355
code: 64
356-
codeName: WriteConcernFailed
357356
errmsg: 'waiting for replication timed out'
358357
errInfo:
359358
wtimeout: true

source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
],
5757
"tests": [
5858
{
59-
"description": "commitTransaction is retried after WriteConcernFailed timeout error",
59+
"description": "commitTransaction is retried after WriteConcernTimeout timeout error",
6060
"operations": [
6161
{
6262
"name": "failPoint",
@@ -74,7 +74,6 @@
7474
],
7575
"writeConcernError": {
7676
"code": 64,
77-
"codeName": "WriteConcernFailed",
7877
"errmsg": "waiting for replication timed out",
7978
"errInfo": {
8079
"wtimeout": true
@@ -236,7 +235,7 @@
236235
]
237236
},
238237
{
239-
"description": "commitTransaction is retried after WriteConcernFailed non-timeout error",
238+
"description": "commitTransaction is retried after WriteConcernTimeout non-timeout error",
240239
"operations": [
241240
{
242241
"name": "failPoint",
@@ -254,7 +253,6 @@
254253
],
255254
"writeConcernError": {
256255
"code": 64,
257-
"codeName": "WriteConcernFailed",
258256
"errmsg": "multiple errors reported"
259257
}
260258
}

source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ initialData:
3232

3333
tests:
3434
-
35-
description: commitTransaction is retried after WriteConcernFailed timeout error
35+
description: commitTransaction is retried after WriteConcernTimeout timeout error
3636
operations:
3737
- name: failPoint
3838
object: testRunner
@@ -47,7 +47,6 @@ tests:
4747
# with writeConcernError (see: SERVER-39292)
4848
writeConcernError:
4949
code: 64
50-
codeName: WriteConcernFailed
5150
errmsg: "waiting for replication timed out"
5251
errInfo: { wtimeout: true }
5352
- &operation
@@ -126,10 +125,10 @@ tests:
126125
- { _id: 1 }
127126
-
128127
# This test configures the fail point to return an error with the
129-
# WriteConcernFailed code but without errInfo that would identify it as a
128+
# WriteConcernTimeout code but without errInfo that would identify it as a
130129
# wtimeout error. This tests that drivers do not assume that all
131-
# WriteConcernFailed errors are due to a replication timeout.
132-
description: commitTransaction is retried after WriteConcernFailed non-timeout error
130+
# WriteConcernTimeout errors are due to a replication timeout.
131+
description: commitTransaction is retried after WriteConcernTimeout non-timeout error
133132
operations:
134133
- name: failPoint
135134
object: testRunner
@@ -144,7 +143,6 @@ tests:
144143
# with writeConcernError (see: SERVER-39292)
145144
writeConcernError:
146145
code: 64
147-
codeName: WriteConcernFailed
148146
errmsg: "multiple errors reported"
149147
- *operation
150148
expectEvents: *expectEvents_with_retries

source/transactions/tests/unified/error-labels.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/error-labels.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ tests:
688688
databaseName: *database_name
689689
documents: []
690690
-
691-
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed'
691+
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout'
692692
operations:
693693
-
694694
object: testRunner
@@ -702,7 +702,7 @@ tests:
702702
failCommands:
703703
- commitTransaction
704704
writeConcernError:
705-
code: 64 # WriteConcernFailed without wtimeout
705+
code: 64 # WriteConcernTimeout without wtimeout
706706
errmsg: 'multiple errors reported'
707707
-
708708
object: *session0
@@ -782,7 +782,7 @@ tests:
782782
documents:
783783
- { _id: 1 }
784784
-
785-
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout'
785+
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout'
786786
operations:
787787
-
788788
object: testRunner
@@ -797,7 +797,6 @@ tests:
797797
- commitTransaction
798798
writeConcernError:
799799
code: 64
800-
codeName: WriteConcernFailed
801800
errmsg: 'waiting for replication timed out'
802801
errInfo:
803802
wtimeout: true

0 commit comments

Comments
 (0)