File tree Expand file tree Collapse file tree 8 files changed +16
-23
lines changed
transactions-convenient-api/unified Expand file tree Collapse file tree 8 files changed +16
-23
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ export class BulkWriteResult {
285285 if ( i === 0 ) errmsg = errmsg + ' and ' ;
286286 }
287287
288- return new WriteConcernError ( { errmsg, code : MONGODB_ERROR_CODES . WriteConcernFailed } ) ;
288+ return new WriteConcernError ( { errmsg, code : MONGODB_ERROR_CODES . WriteConcernTimeout } ) ;
289289 }
290290 }
291291
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ export const MONGODB_ERROR_CODES = Object.freeze({
5656 FailedToSatisfyReadPreference : 133 ,
5757 CursorNotFound : 43 ,
5858 LegacyNotPrimary : 10058 ,
59- WriteConcernFailed : 64 ,
59+ // WriteConcernTimeout is WriteConcernFailed on pre-8.1 servers
60+ WriteConcernTimeout : 64 ,
6061 NamespaceNotFound : 26 ,
6162 IllegalOperation : 20 ,
6263 MaxTimeMSExpired : 50 ,
Original file line number Diff line number Diff line change 739739 ]
740740 },
741741 {
742- "description" : " InsertOne fails after WriteConcernError WriteConcernFailed " ,
742+ "description" : " InsertOne fails after WriteConcernError WriteConcernTimeout " ,
743743 "operations" : [
744744 {
745745 "name" : " failPoint" ,
757757 ],
758758 "writeConcernError" : {
759759 "code" : 64 ,
760- "codeName" : " WriteConcernFailed" ,
761760 "errmsg" : " waiting for replication timed out" ,
762761 "errInfo" : {
763762 "wtimeout" : true
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
7474 ],
7575 "writeConcernError" : {
7676 "code" : 64 ,
77- "codeName" : " WriteConcernFailed" ,
7877 "errmsg" : " waiting for replication timed out" ,
7978 "errInfo" : {
8079 "wtimeout" : true
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" ,
254253 ],
255254 "writeConcernError" : {
256255 "code" : 64 ,
257- "codeName" : " WriteConcernFailed" ,
258256 "errmsg" : " multiple errors reported"
259257 }
260258 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ initialData:
3232
3333tests :
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
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
Original file line number Diff line number Diff line change 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" ,
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" ,
13561356 ],
13571357 "writeConcernError" : {
13581358 "code" : 64 ,
1359- "codeName" : " WriteConcernFailed" ,
13601359 "errmsg" : " waiting for replication timed out" ,
13611360 "errInfo" : {
13621361 "wtimeout" : true
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments