forked from mongodb/specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Max Staleness NoKnownServers test, prohibit maxStalenessSeconds=0.
- Loading branch information
Showing
11 changed files
with
166 additions
and
13 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
source/max-staleness/tests/ReplicaSetNoPrimary/Incompatible.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
20 changes: 20 additions & 0 deletions
20
source/max-staleness/tests/ReplicaSetNoPrimary/NoKnownServers.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,20 @@ | ||
{ | ||
"error": true, | ||
"read_preference": { | ||
"maxStalenessSeconds": 1, | ||
"mode": "Nearest" | ||
}, | ||
"topology_description": { | ||
"servers": [ | ||
{ | ||
"address": "a:27017", | ||
"type": "Unknown" | ||
}, | ||
{ | ||
"address": "b:27017", | ||
"type": "Unknown" | ||
} | ||
], | ||
"type": "ReplicaSetNoPrimary" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
source/max-staleness/tests/ReplicaSetNoPrimary/NoKnownServers.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,15 @@ | ||
# maxStalenessSeconds must be at least 90 seconds, even with no known servers. | ||
--- | ||
topology_description: | ||
type: ReplicaSetNoPrimary | ||
servers: | ||
- &1 | ||
address: a:27017 | ||
type: Unknown | ||
- &2 | ||
address: b:27017 | ||
type: Unknown | ||
read_preference: | ||
mode: Nearest | ||
maxStalenessSeconds: 1 # Too small. | ||
error: true |
36 changes: 36 additions & 0 deletions
36
source/max-staleness/tests/ReplicaSetNoPrimary/ZeroMaxStaleness.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,36 @@ | ||
{ | ||
"error": true, | ||
"read_preference": { | ||
"maxStalenessSeconds": 0, | ||
"mode": "Nearest" | ||
}, | ||
"topology_description": { | ||
"servers": [ | ||
{ | ||
"address": "a:27017", | ||
"avg_rtt_ms": 5, | ||
"lastUpdateTime": 0, | ||
"lastWrite": { | ||
"lastWriteDate": { | ||
"$numberLong": "2" | ||
} | ||
}, | ||
"maxWireVersion": 5, | ||
"type": "RSSecondary" | ||
}, | ||
{ | ||
"address": "b:27017", | ||
"avg_rtt_ms": 5, | ||
"lastUpdateTime": 0, | ||
"lastWrite": { | ||
"lastWriteDate": { | ||
"$numberLong": "1" | ||
} | ||
}, | ||
"maxWireVersion": 4, | ||
"type": "RSSecondary" | ||
} | ||
], | ||
"type": "ReplicaSetNoPrimary" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
source/max-staleness/tests/ReplicaSetNoPrimary/ZeroMaxStaleness.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,23 @@ | ||
# maxStalenessSeconds=0 is prohibited. | ||
--- | ||
topology_description: | ||
type: ReplicaSetNoPrimary | ||
servers: | ||
- &1 | ||
address: a:27017 | ||
type: RSSecondary | ||
avg_rtt_ms: 5 | ||
lastUpdateTime: 0 | ||
maxWireVersion: 5 | ||
lastWrite: {lastWriteDate: {$numberLong: "2"}} | ||
- &2 | ||
address: b:27017 | ||
type: RSSecondary | ||
avg_rtt_ms: 5 | ||
lastUpdateTime: 0 | ||
maxWireVersion: 4 # Incompatible. | ||
lastWrite: {lastWriteDate: {$numberLong: "1"}} | ||
read_preference: | ||
mode: Nearest | ||
maxStalenessSeconds: 0 | ||
error: true |
6 changes: 3 additions & 3 deletions
6
source/max-staleness/tests/ReplicaSetWithPrimary/Incompatible.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
2 changes: 1 addition & 1 deletion
2
source/max-staleness/tests/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.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
36 changes: 36 additions & 0 deletions
36
source/max-staleness/tests/ReplicaSetWithPrimary/ZeroMaxStaleness.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,36 @@ | ||
{ | ||
"error": true, | ||
"read_preference": { | ||
"maxStalenessSeconds": 0, | ||
"mode": "Nearest" | ||
}, | ||
"topology_description": { | ||
"servers": [ | ||
{ | ||
"address": "a:27017", | ||
"avg_rtt_ms": 5, | ||
"lastUpdateTime": 0, | ||
"lastWrite": { | ||
"lastWriteDate": { | ||
"$numberLong": "2" | ||
} | ||
}, | ||
"maxWireVersion": 5, | ||
"type": "RSPrimary" | ||
}, | ||
{ | ||
"address": "b:27017", | ||
"avg_rtt_ms": 5, | ||
"lastUpdateTime": 0, | ||
"lastWrite": { | ||
"lastWriteDate": { | ||
"$numberLong": "1" | ||
} | ||
}, | ||
"maxWireVersion": 4, | ||
"type": "RSSecondary" | ||
} | ||
], | ||
"type": "ReplicaSetWithPrimary" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
source/max-staleness/tests/ReplicaSetWithPrimary/ZeroMaxStaleness.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,23 @@ | ||
# maxStalenessSeconds=0 is prohibited. | ||
--- | ||
topology_description: | ||
type: ReplicaSetWithPrimary | ||
servers: | ||
- &1 | ||
address: a:27017 | ||
type: RSPrimary | ||
avg_rtt_ms: 5 | ||
lastUpdateTime: 0 | ||
maxWireVersion: 5 | ||
lastWrite: {lastWriteDate: {$numberLong: "2"}} | ||
- &2 | ||
address: b:27017 | ||
type: RSSecondary | ||
avg_rtt_ms: 5 | ||
lastUpdateTime: 0 | ||
maxWireVersion: 4 # Incompatible. | ||
lastWrite: {lastWriteDate: {$numberLong: "1"}} | ||
read_preference: | ||
mode: Nearest | ||
maxStalenessSeconds: 0 | ||
error: true |
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