Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
fe4ff68d
Unverified
Commit
fe4ff68d
authored
Mar 10, 2020
by
Andreas Braun
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #725
parents
8060d725
8f7d7f8e
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
2592 additions
and
287 deletions
+2592
-287
Context.php
tests/SpecTests/Context.php
+0
-3
ResultExpectation.php
tests/SpecTests/ResultExpectation.php
+1
-1
bulkWrite-errorLabels.json
tests/SpecTests/retryable-writes/bulkWrite-errorLabels.json
+182
-0
bulkWrite-serverErrors.json
tests/SpecTests/retryable-writes/bulkWrite-serverErrors.json
+83
-2
deleteOne-errorLabels.json
tests/SpecTests/retryable-writes/deleteOne-errorLabels.json
+106
-0
deleteOne-serverErrors.json
tests/SpecTests/retryable-writes/deleteOne-serverErrors.json
+51
-2
findOneAndDelete-errorLabels.json
...cTests/retryable-writes/findOneAndDelete-errorLabels.json
+117
-0
findOneAndDelete-serverErrors.json
...Tests/retryable-writes/findOneAndDelete-serverErrors.json
+56
-2
findOneAndReplace-errorLabels.json
...Tests/retryable-writes/findOneAndReplace-errorLabels.json
+121
-0
findOneAndReplace-serverErrors.json
...ests/retryable-writes/findOneAndReplace-serverErrors.json
+56
-2
findOneAndUpdate-errorLabels.json
...cTests/retryable-writes/findOneAndUpdate-errorLabels.json
+123
-0
findOneAndUpdate-serverErrors.json
...Tests/retryable-writes/findOneAndUpdate-serverErrors.json
+57
-2
insertMany-errorLabels.json
tests/SpecTests/retryable-writes/insertMany-errorLabels.json
+129
-0
insertMany-serverErrors.json
...s/SpecTests/retryable-writes/insertMany-serverErrors.json
+57
-2
insertOne-errorLabels.json
tests/SpecTests/retryable-writes/insertOne-errorLabels.json
+90
-0
insertOne-serverErrors.json
tests/SpecTests/retryable-writes/insertOne-serverErrors.json
+211
-6
replaceOne-errorLabels.json
tests/SpecTests/retryable-writes/replaceOne-errorLabels.json
+120
-0
replaceOne-serverErrors.json
...s/SpecTests/retryable-writes/replaceOne-serverErrors.json
+55
-2
updateOne-errorLabels.json
tests/SpecTests/retryable-writes/updateOne-errorLabels.json
+122
-0
updateOne-serverErrors.json
tests/SpecTests/retryable-writes/updateOne-serverErrors.json
+56
-2
callback-retry.json
...SpecTests/transactions-convenient-api/callback-retry.json
+2
-1
commit-retry.json
...s/SpecTests/transactions-convenient-api/commit-retry.json
+3
-0
transaction-options.json
...ests/transactions-convenient-api/transaction-options.json
+10
-10
abort.json
tests/SpecTests/transactions/abort.json
+2
-1
bulk.json
tests/SpecTests/transactions/bulk.json
+4
-12
causal-consistency.json
tests/SpecTests/transactions/causal-consistency.json
+6
-15
error-labels.json
tests/SpecTests/transactions/error-labels.json
+32
-14
mongos-recovery-token.json
tests/SpecTests/transactions/mongos-recovery-token.json
+4
-1
pin-mongos.json
tests/SpecTests/transactions/pin-mongos.json
+2
-2
read-concern.json
tests/SpecTests/transactions/read-concern.json
+10
-10
retryable-abort-errorLabels.json
...s/SpecTests/transactions/retryable-abort-errorLabels.json
+204
-0
retryable-abort.json
tests/SpecTests/transactions/retryable-abort.json
+45
-0
retryable-commit-errorLabels.json
.../SpecTests/transactions/retryable-commit-errorLabels.json
+223
-0
retryable-commit.json
tests/SpecTests/transactions/retryable-commit.json
+56
-5
transaction-options-repl.json
tests/SpecTests/transactions/transaction-options-repl.json
+181
-0
transaction-options.json
tests/SpecTests/transactions/transaction-options.json
+11
-177
update.json
tests/SpecTests/transactions/update.json
+4
-12
write-concern.json
tests/SpecTests/transactions/write-concern.json
+0
-1
No files found.
tests/SpecTests/Context.php
View file @
fe4ff68d
...
...
@@ -185,9 +185,6 @@ final class Context
$clientOptions
=
isset
(
$test
->
clientOptions
)
?
(
array
)
$test
->
clientOptions
:
[];
// TODO: Remove this once retryWrites=true by default (see: PHPC-1324)
$clientOptions
[
'retryWrites'
]
=
true
;
if
(
isset
(
$test
->
outcome
->
collection
->
name
))
{
$o
->
outcomeCollectionName
=
$test
->
outcome
->
collection
->
name
;
}
...
...
tests/SpecTests/ResultExpectation.php
View file @
fe4ff68d
...
...
@@ -126,7 +126,7 @@ final class ResultExpectation
public
static
function
fromRetryableWrites
(
stdClass
$outcome
,
$defaultAssertionType
)
{
if
(
property_exists
(
$outcome
,
'result'
))
{
if
(
property_exists
(
$outcome
,
'result'
)
&&
!
self
::
isErrorResult
(
$outcome
->
result
)
)
{
$assertionType
=
$outcome
->
result
===
null
?
self
::
ASSERT_NULL
:
$defaultAssertionType
;
$expectedValue
=
$outcome
->
result
;
}
else
{
...
...
tests/SpecTests/retryable-writes/bulkWrite-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"BulkWrite succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
2
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
,
"insertedCount"
:
1
,
"insertedIds"
:
{
"1"
:
3
},
"matchedCount"
:
1
,
"modifiedCount"
:
1
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
23
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"BulkWrite fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
2
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/bulkWrite-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"update"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -117,7 +120,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -186,6 +192,81 @@
]
}
}
},
{
"description"
:
"BulkWrite fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"update"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
2
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/deleteOne-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"DeleteOne succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"delete"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"DeleteOne fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"delete"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/deleteOne-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"delete"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -73,7 +76,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -98,6 +104,49 @@
]
}
}
},
{
"description"
:
"DeleteOne fails with RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"delete"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndDelete-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndDelete succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"findOneAndDelete"
,
"arguments"
:
{
"filter"
:
{
"x"
:
{
"$gte"
:
11
}
},
"sort"
:
{
"x"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"_id"
:
1
,
"x"
:
11
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"FindOneAndDelete fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"findOneAndDelete"
,
"arguments"
:
{
"filter"
:
{
"x"
:
{
"$gte"
:
11
}
},
"sort"
:
{
"x"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndDelete-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -79,7 +82,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -110,6 +116,54 @@
]
}
}
},
{
"description"
:
"FindOneAndDelete fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"findOneAndDelete"
,
"arguments"
:
{
"filter"
:
{
"x"
:
{
"$gte"
:
11
}
},
"sort"
:
{
"x"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndReplace-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndReplace succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"result"
:
{
"_id"
:
1
,
"x"
:
11
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
111
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"FindOneAndReplace fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndReplace-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -83,7 +86,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -118,6 +124,54 @@
]
}
}
},
{
"description"
:
"FindOneAndReplace fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndUpdate-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndUpdate succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"findOneAndUpdate"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"result"
:
{
"_id"
:
1
,
"x"
:
11
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
12
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"FindOneAndUpdate fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"findOneAndUpdate"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndUpdate-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -84,7 +87,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -120,6 +126,55 @@
]
}
}
},
{
"description"
:
"FindOneAndUpdate fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"findOneAndUpdate"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertMany-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
],
"tests"
:
[
{
"description"
:
"InsertMany succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"insertMany"
,
"arguments"
:
{
"documents"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"result"
:
{
"insertedIds"
:
{
"0"
:
2
,
"1"
:
3
}
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"InsertMany fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"insertMany"
,
"arguments"
:
{
"documents"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertMany-serverErrors.json
View file @
fe4ff68d
...
...
@@ -31,7 +31,10 @@
"failCommands"
:
[
"insert"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -90,7 +93,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -136,6 +142,55 @@
]
}
}
},
{
"description"
:
"InsertMany fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"insertMany"
,
"arguments"
:
{
"documents"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertOne-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[],
"tests"
:
[
{
"description"
:
"InsertOne succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
1
,
"x"
:
11
}
}
},
"outcome"
:
{
"result"
:
{
"insertedId"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
]
}
}
},
{
"description"
:
"InsertOne fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
1
,
"x"
:
11
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertOne-serverErrors.json
View file @
fe4ff68d
...
...
@@ -69,6 +69,53 @@
}
}
},
{
"description"
:
"InsertOne fails after connection failure when retryWrites option is false"
,
"clientOptions"
:
{
"retryWrites"
:
false
},
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"InsertOne succeeds after NotMaster"
,
"failPoint"
:
{
...
...
@@ -81,6 +128,9 @@
"insert"
],
"errorCode"
:
10107
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -127,6 +177,9 @@
"insert"
],
"errorCode"
:
13436
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -173,6 +226,9 @@
"insert"
],
"errorCode"
:
13435
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -208,7 +264,7 @@
}
},
{
"description"
:
"InsertOne succeeds after InterruptedDueTo
StepDown
"
,
"description"
:
"InsertOne succeeds after InterruptedDueTo
ReplStateChange
"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -219,6 +275,9 @@
"insert"
],
"errorCode"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -265,6 +324,9 @@
"insert"
],
"errorCode"
:
11600
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -311,6 +373,9 @@
"insert"
],
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -357,6 +422,9 @@
"insert"
],
"errorCode"
:
91
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -403,6 +471,9 @@
"insert"
],
"errorCode"
:
7
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -449,6 +520,9 @@
"insert"
],
"errorCode"
:
6
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -495,6 +569,9 @@
"insert"
],
"errorCode"
:
9001
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -541,6 +618,58 @@
"insert"
],
"errorCode"
:
89
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
"outcome"
:
{
"result"
:
{
"insertedId"
:
3
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"InsertOne succeeds after ExceededTimeLimit"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
262
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -601,6 +730,11 @@
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
...
...
@@ -628,7 +762,10 @@
],
"writeConcernError"
:
{
"code"
:
11600
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -664,7 +801,7 @@
}
},
{
"description"
:
"InsertOne succeeds after WriteConcernError InterruptedDueTo
StepDown
"
,
"description"
:
"InsertOne succeeds after WriteConcernError InterruptedDueTo
ReplStateChange
"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -676,7 +813,10 @@
],
"writeConcernError"
:
{
"code"
:
11602
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -724,7 +864,10 @@
],
"writeConcernError"
:
{
"code"
:
189
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -772,7 +915,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -835,6 +981,11 @@
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
...
...
@@ -881,6 +1032,11 @@
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
...
...
@@ -931,6 +1087,11 @@
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
...
...
@@ -948,6 +1109,50 @@
]
}
}
},
{
"description"
:
"InsertOne fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/replaceOne-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"ReplaceOne succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
1
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
111
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"ReplaceOne fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/replaceOne-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"update"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -83,7 +86,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -118,6 +124,53 @@
]
}
}
},
{
"description"
:
"ReplaceOne fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"update"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/updateOne-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"UpdateOne succeeds with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
1
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
12
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"UpdateOne fails if server does not return RetryableWriteError"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/updateOne-serverErrors.json
View file @
fe4ff68d
...
...
@@ -35,7 +35,10 @@
"failCommands"
:
[
"update"
],
"errorCode"
:
189
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operation"
:
{
...
...
@@ -84,7 +87,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -120,6 +126,54 @@
]
}
}
},
{
"description"
:
"UpdateOne fails with a RetryableWriteError label after two connection failures"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"update"
],
"closeConnection"
:
true
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"error"
:
true
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
]
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/transactions-convenient-api/callback-retry.json
View file @
fe4ff68d
...
...
@@ -235,7 +235,8 @@
"errorLabelsOmit"
:
[
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
],
"errorContains"
:
"E11000"
}
}
],
...
...
tests/SpecTests/transactions-convenient-api/commit-retry.json
View file @
fe4ff68d
...
...
@@ -304,6 +304,9 @@
"commitTransaction"
],
"errorCode"
:
10107
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
tests/SpecTests/transactions-convenient-api/transaction-options.json
View file @
fe4ff68d
...
...
@@ -192,7 +192,7 @@
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -243,7 +243,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
},
...
...
@@ -308,7 +308,7 @@
},
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -335,7 +335,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
},
...
...
@@ -380,7 +380,7 @@
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"
majority
"
"level"
:
"
snapshot
"
},
"writeConcern"
:
{
"w"
:
"majority"
...
...
@@ -412,7 +412,7 @@
},
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -439,7 +439,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
},
...
...
@@ -481,7 +481,7 @@
"description"
:
"withTransaction explicit transaction options override client options"
,
"useMultipleMongoses"
:
true
,
"clientOptions"
:
{
"readConcernLevel"
:
"
majority
"
,
"readConcernLevel"
:
"
local
"
,
"w"
:
"majority"
},
"operations"
:
[
...
...
@@ -508,7 +508,7 @@
},
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -535,7 +535,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
},
...
...
tests/SpecTests/transactions/abort.json
View file @
fe4ff68d
...
...
@@ -458,7 +458,8 @@
"errorLabelsOmit"
:
[
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
],
"errorContains"
:
"E11000"
}
},
{
...
...
tests/SpecTests/transactions/bulk.json
View file @
fe4ff68d
...
...
@@ -304,9 +304,7 @@
"$set"
:
{
"x"
:
1
}
},
"multi"
:
false
,
"upsert"
:
false
}
},
{
"q"
:
{
...
...
@@ -317,7 +315,6 @@
"x"
:
2
}
},
"multi"
:
false
,
"upsert"
:
true
}
],
...
...
@@ -379,9 +376,7 @@
},
"u"
:
{
"y"
:
1
},
"multi"
:
false
,
"upsert"
:
false
}
},
{
"q"
:
{
...
...
@@ -389,9 +384,7 @@
},
"u"
:
{
"y"
:
2
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
@@ -454,8 +447,7 @@
"z"
:
1
}
},
"multi"
:
true
,
"upsert"
:
false
"multi"
:
true
}
],
"ordered"
:
true
,
...
...
tests/SpecTests/transactions/causal-consistency.json
View file @
fe4ff68d
...
...
@@ -40,8 +40,7 @@
"$inc"
:
{
"count"
:
1
}
},
"upsert"
:
false
}
},
"result"
:
{
"matchedCount"
:
1
,
...
...
@@ -65,8 +64,7 @@
"$inc"
:
{
"count"
:
1
}
},
"upsert"
:
false
}
},
"result"
:
{
"matchedCount"
:
1
,
...
...
@@ -93,9 +91,7 @@
"$inc"
:
{
"count"
:
1
}
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
@@ -123,9 +119,7 @@
"$inc"
:
{
"count"
:
1
}
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
@@ -212,8 +206,7 @@
"$inc"
:
{
"count"
:
1
}
},
"upsert"
:
false
}
},
"result"
:
{
"matchedCount"
:
1
,
...
...
@@ -260,9 +253,7 @@
"$inc"
:
{
"count"
:
1
}
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
tests/SpecTests/transactions/error-labels.json
View file @
fe4ff68d
...
...
@@ -42,7 +42,8 @@
"errorLabelsOmit"
:
[
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
],
"errorContains"
:
"E11000"
}
},
{
...
...
@@ -407,6 +408,7 @@
"TransientTransactionError"
],
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
]
}
...
...
@@ -460,7 +462,7 @@
}
},
{
"description"
:
"add
transient
label to connection errors"
,
"description"
:
"add
TransientTransactionError
label to connection errors"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -662,7 +664,7 @@
}
},
{
"description"
:
"add
unknown commit label
to connection errors"
,
"description"
:
"add
RetryableWriteError and UnknownTransactionCommitResult labels
to connection errors"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -698,6 +700,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
...
...
@@ -800,7 +803,7 @@
}
},
{
"description"
:
"add
unknown commit label
to retryable commit errors"
,
"description"
:
"add
RetryableWriteError and UnknownTransactionCommitResult labels
to retryable commit errors"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -810,7 +813,10 @@
"failCommands"
:
[
"commitTransaction"
],
"errorCode"
:
11602
"errorCode"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operations"
:
[
...
...
@@ -836,6 +842,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
...
...
@@ -938,7 +945,7 @@
}
},
{
"description"
:
"add
unknown commit label
to writeConcernError ShutdownInProgress"
,
"description"
:
"add
RetryableWriteError and UnknownTransactionCommitResult labels
to writeConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -950,7 +957,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
},
...
...
@@ -984,6 +994,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
...
...
@@ -1088,7 +1099,7 @@
}
},
{
"description"
:
"add
unknown commi
t label to writeConcernError WriteConcernFailed"
,
"description"
:
"add
UnknownTransactionCommitResul
t label to writeConcernError WriteConcernFailed"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1137,6 +1148,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
]
}
...
...
@@ -1219,7 +1231,7 @@
}
},
{
"description"
:
"add
unknown commi
t label to writeConcernError WriteConcernFailed with wtimeout"
,
"description"
:
"add
UnknownTransactionCommitResul
t label to writeConcernError WriteConcernFailed with wtimeout"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1272,6 +1284,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
]
}
...
...
@@ -1354,7 +1367,7 @@
}
},
{
"description"
:
"omit
unknown commit label to
writeConcernError UnsatisfiableWriteConcern"
,
"description"
:
"omit
UnknownTransactionCommitResult label from
writeConcernError UnsatisfiableWriteConcern"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1400,6 +1413,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
...
...
@@ -1460,7 +1474,7 @@
}
},
{
"description"
:
"omit
unknown commit label to
writeConcernError UnknownReplWriteConcern"
,
"description"
:
"omit
UnknownTransactionCommitResult label from
writeConcernError UnknownReplWriteConcern"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1506,6 +1520,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteConcern"
,
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
...
...
@@ -1566,7 +1581,7 @@
}
},
{
"description"
:
"do not add
unknown commi
t label to MaxTimeMSExpired inside transactions"
,
"description"
:
"do not add
UnknownTransactionCommitResul
t label to MaxTimeMSExpired inside transactions"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1613,6 +1628,7 @@
},
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
,
"TransientTransactionError"
]
...
...
@@ -1695,7 +1711,7 @@
}
},
{
"description"
:
"add
unknown commi
t label to MaxTimeMSExpired"
,
"description"
:
"add
UnknownTransactionCommitResul
t label to MaxTimeMSExpired"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1742,6 +1758,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
]
}
...
...
@@ -1826,7 +1843,7 @@
}
},
{
"description"
:
"add
unknown commi
t label to writeConcernError MaxTimeMSExpired"
,
"description"
:
"add
UnknownTransactionCommitResul
t label to writeConcernError MaxTimeMSExpired"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -1876,6 +1893,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
]
}
...
...
tests/SpecTests/transactions/mongos-recovery-token.json
View file @
fe4ff68d
...
...
@@ -181,7 +181,10 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
"errmsg"
:
"Replication is being shut down"
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
}
}
...
...
tests/SpecTests/transactions/pin-mongos.json
View file @
fe4ff68d
...
...
@@ -875,7 +875,7 @@
"failCommands"
:
[
"commitTransaction"
],
"errorCode"
:
5
0
"errorCode"
:
5
1
}
}
}
...
...
@@ -887,7 +887,7 @@
"errorLabelsOmit"
:
[
"TransientTransactionError"
],
"errorCode"
:
5
0
"errorCode"
:
5
1
}
},
{
...
...
tests/SpecTests/transactions/read-concern.json
View file @
fe4ff68d
...
...
@@ -39,7 +39,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
}
}
}
...
...
@@ -110,7 +110,7 @@
"cursor"
:
{},
"lsid"
:
"session0"
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"txnNumber"
:
{
"$numberLong"
:
"1"
...
...
@@ -202,7 +202,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
}
}
}
...
...
@@ -274,7 +274,7 @@
"batchSize"
:
3
,
"lsid"
:
"session0"
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"txnNumber"
:
{
"$numberLong"
:
"1"
...
...
@@ -389,7 +389,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
}
}
}
...
...
@@ -484,7 +484,7 @@
},
"lsid"
:
"session0"
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"txnNumber"
:
{
"$numberLong"
:
"1"
...
...
@@ -608,7 +608,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
}
}
}
...
...
@@ -664,7 +664,7 @@
"key"
:
"_id"
,
"lsid"
:
"session0"
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"txnNumber"
:
{
"$numberLong"
:
"1"
...
...
@@ -741,7 +741,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
}
}
}
...
...
@@ -780,7 +780,7 @@
"find"
:
"test"
,
"lsid"
:
"session0"
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"txnNumber"
:
{
"$numberLong"
:
"1"
...
...
tests/SpecTests/transactions/retryable-abort-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"database_name"
:
"transaction-tests"
,
"collection_name"
:
"test"
,
"data"
:
[],
"tests"
:
[
{
"description"
:
"abortTransaction only retries once with RetryableWriteError from server"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failCommands"
:
[
"abortTransaction"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"abortTransaction"
,
"object"
:
"session0"
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"readConcern"
:
null
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"abortTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"abortTransaction"
,
"database_name"
:
"admin"
}
},
{
"command_started_event"
:
{
"command"
:
{
"abortTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"abortTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[]
}
}
},
{
"description"
:
"abortTransaction does not retry without RetryableWriteError label"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"abortTransaction"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"abortTransaction"
,
"object"
:
"session0"
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"readConcern"
:
null
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"abortTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"abortTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[]
}
}
}
]
}
tests/SpecTests/transactions/retryable-abort.json
View file @
fe4ff68d
...
...
@@ -413,6 +413,9 @@
"abortTransaction"
],
"errorCode"
:
10107
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -514,6 +517,9 @@
"abortTransaction"
],
"errorCode"
:
13436
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -615,6 +621,9 @@
"abortTransaction"
],
"errorCode"
:
13435
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -716,6 +725,9 @@
"abortTransaction"
],
"errorCode"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -817,6 +829,9 @@
"abortTransaction"
],
"errorCode"
:
11600
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -918,6 +933,9 @@
"abortTransaction"
],
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1019,6 +1037,9 @@
"abortTransaction"
],
"errorCode"
:
91
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1120,6 +1141,9 @@
"abortTransaction"
],
"errorCode"
:
7
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1221,6 +1245,9 @@
"abortTransaction"
],
"errorCode"
:
6
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1322,6 +1349,9 @@
"abortTransaction"
],
"errorCode"
:
9001
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1423,6 +1453,9 @@
"abortTransaction"
],
"errorCode"
:
89
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1525,6 +1558,9 @@
],
"writeConcernError"
:
{
"code"
:
11600
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -1639,6 +1675,9 @@
],
"writeConcernError"
:
{
"code"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -1753,6 +1792,9 @@
],
"writeConcernError"
:
{
"code"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -1867,6 +1909,9 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
tests/SpecTests/transactions/retryable-commit-errorLabels.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.3.1"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"database_name"
:
"transaction-tests"
,
"collection_name"
:
"test"
,
"data"
:
[],
"tests"
:
[
{
"description"
:
"commitTransaction does not retry error without RetryableWriteError label"
,
"clientOptions"
:
{
"retryWrites"
:
false
},
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"commitTransaction"
],
"errorCode"
:
11600
,
"errorLabels"
:
[]
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"commitTransaction"
,
"object"
:
"session0"
,
"result"
:
{
"errorLabelsOmit"
:
[
"RetryableWriteError"
,
"TransientTransactionError"
]
}
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"readConcern"
:
null
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"commitTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"commitTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[]
}
}
},
{
"description"
:
"commitTransaction retries once with RetryableWriteError from server"
,
"clientOptions"
:
{
"retryWrites"
:
false
},
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"commitTransaction"
],
"errorCode"
:
112
,
"errorLabels"
:
[
"RetryableWriteError"
]
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"commitTransaction"
,
"object"
:
"session0"
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"readConcern"
:
null
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"commitTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
null
},
"command_name"
:
"commitTransaction"
,
"database_name"
:
"admin"
}
},
{
"command_started_event"
:
{
"command"
:
{
"commitTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"writeConcern"
:
{
"w"
:
"majority"
,
"wtimeout"
:
10000
}
},
"command_name"
:
"commitTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
}
]
}
}
}
]
}
tests/SpecTests/transactions/retryable-commit.json
View file @
fe4ff68d
...
...
@@ -57,6 +57,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
...
...
@@ -207,6 +208,7 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsContain"
:
[
"RetryableWriteError"
,
"UnknownTransactionCommitResult"
],
"errorLabelsOmit"
:
[
...
...
@@ -353,7 +355,9 @@
"result"
:
{
"errorCodeName"
:
"Interrupted"
,
"errorLabelsOmit"
:
[
"TransientTransactionError"
"RetryableWriteError"
,
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
}
}
...
...
@@ -406,7 +410,7 @@
}
},
{
"description"
:
"commitTransaction
fails after WriteConcernError Interrupted
"
,
"description"
:
"commitTransaction
is not retried after UnsatisfiableWriteConcern error
"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
...
...
@@ -417,8 +421,8 @@
"commitTransaction"
],
"writeConcernError"
:
{
"code"
:
1
1601
,
"errmsg"
:
"
operation was interrupted
"
"code"
:
1
00
,
"errmsg"
:
"
Not enough data-bearing nodes
"
}
}
},
...
...
@@ -452,7 +456,9 @@
"object"
:
"session0"
,
"result"
:
{
"errorLabelsOmit"
:
[
"TransientTransactionError"
"RetryableWriteError"
,
"TransientTransactionError"
,
"UnknownTransactionCommitResult"
]
}
}
...
...
@@ -629,6 +635,9 @@
"commitTransaction"
],
"errorCode"
:
10107
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -737,6 +746,9 @@
"commitTransaction"
],
"errorCode"
:
13436
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -845,6 +857,9 @@
"commitTransaction"
],
"errorCode"
:
13435
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -953,6 +968,9 @@
"commitTransaction"
],
"errorCode"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1061,6 +1079,9 @@
"commitTransaction"
],
"errorCode"
:
11600
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1169,6 +1190,9 @@
"commitTransaction"
],
"errorCode"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1277,6 +1301,9 @@
"commitTransaction"
],
"errorCode"
:
91
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1385,6 +1412,9 @@
"commitTransaction"
],
"errorCode"
:
7
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1493,6 +1523,9 @@
"commitTransaction"
],
"errorCode"
:
6
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1601,6 +1634,9 @@
"commitTransaction"
],
"errorCode"
:
9001
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1709,6 +1745,9 @@
"commitTransaction"
],
"errorCode"
:
89
,
"errorLabels"
:
[
"RetryableWriteError"
],
"closeConnection"
:
false
}
},
...
...
@@ -1818,6 +1857,9 @@
],
"writeConcernError"
:
{
"code"
:
11600
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -1937,6 +1979,9 @@
],
"writeConcernError"
:
{
"code"
:
11602
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -2056,6 +2101,9 @@
],
"writeConcernError"
:
{
"code"
:
189
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
@@ -2175,6 +2223,9 @@
],
"writeConcernError"
:
{
"code"
:
91
,
"errorLabels"
:
[
"RetryableWriteError"
],
"errmsg"
:
"Replication is being shut down"
}
}
...
...
tests/SpecTests/transactions/transaction-options-repl.json
0 → 100644
View file @
fe4ff68d
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
}
],
"database_name"
:
"transaction-tests"
,
"collection_name"
:
"test"
,
"data"
:
[],
"tests"
:
[
{
"description"
:
"readConcern snapshot in startTransaction options"
,
"sessionOptions"
:
{
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"majority"
}
}
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
,
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"snapshot"
}
}
}
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"commitTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
,
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"snapshot"
}
}
}
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
2
}
},
"result"
:
{
"insertedId"
:
2
}
},
{
"name"
:
"abortTransaction"
,
"object"
:
"session0"
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"snapshot"
},
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"commitTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"readConcern"
:
null
,
"writeConcern"
:
null
},
"command_name"
:
"commitTransaction"
,
"database_name"
:
"admin"
}
},
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
2
}
],
"ordered"
:
true
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"2"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"snapshot"
,
"afterClusterTime"
:
42
},
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"abortTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"2"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"readConcern"
:
null
,
"writeConcern"
:
null
},
"command_name"
:
"abortTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
}
]
}
}
}
]
}
tests/SpecTests/transactions/transaction-options.json
View file @
fe4ff68d
...
...
@@ -322,7 +322,7 @@
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -393,7 +393,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
},
...
...
@@ -438,7 +438,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
,
"level"
:
"
majority
"
,
"afterClusterTime"
:
42
},
"writeConcern"
:
null
...
...
@@ -487,7 +487,7 @@
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"
majority
"
"level"
:
"
snapshot
"
},
"writeConcern"
:
{
"w"
:
1
...
...
@@ -503,7 +503,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
"majority"
...
...
@@ -535,7 +535,7 @@
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
"majority"
...
...
@@ -579,7 +579,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
,
"maxTimeMS"
:
null
...
...
@@ -625,7 +625,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
,
"level"
:
"
majority
"
,
"afterClusterTime"
:
42
},
"writeConcern"
:
null
,
...
...
@@ -676,7 +676,7 @@
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
{
"w"
:
"majority"
...
...
@@ -747,7 +747,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
"level"
:
"
majority
"
},
"writeConcern"
:
null
,
"maxTimeMS"
:
null
...
...
@@ -793,7 +793,7 @@
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"
snapshot
"
,
"level"
:
"
majority
"
,
"afterClusterTime"
:
42
},
"writeConcern"
:
null
,
...
...
@@ -993,172 +993,6 @@
}
}
},
{
"description"
:
"readConcern snapshot in startTransaction options"
,
"sessionOptions"
:
{
"session0"
:
{
"defaultTransactionOptions"
:
{
"readConcern"
:
{
"level"
:
"majority"
}
}
}
},
"operations"
:
[
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
,
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"snapshot"
}
}
}
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
1
}
},
"result"
:
{
"insertedId"
:
1
}
},
{
"name"
:
"commitTransaction"
,
"object"
:
"session0"
},
{
"name"
:
"startTransaction"
,
"object"
:
"session0"
,
"arguments"
:
{
"options"
:
{
"readConcern"
:
{
"level"
:
"snapshot"
}
}
}
},
{
"name"
:
"insertOne"
,
"object"
:
"collection"
,
"arguments"
:
{
"session"
:
"session0"
,
"document"
:
{
"_id"
:
2
}
},
"result"
:
{
"insertedId"
:
2
}
},
{
"name"
:
"abortTransaction"
,
"object"
:
"session0"
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
1
}
],
"ordered"
:
true
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"snapshot"
},
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"commitTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"1"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"readConcern"
:
null
,
"writeConcern"
:
null
},
"command_name"
:
"commitTransaction"
,
"database_name"
:
"admin"
}
},
{
"command_started_event"
:
{
"command"
:
{
"insert"
:
"test"
,
"documents"
:
[
{
"_id"
:
2
}
],
"ordered"
:
true
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"2"
},
"startTransaction"
:
true
,
"autocommit"
:
false
,
"readConcern"
:
{
"level"
:
"snapshot"
,
"afterClusterTime"
:
42
},
"writeConcern"
:
null
},
"command_name"
:
"insert"
,
"database_name"
:
"transaction-tests"
}
},
{
"command_started_event"
:
{
"command"
:
{
"abortTransaction"
:
1
,
"lsid"
:
"session0"
,
"txnNumber"
:
{
"$numberLong"
:
"2"
},
"startTransaction"
:
null
,
"autocommit"
:
false
,
"readConcern"
:
null
,
"writeConcern"
:
null
},
"command_name"
:
"abortTransaction"
,
"database_name"
:
"admin"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
}
]
}
}
},
{
"description"
:
"client writeConcern ignored for bulk"
,
"clientOptions"
:
{
...
...
tests/SpecTests/transactions/update.json
View file @
fe4ff68d
...
...
@@ -116,7 +116,6 @@
"x"
:
1
}
},
"multi"
:
false
,
"upsert"
:
true
}
],
...
...
@@ -145,9 +144,7 @@
},
"u"
:
{
"y"
:
1
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
@@ -179,8 +176,7 @@
"z"
:
1
}
},
"multi"
:
true
,
"upsert"
:
false
"multi"
:
true
}
],
"ordered"
:
true
,
...
...
@@ -346,7 +342,6 @@
"x"
:
1
}
},
"multi"
:
false
,
"upsert"
:
true
}
],
...
...
@@ -375,9 +370,7 @@
},
"u"
:
{
"y"
:
1
},
"multi"
:
false
,
"upsert"
:
false
}
}
],
"ordered"
:
true
,
...
...
@@ -409,8 +402,7 @@
"z"
:
1
}
},
"multi"
:
true
,
"upsert"
:
false
"multi"
:
true
}
],
"ordered"
:
true
,
...
...
tests/SpecTests/transactions/write-concern.json
View file @
fe4ff68d
...
...
@@ -877,7 +877,6 @@
"x"
:
1
}
},
"multi"
:
false
,
"upsert"
:
true
}
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment