Don't remove a mongos on disconnect.
This commit is contained in:
parent
329130712c
commit
8ececbb1de
@ -166,7 +166,7 @@ def updated_topology_description(topology_description, server_description):
|
||||
topology_type = _SERVER_TYPE_TO_TOPOLOGY_TYPE[server_type]
|
||||
|
||||
if topology_type == TOPOLOGY_TYPE.Sharded:
|
||||
if server_type != SERVER_TYPE.Mongos:
|
||||
if server_type not in (SERVER_TYPE.Mongos, SERVER_TYPE.Unknown):
|
||||
sds.pop(address)
|
||||
|
||||
elif topology_type == TOPOLOGY_TYPE.ReplicaSetNoPrimary:
|
||||
|
||||
88
test/discovery_and_monitoring/sharded/mongos_disconnect.json
Normal file
88
test/discovery_and_monitoring/sharded/mongos_disconnect.json
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"description": "Mongos disconnect",
|
||||
"phases": [
|
||||
{
|
||||
"outcome": {
|
||||
"servers": {
|
||||
"a:27017": {
|
||||
"setName": null,
|
||||
"type": "Mongos"
|
||||
},
|
||||
"b:27017": {
|
||||
"setName": null,
|
||||
"type": "Mongos"
|
||||
}
|
||||
},
|
||||
"setName": null,
|
||||
"topologyType": "Sharded"
|
||||
},
|
||||
"responses": [
|
||||
[
|
||||
"a:27017",
|
||||
{
|
||||
"ismaster": true,
|
||||
"msg": "isdbgrid",
|
||||
"ok": 1
|
||||
}
|
||||
],
|
||||
[
|
||||
"b:27017",
|
||||
{
|
||||
"ismaster": true,
|
||||
"msg": "isdbgrid",
|
||||
"ok": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"outcome": {
|
||||
"servers": {
|
||||
"a:27017": {
|
||||
"setName": null,
|
||||
"type": "Unknown"
|
||||
},
|
||||
"b:27017": {
|
||||
"setName": null,
|
||||
"type": "Mongos"
|
||||
}
|
||||
},
|
||||
"setName": null,
|
||||
"topologyType": "Sharded"
|
||||
},
|
||||
"responses": [
|
||||
[
|
||||
"a:27017",
|
||||
{}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"outcome": {
|
||||
"servers": {
|
||||
"a:27017": {
|
||||
"setName": null,
|
||||
"type": "Mongos"
|
||||
},
|
||||
"b:27017": {
|
||||
"setName": null,
|
||||
"type": "Mongos"
|
||||
}
|
||||
},
|
||||
"setName": null,
|
||||
"topologyType": "Sharded"
|
||||
},
|
||||
"responses": [
|
||||
[
|
||||
"a:27017",
|
||||
{
|
||||
"ismaster": true,
|
||||
"msg": "isdbgrid",
|
||||
"ok": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"uri": "mongodb://a,b"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user