Skip to content

Commit 924ec63

Browse files
authored
CSHARP-5492: Rename WriteConcernFailed to WriteConcernTimeout (#1629)
1 parent 79bef25 commit 924ec63

File tree

8 files changed

+17
-25
lines changed

8 files changed

+17
-25
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@
739739
]
740740
},
741741
{
742-
"description": "InsertOne fails after WriteConcernError WriteConcernFailed",
742+
"description": "InsertOne fails after WriteConcernError WriteConcernTimeout",
743743
"operations": [
744744
{
745745
"name": "failPoint",
@@ -757,7 +757,6 @@
757757
],
758758
"writeConcernError": {
759759
"code": 64,
760-
"codeName": "WriteConcernFailed",
761760
"errmsg": "waiting for replication timed out",
762761
"errInfo": {
763762
"wtimeout": true

specifications/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

specifications/transactions-convenient-api/tests/commit-writeconcernerror.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"data": [],
1919
"tests": [
2020
{
21-
"description": "commitTransaction is retried after WriteConcernFailed timeout error",
21+
"description": "commitTransaction is retried after WriteConcernTimeout timeout error",
2222
"failPoint": {
2323
"configureFailPoint": "failCommand",
2424
"mode": {
@@ -30,7 +30,6 @@
3030
],
3131
"writeConcernError": {
3232
"code": 64,
33-
"codeName": "WriteConcernFailed",
3433
"errmsg": "waiting for replication timed out",
3534
"errInfo": {
3635
"wtimeout": true
@@ -156,7 +155,7 @@
156155
}
157156
},
158157
{
159-
"description": "commitTransaction is retried after WriteConcernFailed non-timeout error",
158+
"description": "commitTransaction is retried after WriteConcernTimeout non-timeout error",
160159
"failPoint": {
161160
"configureFailPoint": "failCommand",
162161
"mode": {
@@ -168,7 +167,6 @@
168167
],
169168
"writeConcernError": {
170169
"code": 64,
171-
"codeName": "WriteConcernFailed",
172170
"errmsg": "multiple errors reported"
173171
}
174172
}

specifications/transactions-convenient-api/tests/commit-writeconcernerror.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ data: []
1313

1414
tests:
1515
-
16-
description: commitTransaction is retried after WriteConcernFailed timeout error
16+
description: commitTransaction is retried after WriteConcernTimeout timeout error
1717
failPoint:
1818
configureFailPoint: failCommand
1919
mode: { times: 2 }
@@ -23,7 +23,6 @@ tests:
2323
# with writeConcernError (see: SERVER-39292)
2424
writeConcernError:
2525
code: 64
26-
codeName: WriteConcernFailed
2726
errmsg: "waiting for replication timed out"
2827
errInfo: { wtimeout: true }
2928
operations:
@@ -106,10 +105,10 @@ tests:
106105
- { _id: 1 }
107106
-
108107
# This test configures the fail point to return an error with the
109-
# WriteConcernFailed code but without errInfo that would identify it as a
108+
# WriteConcernTimeout code but without errInfo that would identify it as a
110109
# wtimeout error. This tests that drivers do not assume that all
111-
# WriteConcernFailed errors are due to a replication timeout.
112-
description: commitTransaction is retried after WriteConcernFailed non-timeout error
110+
# WriteConcernTimeout errors are due to a replication timeout.
111+
description: commitTransaction is retried after WriteConcernTimeout non-timeout error
113112
failPoint:
114113
configureFailPoint: failCommand
115114
mode: { times: 2 }
@@ -119,7 +118,6 @@ tests:
119118
# with writeConcernError (see: SERVER-39292)
120119
writeConcernError:
121120
code: 64
122-
codeName: WriteConcernFailed
123121
errmsg: "multiple errors reported"
124122
operations:
125123
- *operation

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@
11761176
]
11771177
},
11781178
{
1179-
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
1179+
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout",
11801180
"operations": [
11811181
{
11821182
"object": "testRunner",
@@ -1338,7 +1338,7 @@
13381338
]
13391339
},
13401340
{
1341-
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout",
1341+
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout",
13421342
"operations": [
13431343
{
13441344
"object": "testRunner",
@@ -1356,7 +1356,6 @@
13561356
],
13571357
"writeConcernError": {
13581358
"code": 64,
1359-
"codeName": "WriteConcernFailed",
13601359
"errmsg": "waiting for replication timed out",
13611360
"errInfo": {
13621361
"wtimeout": true

specifications/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

src/MongoDB.Driver/Core/ServerErrorCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ internal enum ServerErrorCode
5454
UnauthorizedServerless = 8000,
5555
UnknownReplWriteConcern = 79,
5656
UnsatisfiableWriteConcern = 100,
57-
WriteConcernFailed = 64
57+
WriteConcernTimeout = 64
5858
}
5959
}

tests/MongoDB.Driver.Tests/Core/Operations/RetryabilityHelperTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class RetryabilityHelperTests
4141
[InlineData(ServerErrorCode.HostUnreachable, true)]
4242
[InlineData(ServerErrorCode.NetworkTimeout, true)]
4343
[InlineData(ServerErrorCode.SocketException, true)]
44-
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
44+
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
4545
[InlineData(ServerErrorCode.ExceededTimeLimit, true)]
4646
public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError_for_MongoWriteConcernException_when_required(int errorCode, bool shouldAddErrorLabel)
4747
{
@@ -80,7 +80,7 @@ public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError
8080
[InlineData(ServerErrorCode.HostUnreachable, true)]
8181
[InlineData(ServerErrorCode.NetworkTimeout, true)]
8282
[InlineData(ServerErrorCode.SocketException, true)]
83-
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
83+
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
8484
[InlineData(ServerErrorCode.ExceededTimeLimit, true)]
8585
public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError_when_required(object exceptionDescription, bool shouldAddErrorLabel)
8686
{
@@ -142,7 +142,7 @@ public void IsCommandRetryable_should_return_expected_result(string command, boo
142142
[InlineData(ServerErrorCode.RetryChangeStream, true)]
143143
[InlineData(ServerErrorCode.FailedToSatisfyReadPreference, true)]
144144
[InlineData(ServerErrorCode.ElectionInProgress, false)]
145-
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
145+
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
146146
[InlineData(ServerErrorCode.CappedPositionLost, false)]
147147
[InlineData(ServerErrorCode.CursorKilled, false)]
148148
[InlineData(ServerErrorCode.Interrupted, false)]

0 commit comments

Comments
 (0)