File tree 8 files changed +16
-23
lines changed
transactions-convenient-api/unified
8 files changed +16
-23
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ export class BulkWriteResult {
285
285
if ( i === 0 ) errmsg = errmsg + ' and ' ;
286
286
}
287
287
288
- return new WriteConcernError ( { errmsg, code : MONGODB_ERROR_CODES . WriteConcernFailed } ) ;
288
+ return new WriteConcernError ( { errmsg, code : MONGODB_ERROR_CODES . WriteConcernTimeout } ) ;
289
289
}
290
290
}
291
291
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ export const MONGODB_ERROR_CODES = Object.freeze({
56
56
FailedToSatisfyReadPreference : 133 ,
57
57
CursorNotFound : 43 ,
58
58
LegacyNotPrimary : 10058 ,
59
- WriteConcernFailed : 64 ,
59
+ // WriteConcernTimeout is WriteConcernFailed on pre-8.1 servers
60
+ WriteConcernTimeout : 64 ,
60
61
NamespaceNotFound : 26 ,
61
62
IllegalOperation : 20 ,
62
63
MaxTimeMSExpired : 50 ,
Original file line number Diff line number Diff line change 739
739
]
740
740
},
741
741
{
742
- "description" : " InsertOne fails after WriteConcernError WriteConcernFailed " ,
742
+ "description" : " InsertOne fails after WriteConcernError WriteConcernTimeout " ,
743
743
"operations" : [
744
744
{
745
745
"name" : " failPoint" ,
757
757
],
758
758
"writeConcernError" : {
759
759
"code" : 64 ,
760
- "codeName" : " WriteConcernFailed" ,
761
760
"errmsg" : " waiting for replication timed out" ,
762
761
"errInfo" : {
763
762
"wtimeout" : true
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ tests:
339
339
- { _id: 2, x: 22 }
340
340
- { _id: 3, x: 33 } # The write was still applied.
341
341
-
342
- description : ' InsertOne fails after WriteConcernError WriteConcernFailed '
342
+ description : ' InsertOne fails after WriteConcernError WriteConcernTimeout '
343
343
operations :
344
344
-
345
345
name : failPoint
@@ -353,7 +353,6 @@ tests:
353
353
failCommands : [ insert ]
354
354
writeConcernError :
355
355
code : 64
356
- codeName : WriteConcernFailed
357
356
errmsg : ' waiting for replication timed out'
358
357
errInfo :
359
358
wtimeout : true
Original file line number Diff line number Diff line change 56
56
],
57
57
"tests" : [
58
58
{
59
- "description" : " commitTransaction is retried after WriteConcernFailed timeout error" ,
59
+ "description" : " commitTransaction is retried after WriteConcernTimeout timeout error" ,
60
60
"operations" : [
61
61
{
62
62
"name" : " failPoint" ,
74
74
],
75
75
"writeConcernError" : {
76
76
"code" : 64 ,
77
- "codeName" : " WriteConcernFailed" ,
78
77
"errmsg" : " waiting for replication timed out" ,
79
78
"errInfo" : {
80
79
"wtimeout" : true
236
235
]
237
236
},
238
237
{
239
- "description" : " commitTransaction is retried after WriteConcernFailed non-timeout error" ,
238
+ "description" : " commitTransaction is retried after WriteConcernTimeout non-timeout error" ,
240
239
"operations" : [
241
240
{
242
241
"name" : " failPoint" ,
254
253
],
255
254
"writeConcernError" : {
256
255
"code" : 64 ,
257
- "codeName" : " WriteConcernFailed" ,
258
256
"errmsg" : " multiple errors reported"
259
257
}
260
258
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ initialData:
32
32
33
33
tests :
34
34
-
35
- description : commitTransaction is retried after WriteConcernFailed timeout error
35
+ description : commitTransaction is retried after WriteConcernTimeout timeout error
36
36
operations :
37
37
- name : failPoint
38
38
object : testRunner
47
47
# with writeConcernError (see: SERVER-39292)
48
48
writeConcernError :
49
49
code : 64
50
- codeName : WriteConcernFailed
51
50
errmsg : " waiting for replication timed out"
52
51
errInfo : { wtimeout: true }
53
52
- &operation
@@ -126,10 +125,10 @@ tests:
126
125
- { _id: 1 }
127
126
-
128
127
# 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
130
129
# 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
133
132
operations :
134
133
- name : failPoint
135
134
object : testRunner
@@ -144,7 +143,6 @@ tests:
144
143
# with writeConcernError (see: SERVER-39292)
145
144
writeConcernError :
146
145
code : 64
147
- codeName : WriteConcernFailed
148
146
errmsg : " multiple errors reported"
149
147
- *operation
150
148
expectEvents : *expectEvents_with_retries
Original file line number Diff line number Diff line change 1176
1176
]
1177
1177
},
1178
1178
{
1179
- "description" : " add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed " ,
1179
+ "description" : " add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout " ,
1180
1180
"operations" : [
1181
1181
{
1182
1182
"object" : " testRunner" ,
1338
1338
]
1339
1339
},
1340
1340
{
1341
- "description" : " add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout" ,
1341
+ "description" : " add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout" ,
1342
1342
"operations" : [
1343
1343
{
1344
1344
"object" : " testRunner" ,
1356
1356
],
1357
1357
"writeConcernError" : {
1358
1358
"code" : 64 ,
1359
- "codeName" : " WriteConcernFailed" ,
1360
1359
"errmsg" : " waiting for replication timed out" ,
1361
1360
"errInfo" : {
1362
1361
"wtimeout" : true
Original file line number Diff line number Diff line change @@ -688,7 +688,7 @@ tests:
688
688
databaseName : *database_name
689
689
documents : []
690
690
-
691
- description : ' add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed '
691
+ description : ' add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout '
692
692
operations :
693
693
-
694
694
object : testRunner
@@ -702,7 +702,7 @@ tests:
702
702
failCommands :
703
703
- commitTransaction
704
704
writeConcernError :
705
- code : 64 # WriteConcernFailed without wtimeout
705
+ code : 64 # WriteConcernTimeout without wtimeout
706
706
errmsg : ' multiple errors reported'
707
707
-
708
708
object : *session0
@@ -782,7 +782,7 @@ tests:
782
782
documents :
783
783
- { _id: 1 }
784
784
-
785
- description : ' add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout'
785
+ description : ' add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout'
786
786
operations :
787
787
-
788
788
object : testRunner
@@ -797,7 +797,6 @@ tests:
797
797
- commitTransaction
798
798
writeConcernError :
799
799
code : 64
800
- codeName : WriteConcernFailed
801
800
errmsg : ' waiting for replication timed out'
802
801
errInfo :
803
802
wtimeout : true
You can’t perform that action at this time.
0 commit comments