PYTHON-4117 Require 4.3.1+ server version when using failCommand errorLabels option (#1526)
This commit is contained in:
parent
5b5a7e640b
commit
0793138d7f
@ -254,6 +254,8 @@ def _get_wce_doc(result: Mapping[str, Any]) -> Optional[Mapping[str, Any]]:
|
||||
# convenient to attach it to the writeConcernError doc itself.
|
||||
error_labels = result.get("errorLabels")
|
||||
if error_labels:
|
||||
# Copy to avoid changing the original document.
|
||||
wce = wce.copy()
|
||||
wce["errorLabels"] = error_labels
|
||||
return wce
|
||||
|
||||
|
||||
@ -83,6 +83,7 @@ from pymongo.errors import (
|
||||
PyMongoError,
|
||||
ServerSelectionTimeoutError,
|
||||
WaitQueueTimeoutError,
|
||||
WriteConcernError,
|
||||
)
|
||||
from pymongo.lock import _HAS_REGISTER_AT_FORK, _create_lock, _release_locks
|
||||
from pymongo.monitoring import ConnectionClosedReason
|
||||
@ -2175,7 +2176,7 @@ def _retryable_error_doc(exc: PyMongoError) -> Optional[Mapping[str, Any]]:
|
||||
return None
|
||||
|
||||
|
||||
def _add_retryable_write_error(exc: PyMongoError, max_wire_version: int) -> None:
|
||||
def _add_retryable_write_error(exc: PyMongoError, max_wire_version: int, is_mongos: bool) -> None:
|
||||
doc = _retryable_error_doc(exc)
|
||||
if doc:
|
||||
code = doc.get("code", 0)
|
||||
@ -2192,7 +2193,10 @@ def _add_retryable_write_error(exc: PyMongoError, max_wire_version: int) -> None
|
||||
for label in doc.get("errorLabels", []):
|
||||
exc._add_error_label(label)
|
||||
else:
|
||||
if code in helpers._RETRYABLE_ERROR_CODES:
|
||||
# Do not consult writeConcernError for pre-4.4 mongos.
|
||||
if isinstance(exc, WriteConcernError) and is_mongos:
|
||||
pass
|
||||
elif code in helpers._RETRYABLE_ERROR_CODES:
|
||||
exc._add_error_label("RetryableWriteError")
|
||||
|
||||
# Connection errors are always retryable except NotPrimaryError and WaitQueueTimeoutError which is
|
||||
@ -2432,6 +2436,7 @@ class _ClientConnectionRetryable(Generic[T]):
|
||||
"""
|
||||
try:
|
||||
max_wire_version = 0
|
||||
is_mongos = False
|
||||
self._server = self._get_server()
|
||||
with self._client._checkout(self._server, self._session) as conn:
|
||||
max_wire_version = conn.max_wire_version
|
||||
@ -2440,6 +2445,7 @@ class _ClientConnectionRetryable(Generic[T]):
|
||||
and self._server.description.retryable_writes_supported
|
||||
and conn.supports_sessions
|
||||
)
|
||||
is_mongos = conn.is_mongos
|
||||
if not sessions_supported:
|
||||
# A retry is not possible because this server does
|
||||
# not support sessions raise the last error.
|
||||
@ -2450,7 +2456,7 @@ class _ClientConnectionRetryable(Generic[T]):
|
||||
if not self._retryable:
|
||||
raise
|
||||
# Add the RetryableWriteError label, if applicable.
|
||||
_add_retryable_write_error(exc, max_wire_version)
|
||||
_add_retryable_write_error(exc, max_wire_version, is_mongos)
|
||||
raise
|
||||
|
||||
def _read(self) -> T:
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"schemaVersion": "1.4",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.1.0",
|
||||
"minServerVersion": "4.3.1",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
],
|
||||
@ -66,11 +66,11 @@
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
"code": 91
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,11 +112,11 @@
|
||||
"reply": {
|
||||
"ok": 1,
|
||||
"n": 1,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
"code": 91
|
||||
}
|
||||
},
|
||||
"commandName": "insert"
|
||||
@ -152,4 +152,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -11,8 +11,7 @@
|
||||
{
|
||||
"minServerVersion": "4.2",
|
||||
"topologies": [
|
||||
"replicaset",
|
||||
"sharded-replicaset"
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -109,6 +108,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - insertOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -199,6 +203,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - insertOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -328,6 +337,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - insertMany on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -420,6 +434,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - insertMany on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -547,6 +566,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - deleteOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -635,6 +659,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - deleteOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -761,6 +790,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - replaceOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -852,6 +886,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - replaceOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -983,6 +1022,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - updateOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1076,6 +1120,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - updateOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1204,6 +1253,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - findOneAndDelete on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1292,6 +1346,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - findOneAndDelete on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1418,6 +1477,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - findOneAndReplace on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1509,6 +1573,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - findOneAndReplace on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1640,6 +1709,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - findOneAndUpdate on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1733,6 +1807,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - findOneAndUpdate on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1869,6 +1948,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - bulkWrite on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -1965,6 +2049,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - bulkWrite on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2096,6 +2185,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - listDatabases on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2184,6 +2278,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - listDatabases on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2304,6 +2403,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - listDatabaseNames on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2391,6 +2495,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - listDatabaseNames on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2513,6 +2622,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2601,6 +2715,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on client",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2731,6 +2850,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - aggregate on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2826,6 +2950,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - aggregate on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -2956,6 +3085,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - listCollections on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3044,6 +3178,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - listCollections on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3167,6 +3306,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - listCollectionNames on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3255,6 +3399,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - listCollectionNames on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3378,6 +3527,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3466,6 +3620,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on database",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3589,6 +3748,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - aggregate on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3677,6 +3841,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - aggregate on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3800,6 +3969,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - count on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -3888,6 +4062,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - count on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4011,6 +4190,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - countDocuments on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4099,6 +4283,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - countDocuments on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4219,6 +4408,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - estimatedDocumentCount on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4306,6 +4500,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - estimatedDocumentCount on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4429,6 +4628,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - distinct on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4518,6 +4722,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - distinct on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4642,6 +4851,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - find on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4730,6 +4944,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - find on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4853,6 +5072,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - findOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -4941,6 +5165,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - findOne on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -5061,6 +5290,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - listIndexes on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -5148,6 +5382,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - listIndexes on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -5270,6 +5509,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -5358,6 +5602,11 @@
|
||||
},
|
||||
{
|
||||
"description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on collection",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
|
||||
@ -178,6 +178,175 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "BulkWrite succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,175 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "BulkWrite succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "BulkWrite fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -102,6 +102,87 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "DeleteOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"delete"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,87 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "DeleteOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"delete"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
},
|
||||
"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"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "DeleteOne fails with RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -113,6 +113,99 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndDelete succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,99 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "FindOneAndDelete succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndDelete fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -117,6 +117,107 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndReplace succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,107 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "FindOneAndReplace succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndReplace fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -119,6 +119,109 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndUpdate succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,109 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "FindOneAndUpdate succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"findAndModify"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndUpdate fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -125,6 +125,129 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertMany succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -21,129 +21,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "InsertMany succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertMany fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -86,6 +86,716 @@
|
||||
"data": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after NotWritablePrimary",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 10107,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after NotPrimaryOrSecondary",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 13436,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after NotPrimaryNoSecondaryOk",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 13435,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after InterruptedDueToReplStateChange",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 11602,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after InterruptedAtShutdown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 11600,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 91,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after HostNotFound",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 7,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after HostUnreachable",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 6,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after SocketException",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 9001,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after NetworkTimeout",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 89,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after ExceededTimeLimit",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 262,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after WriteConcernError InterruptedAtShutdown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 11600,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 11602,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after WriteConcernError PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 189,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne fails after multiple retryable writeConcernErrors",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"name": "insertOne",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"outcome": {
|
||||
"error": true,
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
},
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -117,594 +117,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after NotWritablePrimary",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 10107,
|
||||
"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 NotPrimaryOrSecondary",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 13436,
|
||||
"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 NotPrimaryNoSecondaryOk",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 13435,
|
||||
"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 InterruptedDueToReplStateChange",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 11602,
|
||||
"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 InterruptedAtShutdown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 11600,
|
||||
"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 PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 91,
|
||||
"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 HostNotFound",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 7,
|
||||
"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 HostUnreachable",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 6,
|
||||
"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 SocketException",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 9001,
|
||||
"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 NetworkTimeout",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"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
|
||||
}
|
||||
},
|
||||
"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 fails after Interrupted",
|
||||
"failPoint": {
|
||||
@ -750,264 +162,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne succeeds after WriteConcernError InterruptedAtShutdown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 11600,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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 WriteConcernError InterruptedDueToReplStateChange",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 11602,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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 WriteConcernError PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 189,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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 WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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 fails after multiple retryable writeConcernErrors",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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
|
||||
},
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "InsertOne fails after WriteConcernError Interrupted",
|
||||
"failPoint": {
|
||||
|
||||
@ -116,6 +116,107 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "ReplaceOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,107 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "ReplaceOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "ReplaceOne fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -118,6 +118,109 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "UpdateOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,109 +25,6 @@
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "UpdateOne succeeds after PrimarySteppedDown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorCode": 189,
|
||||
"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 succeeds after WriteConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"update"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "UpdateOne fails with a RetryableWriteError label after two connection failures",
|
||||
"failPoint": {
|
||||
|
||||
@ -3,10 +3,16 @@
|
||||
"schemaVersion": "1.0",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"minServerVersion": "4.0",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
"createEntities": [
|
||||
@ -55,16 +61,7 @@
|
||||
"description": "BulkWrite succeeds after retryable writeConcernError in first batch",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded-replicaset"
|
||||
]
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
|
||||
@ -3,10 +3,16 @@
|
||||
"schemaVersion": "1.0",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"minServerVersion": "4.0",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
"createEntities": [
|
||||
@ -55,16 +61,7 @@
|
||||
"description": "InsertOne succeeds after retryable writeConcernError",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded-replicaset"
|
||||
]
|
||||
"minServerVersion": "4.3.1"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
@ -168,6 +165,309 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "RetryableWriteError label is added based on top-level code in pre-4.4 server response",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.2",
|
||||
"maxServerVersion": "4.2.99",
|
||||
"topologies": [
|
||||
"replicaset",
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
"object": "testRunner",
|
||||
"arguments": {
|
||||
"client": "client0",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorCode": 189
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection0",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
},
|
||||
"expectError": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"expectEvents": [
|
||||
{
|
||||
"client": "client0",
|
||||
"events": [
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"command": {
|
||||
"insert": "coll",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "retryable-writes-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"command": {
|
||||
"insert": "coll",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "retryable-writes-tests"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outcome": [
|
||||
{
|
||||
"collectionName": "coll",
|
||||
"databaseName": "retryable-writes-tests",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"x": 22
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "RetryableWriteError label is added based on writeConcernError in pre-4.4 mongod response",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.2",
|
||||
"maxServerVersion": "4.2.99",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
"object": "testRunner",
|
||||
"arguments": {
|
||||
"client": "client0",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection0",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
},
|
||||
"expectError": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"expectEvents": [
|
||||
{
|
||||
"client": "client0",
|
||||
"events": [
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"command": {
|
||||
"insert": "coll",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "retryable-writes-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"command": {
|
||||
"insert": "coll",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "retryable-writes-tests"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outcome": [
|
||||
{
|
||||
"collectionName": "coll",
|
||||
"databaseName": "retryable-writes-tests",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"x": 22
|
||||
},
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "RetryableWriteError label is not added based on writeConcernError in pre-4.4 mongos response",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.2",
|
||||
"maxServerVersion": "4.2.99",
|
||||
"topologies": [
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
"object": "testRunner",
|
||||
"arguments": {
|
||||
"client": "client0",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection0",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
},
|
||||
"expectError": {
|
||||
"errorLabelsOmit": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"expectEvents": [
|
||||
{
|
||||
"client": "client0",
|
||||
"events": [
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"command": {
|
||||
"insert": "coll",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "retryable-writes-tests"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outcome": [
|
||||
{
|
||||
"collectionName": "coll",
|
||||
"databaseName": "retryable-writes-tests",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"x": 22
|
||||
},
|
||||
{
|
||||
"_id": 3,
|
||||
"x": 33
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
151
test/transactions-convenient-api/commit-retry-errorLabels.json
Normal file
151
test/transactions-convenient-api/commit-retry-errorLabels.json
Normal file
@ -0,0 +1,151 @@
|
||||
{
|
||||
"runOn": [
|
||||
{
|
||||
"minServerVersion": "4.3.1",
|
||||
"topology": [
|
||||
"replicaset",
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
"database_name": "withTransaction-tests",
|
||||
"collection_name": "test",
|
||||
"data": [],
|
||||
"tests": [
|
||||
{
|
||||
"description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotWritablePrimary)",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 10107,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "withTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"callback": {
|
||||
"operations": [
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"expectations": [
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"insert": "test",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
],
|
||||
"ordered": true,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"startTransaction": true,
|
||||
"autocommit": false,
|
||||
"readConcern": null,
|
||||
"writeConcern": null
|
||||
},
|
||||
"command_name": "insert",
|
||||
"database_name": "withTransaction-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"readConcern": null,
|
||||
"startTransaction": null,
|
||||
"writeConcern": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"wtimeout": 10000
|
||||
},
|
||||
"readConcern": null,
|
||||
"startTransaction": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"wtimeout": 10000
|
||||
},
|
||||
"readConcern": null,
|
||||
"startTransaction": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcome": {
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -292,141 +292,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotWritablePrimary)",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 10107,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "withTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"callback": {
|
||||
"operations": [
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"expectations": [
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"insert": "test",
|
||||
"documents": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
],
|
||||
"ordered": true,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"startTransaction": true,
|
||||
"autocommit": false,
|
||||
"readConcern": null,
|
||||
"writeConcern": null
|
||||
},
|
||||
"command_name": "insert",
|
||||
"database_name": "withTransaction-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"readConcern": null,
|
||||
"startTransaction": null,
|
||||
"writeConcern": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"wtimeout": 10000
|
||||
},
|
||||
"readConcern": null,
|
||||
"startTransaction": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"wtimeout": 10000
|
||||
},
|
||||
"readConcern": null,
|
||||
"startTransaction": null
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcome": {
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commit is not retried after MaxTimeMSExpired error",
|
||||
"failPoint": {
|
||||
|
||||
314
test/transactions/legacy/error-labels-errorLabels.json
Normal file
314
test/transactions/legacy/error-labels-errorLabels.json
Normal file
@ -0,0 +1,314 @@
|
||||
{
|
||||
"runOn": [
|
||||
{
|
||||
"minServerVersion": "4.3.1",
|
||||
"topology": [
|
||||
"replicaset",
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"database_name": "transaction-tests",
|
||||
"collection_name": "test",
|
||||
"data": [],
|
||||
"tests": [
|
||||
{
|
||||
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 11602,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0"
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"options": {
|
||||
"writeConcern": {
|
||||
"w": "majority"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"w": "majority"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -9,7 +9,8 @@
|
||||
{
|
||||
"minServerVersion": "4.1.8",
|
||||
"topology": [
|
||||
"sharded"
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
@ -810,302 +811,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 11602,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
]
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0"
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"options": {
|
||||
"writeConcern": {
|
||||
"w": "majority"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"w": "majority"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "do not add RetryableWriteError label to writeConcernError ShutdownInProgress that occurs within transaction",
|
||||
"failPoint": {
|
||||
|
||||
149
test/transactions/legacy/mongos-recovery-token-errorLabels.json
Normal file
149
test/transactions/legacy/mongos-recovery-token-errorLabels.json
Normal file
@ -0,0 +1,149 @@
|
||||
{
|
||||
"runOn": [
|
||||
{
|
||||
"minServerVersion": "4.3.1",
|
||||
"topology": [
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"database_name": "transaction-tests",
|
||||
"collection_name": "test",
|
||||
"data": [],
|
||||
"tests": [
|
||||
{
|
||||
"description": "commitTransaction retry succeeds on new mongos",
|
||||
"useMultipleMongoses": true,
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"options": {
|
||||
"writeConcern": {
|
||||
"w": "majority"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "targetedFailPoint",
|
||||
"object": "testRunner",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"w": "majority"
|
||||
},
|
||||
"recoveryToken": 42
|
||||
},
|
||||
"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
|
||||
},
|
||||
"recoveryToken": 42
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcome": {
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -3,7 +3,8 @@
|
||||
{
|
||||
"minServerVersion": "4.1.8",
|
||||
"topology": [
|
||||
"sharded"
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
@ -138,138 +139,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction retry succeeds on new mongos",
|
||||
"useMultipleMongoses": true,
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"options": {
|
||||
"writeConcern": {
|
||||
"w": "majority"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "targetedFailPoint",
|
||||
"object": "testRunner",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"w": "majority"
|
||||
},
|
||||
"recoveryToken": 42
|
||||
},
|
||||
"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
|
||||
},
|
||||
"recoveryToken": 42
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcome": {
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction retry fails on new mongos",
|
||||
"useMultipleMongoses": true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,240 @@
|
||||
{
|
||||
"runOn": [
|
||||
{
|
||||
"minServerVersion": "4.3.1",
|
||||
"topology": [
|
||||
"replicaset",
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"database_name": "transaction-tests",
|
||||
"collection_name": "test",
|
||||
"data": [],
|
||||
"tests": [
|
||||
{
|
||||
"description": "commitTransaction succeeds after InterruptedAtShutdown",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 11600,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction succeeds after ShutdownInProgress",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"errorCode": 91,
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"closeConnection": false
|
||||
}
|
||||
},
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
429
test/transactions/legacy/retryable-commit-forbid_serverless.json
Normal file
429
test/transactions/legacy/retryable-commit-forbid_serverless.json
Normal file
@ -0,0 +1,429 @@
|
||||
{
|
||||
"runOn": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
"topology": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.8",
|
||||
"topology": [
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
],
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"database_name": "transaction-tests",
|
||||
"collection_name": "test",
|
||||
"data": [],
|
||||
"tests": [
|
||||
{
|
||||
"description": "commitTransaction fails after two errors",
|
||||
"clientOptions": {
|
||||
"retryWrites": false
|
||||
},
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"closeConnection": true
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0"
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction applies majority write concern on retries",
|
||||
"clientOptions": {
|
||||
"retryWrites": false
|
||||
},
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 2
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"closeConnection": true
|
||||
}
|
||||
},
|
||||
"operations": [
|
||||
{
|
||||
"name": "startTransaction",
|
||||
"object": "session0",
|
||||
"arguments": {
|
||||
"options": {
|
||||
"writeConcern": {
|
||||
"w": 2,
|
||||
"j": true,
|
||||
"wtimeout": 5000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"session": "session0",
|
||||
"document": {
|
||||
"_id": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"insertedId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "commitTransaction",
|
||||
"object": "session0",
|
||||
"result": {
|
||||
"errorLabelsContain": [
|
||||
"RetryableWriteError",
|
||||
"UnknownTransactionCommitResult"
|
||||
],
|
||||
"errorLabelsOmit": [
|
||||
"TransientTransactionError"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"w": 2,
|
||||
"j": true,
|
||||
"wtimeout": 5000
|
||||
}
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"startTransaction": null,
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"j": true,
|
||||
"wtimeout": 5000
|
||||
}
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command_started_event": {
|
||||
"command": {
|
||||
"commitTransaction": 1,
|
||||
"lsid": "session0",
|
||||
"txnNumber": {
|
||||
"$numberLong": "1"
|
||||
},
|
||||
"startTransaction": null,
|
||||
"autocommit": false,
|
||||
"writeConcern": {
|
||||
"w": "majority",
|
||||
"j": true,
|
||||
"wtimeout": 5000
|
||||
}
|
||||
},
|
||||
"command_name": "commitTransaction",
|
||||
"database_name": "admin"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outcome": {
|
||||
"collection": {
|
||||
"data": [
|
||||
{
|
||||
"_id": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction succeeds after connection error",
|
||||
"failPoint": {
|
||||
"configureFailPoint": "failCommand",
|
||||
"mode": {
|
||||
"times": 1
|
||||
},
|
||||
"data": {
|
||||
"failCommands": [
|
||||
"commitTransaction"
|
||||
],
|
||||
"closeConnection": true
|
||||
}
|
||||
},
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,8 @@
|
||||
{
|
||||
"minServerVersion": "4.1.8",
|
||||
"topology": [
|
||||
"sharded"
|
||||
"sharded",
|
||||
"load-balanced"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -1,14 +1,6 @@
|
||||
{
|
||||
"description": "poc-retryable-writes",
|
||||
"schemaVersion": "1.0",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
}
|
||||
],
|
||||
"createEntities": [
|
||||
{
|
||||
"client": {
|
||||
@ -79,6 +71,14 @@
|
||||
"tests": [
|
||||
{
|
||||
"description": "FindOneAndUpdate is committed on first attempt",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -132,6 +132,14 @@
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndUpdate is not committed on first attempt",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -188,6 +196,14 @@
|
||||
},
|
||||
{
|
||||
"description": "FindOneAndUpdate is never committed",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "3.6",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -245,15 +261,10 @@
|
||||
"description": "InsertMany succeeds after PrimarySteppedDown",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
"minServerVersion": "4.3.1",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded-replicaset"
|
||||
"replicaset",
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -345,7 +356,7 @@
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded-replicaset"
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -406,15 +417,10 @@
|
||||
"description": "InsertOne fails after multiple retryable writeConcernErrors",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
"minServerVersion": "4.3.1",
|
||||
"topologies": [
|
||||
"replicaset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minServerVersion": "4.1.7",
|
||||
"topologies": [
|
||||
"sharded-replicaset"
|
||||
"replicaset",
|
||||
"sharded"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -433,6 +439,9 @@
|
||||
"failCommands": [
|
||||
"insert"
|
||||
],
|
||||
"errorLabels": [
|
||||
"RetryableWriteError"
|
||||
],
|
||||
"writeConcernError": {
|
||||
"code": 91,
|
||||
"errmsg": "Replication is being shut down"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user