Skip to content

GODRIVER-1825 Select the server with fewer in-progress operations. #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions data/server-selection/in_window/equilibrium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"description": "When in equilibrium selection is evenly distributed",
"topology_description": {
"type": "Sharded",
"servers": [
{
"address": "a:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "b:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "c:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
}
]
},
"mocked_topology_state": [
{
"address": "a:27017",
"operation_count": 5
},
{
"address": "b:27017",
"operation_count": 5
},
{
"address": "c:27017",
"operation_count": 5
}
],
"iterations": 2000,
"outcome": {
"tolerance": 0.05,
"expected_frequencies": {
"a:27017": 0.33,
"b:27017": 0.33,
"c:27017": 0.33
}
}
}
27 changes: 27 additions & 0 deletions data/server-selection/in_window/equilibrium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
description: When in equilibrium selection is evenly distributed
topology_description:
type: Sharded
servers:
- address: a:27017
avg_rtt_ms: 35
type: Mongos
- address: b:27017
avg_rtt_ms: 35
type: Mongos
- address: c:27017
avg_rtt_ms: 35
type: Mongos
mocked_topology_state:
- address: a:27017
operation_count: 5
- address: b:27017
operation_count: 5
- address: c:27017
operation_count: 5
iterations: 2000
outcome:
tolerance: 0.05
expected_frequencies:
a:27017: 0.33
b:27017: 0.33
c:27017: 0.33
106 changes: 106 additions & 0 deletions data/server-selection/in_window/many-choices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"description": "Selections from many choices occur at correct frequencies",
"topology_description": {
"type": "Sharded",
"servers": [
{
"address": "a:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "b:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "c:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "d:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "e:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "f:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "g:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "h:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "i:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
}
]
},
"mocked_topology_state": [
{
"address": "a:27017",
"operation_count": 0
},
{
"address": "b:27017",
"operation_count": 5
},
{
"address": "c:27017",
"operation_count": 5
},
{
"address": "d:27017",
"operation_count": 10
},
{
"address": "e:27017",
"operation_count": 10
},
{
"address": "f:27017",
"operation_count": 20
},
{
"address": "g:27017",
"operation_count": 20
},
{
"address": "h:27017",
"operation_count": 50
},
{
"address": "i:27017",
"operation_count": 60
}
],
"iterations": 10000,
"outcome": {
"tolerance": 0.03,
"expected_frequencies": {
"a:27017": 0.22,
"b:27017": 0.18,
"c:27017": 0.18,
"d:27017": 0.125,
"e:27017": 0.125,
"f:27017": 0.074,
"g:27017": 0.074,
"h:27017": 0.0277,
"i:27017": 0
}
}
}
63 changes: 63 additions & 0 deletions data/server-selection/in_window/many-choices.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
description: Selections from many choices occur at correct frequencies
topology_description:
type: Sharded
servers:
- address: a:27017
avg_rtt_ms: 35
type: Mongos
- address: b:27017
avg_rtt_ms: 35
type: Mongos
- address: c:27017
avg_rtt_ms: 35
type: Mongos
- address: d:27017
avg_rtt_ms: 35
type: Mongos
- address: e:27017
avg_rtt_ms: 35
type: Mongos
- address: f:27017
avg_rtt_ms: 35
type: Mongos
- address: g:27017
avg_rtt_ms: 35
type: Mongos
- address: h:27017
avg_rtt_ms: 35
type: Mongos
- address: i:27017
avg_rtt_ms: 35
type: Mongos
mocked_topology_state:
- address: a:27017
operation_count: 0
- address: b:27017
operation_count: 5
- address: c:27017
operation_count: 5
- address: d:27017
operation_count: 10
- address: e:27017
operation_count: 10
- address: f:27017
operation_count: 20
- address: g:27017
operation_count: 20
- address: h:27017
operation_count: 50
- address: i:27017
operation_count: 60
iterations: 10000
outcome:
tolerance: 0.03
expected_frequencies:
a:27017: 0.22
b:27017: 0.18
c:27017: 0.18
d:27017: 0.125
e:27017: 0.125
f:27017: 0.074
g:27017: 0.074
h:27017: 0.0277
i:27017: 0
46 changes: 46 additions & 0 deletions data/server-selection/in_window/one-least-two-tied.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"description": "Least operations gets most selections, two tied share the rest",
"topology_description": {
"type": "Sharded",
"servers": [
{
"address": "a:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "b:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
},
{
"address": "c:27017",
"avg_rtt_ms": 35,
"type": "Mongos"
}
]
},
"mocked_topology_state": [
{
"address": "a:27017",
"operation_count": 16
},
{
"address": "b:27017",
"operation_count": 10
},
{
"address": "c:27017",
"operation_count": 16
}
],
"iterations": 2000,
"outcome": {
"tolerance": 0.05,
"expected_frequencies": {
"a:27017": 0.165,
"b:27017": 0.66,
"c:27017": 0.165
}
}
}
27 changes: 27 additions & 0 deletions data/server-selection/in_window/one-least-two-tied.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
description: Least operations gets most selections, two tied share the rest
topology_description:
type: Sharded
servers:
- address: a:27017
avg_rtt_ms: 35
type: Mongos
- address: b:27017
avg_rtt_ms: 35
type: Mongos
- address: c:27017
avg_rtt_ms: 35
type: Mongos
mocked_topology_state:
- address: a:27017
operation_count: 16
- address: b:27017
operation_count: 10
- address: c:27017
operation_count: 16
iterations: 2000
outcome:
tolerance: 0.05
expected_frequencies:
a:27017: 0.165
b:27017: 0.66
c:27017: 0.165
46 changes: 46 additions & 0 deletions data/server-selection/in_window/rs-equilibrium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"description": "When in equilibrium selection is evenly distributed (replica set)",
"topology_description": {
"type": "ReplicaSetWithPrimary",
"servers": [
{
"address": "a:27017",
"avg_rtt_ms": 35,
"type": "RSPrimary"
},
{
"address": "b:27017",
"avg_rtt_ms": 35,
"type": "RSSecondary"
},
{
"address": "c:27017",
"avg_rtt_ms": 35,
"type": "RSSecondary"
}
]
},
"mocked_topology_state": [
{
"address": "a:27017",
"operation_count": 6
},
{
"address": "b:27017",
"operation_count": 6
},
{
"address": "c:27017",
"operation_count": 6
}
],
"iterations": 2000,
"outcome": {
"tolerance": 0.05,
"expected_frequencies": {
"a:27017": 0.33,
"b:27017": 0.33,
"c:27017": 0.33
}
}
}
27 changes: 27 additions & 0 deletions data/server-selection/in_window/rs-equilibrium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
description: When in equilibrium selection is evenly distributed (replica set)
topology_description:
type: ReplicaSetWithPrimary
servers:
- address: a:27017
avg_rtt_ms: 35
type: RSPrimary
- address: b:27017
avg_rtt_ms: 35
type: RSSecondary
- address: c:27017
avg_rtt_ms: 35
type: RSSecondary
mocked_topology_state:
- address: a:27017
operation_count: 6
- address: b:27017
operation_count: 6
- address: c:27017
operation_count: 6
iterations: 2000
outcome:
tolerance: 0.05
expected_frequencies:
a:27017: 0.33
b:27017: 0.33
c:27017: 0.33
Loading