PYTHON-3712 Deprecate sharded-replicaset topology type and clean up redundant runOnRequirements (#2232)
This commit is contained in:
parent
2149567ed3
commit
4e5166b29a
@ -678,7 +678,6 @@ class ClientContext:
|
|||||||
"single",
|
"single",
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded",
|
"sharded",
|
||||||
"sharded-replicaset",
|
|
||||||
"load-balanced",
|
"load-balanced",
|
||||||
}
|
}
|
||||||
if unknown:
|
if unknown:
|
||||||
@ -693,16 +692,6 @@ class ClientContext:
|
|||||||
return True
|
return True
|
||||||
if "sharded" in topologies and self.is_mongos:
|
if "sharded" in topologies and self.is_mongos:
|
||||||
return True
|
return True
|
||||||
if "sharded-replicaset" in topologies and self.is_mongos:
|
|
||||||
shards = client_context.client.config.shards.find().to_list()
|
|
||||||
for shard in shards:
|
|
||||||
# For a 3-member RS-backed sharded cluster, shard['host']
|
|
||||||
# will be 'replicaName/ip1:port1,ip2:port2,ip3:port3'
|
|
||||||
# Otherwise it will be 'ip1:port1'
|
|
||||||
host_spec = shard["host"]
|
|
||||||
if not len(host_spec.split("/")) > 1:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def require_cluster_type(self, topologies=None):
|
def require_cluster_type(self, topologies=None):
|
||||||
|
|||||||
@ -680,7 +680,6 @@ class AsyncClientContext:
|
|||||||
"single",
|
"single",
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded",
|
"sharded",
|
||||||
"sharded-replicaset",
|
|
||||||
"load-balanced",
|
"load-balanced",
|
||||||
}
|
}
|
||||||
if unknown:
|
if unknown:
|
||||||
@ -695,16 +694,6 @@ class AsyncClientContext:
|
|||||||
return True
|
return True
|
||||||
if "sharded" in topologies and self.is_mongos:
|
if "sharded" in topologies and self.is_mongos:
|
||||||
return True
|
return True
|
||||||
if "sharded-replicaset" in topologies and self.is_mongos:
|
|
||||||
shards = await async_client_context.client.config.shards.find().to_list()
|
|
||||||
for shard in shards:
|
|
||||||
# For a 3-member RS-backed sharded cluster, shard['host']
|
|
||||||
# will be 'replicaName/ip1:port1,ip2:port2,ip3:port3'
|
|
||||||
# Otherwise it will be 'ip1:port1'
|
|
||||||
host_spec = shard["host"]
|
|
||||||
if not len(host_spec.split("/")) > 1:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def require_cluster_type(self, topologies=None):
|
def require_cluster_type(self, topologies=None):
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
"minServerVersion": "4.0.0",
|
"minServerVersion": "4.0.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
|
||||||
"load-balanced",
|
"load-balanced",
|
||||||
"sharded"
|
"sharded"
|
||||||
],
|
],
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
"minServerVersion": "6.1.0",
|
"minServerVersion": "6.1.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
|
||||||
"load-balanced",
|
"load-balanced",
|
||||||
"sharded"
|
"sharded"
|
||||||
],
|
],
|
||||||
|
|||||||
@ -145,7 +145,7 @@
|
|||||||
"minServerVersion": "4.1.11",
|
"minServerVersion": "4.1.11",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@
|
|||||||
"minServerVersion": "4.2",
|
"minServerVersion": "4.2",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "6.0.0",
|
"minServerVersion": "6.0.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
],
|
],
|
||||||
"serverless": "forbid"
|
"serverless": "forbid"
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "3.6",
|
"minServerVersion": "3.6",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
],
|
],
|
||||||
"serverless": "forbid"
|
"serverless": "forbid"
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "4.3.1",
|
"minServerVersion": "4.3.1",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
],
|
],
|
||||||
"serverless": "forbid"
|
"serverless": "forbid"
|
||||||
|
|||||||
@ -6,9 +6,9 @@
|
|||||||
"minServerVersion": "6.0.0",
|
"minServerVersion": "6.0.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
|
||||||
"sharded"
|
"sharded"
|
||||||
]
|
],
|
||||||
|
"serverless": "forbid"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"createEntities": [
|
"createEntities": [
|
||||||
@ -462,7 +462,6 @@
|
|||||||
"runOnRequirements": [
|
"runOnRequirements": [
|
||||||
{
|
{
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"sharded-replicaset",
|
|
||||||
"sharded"
|
"sharded"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
"schemaVersion": "1.9",
|
"schemaVersion": "1.9",
|
||||||
"runOnRequirements": [
|
"runOnRequirements": [
|
||||||
{
|
{
|
||||||
"minServerVersion": "4.4"
|
"minServerVersion": "4.4",
|
||||||
|
"serverless": "forbid"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"createEntities": [
|
"createEntities": [
|
||||||
@ -417,6 +418,141 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "apply remaining timeoutMS if less than maxAwaitTimeMS",
|
||||||
|
"operations": [
|
||||||
|
{
|
||||||
|
"name": "failPoint",
|
||||||
|
"object": "testRunner",
|
||||||
|
"arguments": {
|
||||||
|
"client": "failPointClient",
|
||||||
|
"failPoint": {
|
||||||
|
"configureFailPoint": "failCommand",
|
||||||
|
"mode": {
|
||||||
|
"times": 1
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"failCommands": [
|
||||||
|
"getMore"
|
||||||
|
],
|
||||||
|
"blockConnection": true,
|
||||||
|
"blockTimeMS": 30
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "createFindCursor",
|
||||||
|
"object": "collection",
|
||||||
|
"arguments": {
|
||||||
|
"filter": {
|
||||||
|
"_id": 1
|
||||||
|
},
|
||||||
|
"cursorType": "tailableAwait",
|
||||||
|
"batchSize": 1,
|
||||||
|
"maxAwaitTimeMS": 100,
|
||||||
|
"timeoutMS": 200
|
||||||
|
},
|
||||||
|
"saveResultAsEntity": "tailableCursor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "iterateOnce",
|
||||||
|
"object": "tailableCursor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "iterateUntilDocumentOrError",
|
||||||
|
"object": "tailableCursor",
|
||||||
|
"expectError": {
|
||||||
|
"isTimeoutError": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"expectEvents": [
|
||||||
|
{
|
||||||
|
"client": "client",
|
||||||
|
"ignoreExtraEvents": true,
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"commandStartedEvent": {
|
||||||
|
"commandName": "find",
|
||||||
|
"databaseName": "test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandStartedEvent": {
|
||||||
|
"commandName": "getMore",
|
||||||
|
"databaseName": "test",
|
||||||
|
"command": {
|
||||||
|
"maxTimeMS": {
|
||||||
|
"$$lte": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandStartedEvent": {
|
||||||
|
"commandName": "getMore",
|
||||||
|
"databaseName": "test",
|
||||||
|
"command": {
|
||||||
|
"maxTimeMS": {
|
||||||
|
"$$lte": 70
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "apply maxAwaitTimeMS if less than remaining timeout",
|
||||||
|
"operations": [
|
||||||
|
{
|
||||||
|
"name": "createFindCursor",
|
||||||
|
"object": "collection",
|
||||||
|
"arguments": {
|
||||||
|
"filter": {},
|
||||||
|
"cursorType": "tailableAwait",
|
||||||
|
"batchSize": 1,
|
||||||
|
"maxAwaitTimeMS": 100,
|
||||||
|
"timeoutMS": 200
|
||||||
|
},
|
||||||
|
"saveResultAsEntity": "tailableCursor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "iterateOnce",
|
||||||
|
"object": "tailableCursor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "iterateOnce",
|
||||||
|
"object": "tailableCursor"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"expectEvents": [
|
||||||
|
{
|
||||||
|
"client": "client",
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"commandStartedEvent": {
|
||||||
|
"commandName": "find",
|
||||||
|
"databaseName": "test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandStartedEvent": {
|
||||||
|
"commandName": "getMore",
|
||||||
|
"databaseName": "test",
|
||||||
|
"command": {
|
||||||
|
"maxTimeMS": {
|
||||||
|
"$$lte": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,8 +5,7 @@
|
|||||||
{
|
{
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"single",
|
"single",
|
||||||
"sharded",
|
"sharded"
|
||||||
"sharded-replicaset"
|
|
||||||
],
|
],
|
||||||
"serverless": "forbid"
|
"serverless": "forbid"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,6 @@
|
|||||||
{
|
{
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
|
||||||
"load-balanced",
|
"load-balanced",
|
||||||
"sharded"
|
"sharded"
|
||||||
]
|
]
|
||||||
@ -493,7 +492,7 @@
|
|||||||
{
|
{
|
||||||
"minServerVersion": "4.2",
|
"minServerVersion": "4.2",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
{
|
{
|
||||||
"minServerVersion": "4.1.8",
|
"minServerVersion": "4.1.8",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"sharded-replicaset"
|
"sharded"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "5.0",
|
"minServerVersion": "5.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset"
|
"sharded"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "5.0",
|
"minServerVersion": "5.0",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset"
|
"sharded"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -42,7 +42,9 @@
|
|||||||
"arguments": {
|
"arguments": {
|
||||||
"document": {
|
"document": {
|
||||||
"_id": 1,
|
"_id": 1,
|
||||||
"y": 1
|
"x": 2,
|
||||||
|
"y": 3,
|
||||||
|
"z": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,10 +60,18 @@
|
|||||||
"documents": [
|
"documents": [
|
||||||
{
|
{
|
||||||
"_id": {
|
"_id": {
|
||||||
"$$lte": 1
|
"$$lte": 2
|
||||||
|
},
|
||||||
|
"x": {
|
||||||
|
"$$lte": 2.1
|
||||||
},
|
},
|
||||||
"y": {
|
"y": {
|
||||||
"$$lte": 2
|
"$$lte": {
|
||||||
|
"$numberLong": "3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"$$lte": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"minServerVersion": "4.9",
|
"minServerVersion": "4.9",
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@
|
|||||||
{
|
{
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@
|
|||||||
{
|
{
|
||||||
"topologies": [
|
"topologies": [
|
||||||
"replicaset",
|
"replicaset",
|
||||||
"sharded-replicaset",
|
"sharded",
|
||||||
"load-balanced"
|
"load-balanced"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user