Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure the server description is updated even when equal to the previous one, to keep client-tracked attributes fresh. NODE-2474
- Loading branch information
Showing
4 changed files
with
267 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
test/spec/server-discovery-and-monitoring/rs/repeated.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"description": "Repeated ismaster response must be processed", | ||
"uri": "mongodb://a,b/?replicaSet=rs", | ||
"phases": [ | ||
{ | ||
"responses": [ | ||
[ | ||
"a:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": false, | ||
"secondary": true, | ||
"hidden": true, | ||
"hosts": [ | ||
"a:27017", | ||
"c:27017" | ||
], | ||
"setName": "rs", | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"a:27017": { | ||
"type": "RSOther", | ||
"setName": "rs" | ||
}, | ||
"b:27017": { | ||
"type": "Unknown" | ||
}, | ||
"c:27017": { | ||
"type": "Unknown" | ||
} | ||
}, | ||
"topologyType": "ReplicaSetNoPrimary", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": "rs" | ||
} | ||
}, | ||
{ | ||
"responses": [ | ||
[ | ||
"c:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": true, | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"a:27017": { | ||
"type": "RSOther", | ||
"setName": "rs" | ||
}, | ||
"b:27017": { | ||
"type": "Unknown" | ||
} | ||
}, | ||
"topologyType": "ReplicaSetNoPrimary", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": "rs" | ||
} | ||
}, | ||
{ | ||
"responses": [ | ||
[ | ||
"a:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": false, | ||
"secondary": true, | ||
"hidden": true, | ||
"hosts": [ | ||
"a:27017", | ||
"c:27017" | ||
], | ||
"setName": "rs", | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"a:27017": { | ||
"type": "RSOther", | ||
"setName": "rs" | ||
}, | ||
"b:27017": { | ||
"type": "Unknown" | ||
}, | ||
"c:27017": { | ||
"type": "Unknown" | ||
} | ||
}, | ||
"topologyType": "ReplicaSetNoPrimary", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": "rs" | ||
} | ||
}, | ||
{ | ||
"responses": [ | ||
[ | ||
"c:27017", | ||
{ | ||
"ok": 1, | ||
"ismaster": true, | ||
"hosts": [ | ||
"a:27017", | ||
"c:27017" | ||
], | ||
"setName": "rs", | ||
"minWireVersion": 0, | ||
"maxWireVersion": 6 | ||
} | ||
] | ||
], | ||
"outcome": { | ||
"servers": { | ||
"a:27017": { | ||
"type": "RSOther", | ||
"setName": "rs" | ||
}, | ||
"c:27017": { | ||
"type": "RSPrimary", | ||
"setName": "rs" | ||
} | ||
}, | ||
"topologyType": "ReplicaSetWithPrimary", | ||
"logicalSessionTimeoutMinutes": null, | ||
"setName": "rs" | ||
} | ||
} | ||
] | ||
} |
101 changes: 101 additions & 0 deletions
101
test/spec/server-discovery-and-monitoring/rs/repeated.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
description: Repeated ismaster response must be processed | ||
|
||
uri: "mongodb://a,b/?replicaSet=rs" | ||
|
||
phases: | ||
# Phase 1 - a says it's not primary and suggests c may be the primary | ||
- responses: | ||
- | ||
- "a:27017" | ||
- ok: 1 | ||
ismaster: false | ||
secondary: true | ||
hidden: true | ||
hosts: ["a:27017", "c:27017"] | ||
setName: "rs" | ||
minWireVersion: 0 | ||
maxWireVersion: 6 | ||
outcome: | ||
servers: | ||
"a:27017": | ||
type: "RSOther" | ||
setName: "rs" | ||
|
||
"b:27017": | ||
type: Unknown | ||
|
||
"c:27017": | ||
type: Unknown | ||
topologyType: "ReplicaSetNoPrimary" | ||
logicalSessionTimeoutMinutes: ~ | ||
setName: "rs" | ||
|
||
# Phase 2 - c says it's a standalone, is removed | ||
- responses: | ||
- | ||
- "c:27017" | ||
- ok: 1 | ||
ismaster: true | ||
minWireVersion: 0 | ||
maxWireVersion: 6 | ||
outcome: | ||
servers: | ||
"a:27017": | ||
type: "RSOther" | ||
setName: "rs" | ||
|
||
"b:27017": | ||
type: Unknown | ||
topologyType: "ReplicaSetNoPrimary" | ||
logicalSessionTimeoutMinutes: ~ | ||
setName: "rs" | ||
|
||
# Phase 3 - response from a is repeated, and must be processed; c added again | ||
- responses: | ||
- | ||
- "a:27017" | ||
- ok: 1 | ||
ismaster: false | ||
secondary: true | ||
hidden: true | ||
hosts: ["a:27017", "c:27017"] | ||
setName: "rs" | ||
minWireVersion: 0 | ||
maxWireVersion: 6 | ||
outcome: | ||
servers: | ||
"a:27017": | ||
type: "RSOther" | ||
setName: "rs" | ||
|
||
"b:27017": | ||
type: Unknown | ||
|
||
"c:27017": | ||
type: Unknown | ||
topologyType: "ReplicaSetNoPrimary" | ||
logicalSessionTimeoutMinutes: ~ | ||
setName: "rs" | ||
|
||
# Phase 4 - c is now a primary | ||
- responses: | ||
- | ||
- "c:27017" | ||
- ok: 1 | ||
ismaster: true | ||
hosts: ["a:27017", "c:27017"] | ||
setName: "rs" | ||
minWireVersion: 0 | ||
maxWireVersion: 6 | ||
outcome: | ||
servers: | ||
"a:27017": | ||
type: "RSOther" | ||
setName: "rs" | ||
|
||
"c:27017": | ||
type: RSPrimary | ||
setName: rs | ||
topologyType: "ReplicaSetWithPrimary" | ||
logicalSessionTimeoutMinutes: ~ | ||
setName: "rs" |