Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
]
},
{
"description": "InsertOne fails after WriteConcernError WriteConcernFailed",
"description": "InsertOne fails after WriteConcernError WriteConcernTimeout",
"operations": [
{
"name": "failPoint",
Expand All @@ -757,7 +757,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ tests:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 } # The write was still applied.
-
description: 'InsertOne fails after WriteConcernError WriteConcernFailed'
description: 'InsertOne fails after WriteConcernError WriteConcernTimeout'
operations:
-
name: failPoint
Expand All @@ -353,7 +353,6 @@ tests:
failCommands: [ insert ]
writeConcernError:
code: 64
codeName: WriteConcernFailed
errmsg: 'waiting for replication timed out'
errInfo:
wtimeout: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"data": [],
"tests": [
{
"description": "commitTransaction is retried after WriteConcernFailed timeout error",
"description": "commitTransaction is retried after WriteConcernTimeout timeout error",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand All @@ -30,7 +30,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down Expand Up @@ -156,7 +155,7 @@
}
},
{
"description": "commitTransaction is retried after WriteConcernFailed non-timeout error",
"description": "commitTransaction is retried after WriteConcernTimeout non-timeout error",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand All @@ -168,7 +167,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "multiple errors reported"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data: []

tests:
-
description: commitTransaction is retried after WriteConcernFailed timeout error
description: commitTransaction is retried after WriteConcernTimeout timeout error
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
Expand All @@ -23,7 +23,6 @@ tests:
# with writeConcernError (see: SERVER-39292)
writeConcernError:
code: 64
codeName: WriteConcernFailed
errmsg: "waiting for replication timed out"
errInfo: { wtimeout: true }
operations:
Expand Down Expand Up @@ -106,10 +105,10 @@ tests:
- { _id: 1 }
-
# This test configures the fail point to return an error with the
# WriteConcernFailed code but without errInfo that would identify it as a
# WriteConcernTimeout code but without errInfo that would identify it as a
# wtimeout error. This tests that drivers do not assume that all
# WriteConcernFailed errors are due to a replication timeout.
description: commitTransaction is retried after WriteConcernFailed non-timeout error
# WriteConcernTimeout errors are due to a replication timeout.
description: commitTransaction is retried after WriteConcernTimeout non-timeout error
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
Expand All @@ -119,7 +118,6 @@ tests:
# with writeConcernError (see: SERVER-39292)
writeConcernError:
code: 64
codeName: WriteConcernFailed
errmsg: "multiple errors reported"
operations:
- *operation
Expand Down
5 changes: 2 additions & 3 deletions specifications/transactions/tests/unified/error-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@
]
},
{
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout",
"operations": [
{
"object": "testRunner",
Expand Down Expand Up @@ -1338,7 +1338,7 @@
]
},
{
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout",
"operations": [
{
"object": "testRunner",
Expand All @@ -1356,7 +1356,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down
7 changes: 3 additions & 4 deletions specifications/transactions/tests/unified/error-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ tests:
databaseName: *database_name
documents: []
-
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed'
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout'
operations:
-
object: testRunner
Expand All @@ -702,7 +702,7 @@ tests:
failCommands:
- commitTransaction
writeConcernError:
code: 64 # WriteConcernFailed without wtimeout
code: 64 # WriteConcernTimeout without wtimeout
errmsg: 'multiple errors reported'
-
object: *session0
Expand Down Expand Up @@ -782,7 +782,7 @@ tests:
documents:
- { _id: 1 }
-
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout'
description: 'add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout'
operations:
-
object: testRunner
Expand All @@ -797,7 +797,6 @@ tests:
- commitTransaction
writeConcernError:
code: 64
codeName: WriteConcernFailed
errmsg: 'waiting for replication timed out'
errInfo:
wtimeout: true
Expand Down
2 changes: 1 addition & 1 deletion src/MongoDB.Driver/Core/ServerErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ internal enum ServerErrorCode
UnauthorizedServerless = 8000,
UnknownReplWriteConcern = 79,
UnsatisfiableWriteConcern = 100,
WriteConcernFailed = 64
WriteConcernTimeout = 64
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class RetryabilityHelperTests
[InlineData(ServerErrorCode.HostUnreachable, true)]
[InlineData(ServerErrorCode.NetworkTimeout, true)]
[InlineData(ServerErrorCode.SocketException, true)]
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
[InlineData(ServerErrorCode.ExceededTimeLimit, true)]
public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError_for_MongoWriteConcernException_when_required(int errorCode, bool shouldAddErrorLabel)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError
[InlineData(ServerErrorCode.HostUnreachable, true)]
[InlineData(ServerErrorCode.NetworkTimeout, true)]
[InlineData(ServerErrorCode.SocketException, true)]
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
[InlineData(ServerErrorCode.ExceededTimeLimit, true)]
public void AddRetryableWriteErrorLabelIfRequired_should_add_RetryableWriteError_when_required(object exceptionDescription, bool shouldAddErrorLabel)
{
Expand Down Expand Up @@ -142,7 +142,7 @@ public void IsCommandRetryable_should_return_expected_result(string command, boo
[InlineData(ServerErrorCode.RetryChangeStream, true)]
[InlineData(ServerErrorCode.FailedToSatisfyReadPreference, true)]
[InlineData(ServerErrorCode.ElectionInProgress, false)]
[InlineData(ServerErrorCode.WriteConcernFailed, false)]
[InlineData(ServerErrorCode.WriteConcernTimeout, false)]
[InlineData(ServerErrorCode.CappedPositionLost, false)]
[InlineData(ServerErrorCode.CursorKilled, false)]
[InlineData(ServerErrorCode.Interrupted, false)]
Expand Down