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
d5ce656a
Commit
d5ce656a
authored
May 17, 2019
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #610
parents
d444ddea
37159231
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
4838 additions
and
0 deletions
+4838
-0
FunctionalTestCase.php
tests/SpecTests/FunctionalTestCase.php
+587
-0
RetryableWritesSpecTest.php
tests/SpecTests/RetryableWritesSpecTest.php
+65
-0
bulkWrite-serverErrors.json
tests/SpecTests/retryable-writes/bulkWrite-serverErrors.json
+191
-0
bulkWrite.json
tests/SpecTests/retryable-writes/bulkWrite.json
+806
-0
deleteMany.json
tests/SpecTests/retryable-writes/deleteMany.json
+41
-0
deleteOne-serverErrors.json
tests/SpecTests/retryable-writes/deleteOne-serverErrors.json
+103
-0
deleteOne.json
tests/SpecTests/retryable-writes/deleteOne.json
+120
-0
findOneAndDelete-serverErrors.json
...Tests/retryable-writes/findOneAndDelete-serverErrors.json
+115
-0
findOneAndDelete.json
tests/SpecTests/retryable-writes/findOneAndDelete.json
+137
-0
findOneAndReplace-serverErrors.json
...ests/retryable-writes/findOneAndReplace-serverErrors.json
+123
-0
findOneAndReplace.json
tests/SpecTests/retryable-writes/findOneAndReplace.json
+145
-0
findOneAndUpdate-serverErrors.json
...Tests/retryable-writes/findOneAndUpdate-serverErrors.json
+125
-0
findOneAndUpdate.json
tests/SpecTests/retryable-writes/findOneAndUpdate.json
+147
-0
insertMany-serverErrors.json
...s/SpecTests/retryable-writes/insertMany-serverErrors.json
+141
-0
insertMany.json
tests/SpecTests/retryable-writes/insertMany.json
+163
-0
insertOne-serverErrors.json
tests/SpecTests/retryable-writes/insertOne-serverErrors.json
+953
-0
insertOne.json
tests/SpecTests/retryable-writes/insertOne.json
+139
-0
replaceOne-serverErrors.json
...s/SpecTests/retryable-writes/replaceOne-serverErrors.json
+123
-0
replaceOne.json
tests/SpecTests/retryable-writes/replaceOne.json
+144
-0
updateMany.json
tests/SpecTests/retryable-writes/updateMany.json
+57
-0
updateOne-serverErrors.json
tests/SpecTests/retryable-writes/updateOne-serverErrors.json
+125
-0
updateOne.json
tests/SpecTests/retryable-writes/updateOne.json
+288
-0
No files found.
tests/SpecTests/FunctionalTestCase.php
0 → 100644
View file @
d5ce656a
This diff is collapsed.
Click to expand it.
tests/SpecTests/RetryableWritesSpecTest.php
0 → 100644
View file @
d5ce656a
<?php
namespace
MongoDB\Tests\SpecTests
;
/**
* Retryable writes spec tests.
*
* @see https://github.com/mongodb/specifications/tree/master/source/retryable-writes
*/
class
RetryableWritesSpecTest
extends
FunctionalTestCase
{
/**
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param array $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" document
* @param array $data Top-level "data" array to initialize collection
*/
public
function
testRetryableWrites
(
$name
,
array
$test
,
array
$runOn
=
null
,
array
$data
)
{
$this
->
setName
(
$name
);
if
(
isset
(
$runOn
))
{
$this
->
checkServerRequirements
(
$runOn
);
}
// TODO: Remove this once retryWrites=true by default (see: PHPC-1324)
$test
[
'clientOptions'
][
'retryWrites'
]
=
true
;
$this
->
initTestSubjects
(
$test
);
$this
->
initOutcomeCollection
(
$test
);
$this
->
initDataFixtures
(
$data
);
if
(
isset
(
$test
[
'failPoint'
]))
{
$this
->
configureFailPoint
(
$test
[
'failPoint'
]);
}
$this
->
assertOperation
(
$test
[
'operation'
],
$test
[
'outcome'
]);
if
(
isset
(
$test
[
'outcome'
][
'collection'
][
'data'
]))
{
$this
->
assertOutcomeCollectionData
(
$test
[
'outcome'
][
'collection'
][
'data'
]);
}
}
public
function
provideTests
()
{
$testArgs
=
[];
foreach
(
glob
(
__DIR__
.
'/retryable-writes/*.json'
)
as
$filename
)
{
$json
=
json_decode
(
file_get_contents
(
$filename
),
true
);
$group
=
basename
(
$filename
,
'.json'
);
$runOn
=
isset
(
$json
[
'runOn'
])
?
$json
[
'runOn'
]
:
null
;
$data
=
isset
(
$json
[
'data'
])
?
$json
[
'data'
]
:
[];
foreach
(
$json
[
'tests'
]
as
$test
)
{
$name
=
$group
.
': '
.
$test
[
'description'
];
$testArgs
[]
=
[
$name
,
$test
,
$runOn
,
$data
];
}
}
return
$testArgs
;
}
}
tests/SpecTests/retryable-writes/bulkWrite-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"BulkWrite succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/bulkWrite.json
0 → 100644
View file @
d5ce656a
This diff is collapsed.
Click to expand it.
tests/SpecTests/retryable-writes/deleteMany.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"DeleteMany ignores retryWrites"
,
"useMultipleMongoses"
:
true
,
"operation"
:
{
"name"
:
"deleteMany"
,
"arguments"
:
{
"filter"
:
{}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
2
},
"collection"
:
{
"data"
:
[]
}
}
}
]
}
tests/SpecTests/retryable-writes/deleteOne-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"DeleteOne succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"delete"
],
"errorCode"
:
189
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"DeleteOne succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"delete"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/deleteOne.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"DeleteOne is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"DeleteOne is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"deletedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"DeleteOne is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"deleteOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndDelete-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndDelete succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"operation"
:
{
"name"
:
"findOneAndDelete"
,
"arguments"
:
{
"filter"
:
{
"x"
:
{
"$gte"
:
11
}
},
"sort"
:
{
"x"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"_id"
:
1
,
"x"
:
11
},
"collection"
:
{
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndDelete.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndDelete is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"findOneAndDelete"
,
"arguments"
:
{
"filter"
:
{
"x"
:
{
"$gte"
:
11
}
},
"sort"
:
{
"x"
:
1
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndReplace-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndReplace succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndReplace.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndReplace is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
},
"returnDocument"
:
"Before"
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndUpdate-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndUpdate succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"findAndModify"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/findOneAndUpdate.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"FindOneAndUpdate is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"findOneAndUpdate"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertMany-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
],
"tests"
:
[
{
"description"
:
"InsertMany succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"insert"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertMany.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
],
"tests"
:
[
{
"description"
:
"InsertMany succeeds after one network error"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 with unordered execution"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"operation"
:
{
"name"
:
"insertMany"
,
"arguments"
:
{
"documents"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"options"
:
{
"ordered"
:
false
}
}
},
"outcome"
:
{
"result"
:
{
"insertedIds"
:
{
"0"
:
2
,
"1"
:
3
}
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"InsertMany fails after multiple network errors"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
"alwaysOn"
,
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"insertMany"
,
"arguments"
:
{
"documents"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
44
}
],
"options"
:
{
"ordered"
:
true
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/insertOne-serverErrors.json
0 → 100644
View file @
d5ce656a
This diff is collapsed.
Click to expand it.
tests/SpecTests/retryable-writes/insertOne.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"InsertOne is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"insertOne"
,
"arguments"
:
{
"document"
:
{
"_id"
:
3
,
"x"
:
33
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/replaceOne-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"ReplaceOne succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/replaceOne.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"ReplaceOne is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/updateMany.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
,
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"UpdateMany ignores retryWrites"
,
"useMultipleMongoses"
:
true
,
"operation"
:
{
"name"
:
"updateMany"
,
"arguments"
:
{
"filter"
:
{},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
2
,
"modifiedCount"
:
2
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
12
},
{
"_id"
:
2
,
"x"
:
23
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/updateOne-serverErrors.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"4.0"
,
"topology"
:
[
"replicaset"
]
},
{
"minServerVersion"
:
"4.1.7"
,
"topology"
:
[
"sharded"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"UpdateOne succeeds after PrimarySteppedDown"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"errorCode"
:
189
}
},
"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 succeeds after WriteConcernError ShutdownInProgress"
,
"failPoint"
:
{
"configureFailPoint"
:
"failCommand"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failCommands"
:
[
"update"
],
"writeConcernError"
:
{
"code"
:
91
,
"errmsg"
:
"Replication is being shut down"
}
}
},
"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
}
]
}
}
}
]
}
tests/SpecTests/retryable-writes/updateOne.json
0 → 100644
View file @
d5ce656a
{
"runOn"
:
[
{
"minServerVersion"
:
"3.6"
,
"topology"
:
[
"replicaset"
]
}
],
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
],
"tests"
:
[
{
"description"
:
"UpdateOne is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"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 is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"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 is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
},
{
"description"
:
"UpdateOne with upsert is committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
,
"x"
:
33
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
0
,
"modifiedCount"
:
0
,
"upsertedCount"
:
1
,
"upsertedId"
:
3
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
34
}
]
}
}
},
{
"description"
:
"UpdateOne with upsert is not committed on first attempt"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
1
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
,
"x"
:
33
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
0
,
"modifiedCount"
:
0
,
"upsertedCount"
:
1
,
"upsertedId"
:
3
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
34
}
]
}
}
},
{
"description"
:
"UpdateOne with upsert is never committed"
,
"failPoint"
:
{
"configureFailPoint"
:
"onPrimaryTransactionalWrite"
,
"mode"
:
{
"times"
:
2
},
"data"
:
{
"failBeforeCommitExceptionCode"
:
1
}
},
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
,
"x"
:
33
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"upsert"
:
true
}
},
"outcome"
:
{
"error"
:
true
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
}
]
}
}
}
]
}
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