tests: add test for rebalancer thrashing#9371
Conversation
storage/allocator_test.go
Outdated
| a.options.Deterministic = true | ||
| defer stopper.Stop() | ||
|
|
||
| stores := []*roachpb.StoreDescriptor{ |
There was a problem hiding this comment.
is the fact that there are 4 stores coupled to the fact that there are 4 ranges in the factory functions below? if not, better to make the numbers different to avoid chekhov's gun.
storage/allocator_test.go
Outdated
| // a range count that's above the target range count for the rebalancer, so it | ||
| // should be rebalanced from. | ||
| oneReplicaAboveRebalanceTarget := func(mean int32) [4]testReplica { | ||
| var replicas [4]testReplica |
There was a problem hiding this comment.
perhaps type testCase [4]testReplica to avoid repeating yourself.
|
Review status: 0 of 1 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. storage/allocator_test.go, line 529 at r1 (raw file):
Can you add that scenario here, verify it fails and then comment it out? Comments from Reviewable |
|
Review status: 0 of 1 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. Comments from Reviewable |
3d81e9c to
0823281
Compare
|
Review status: 0 of 1 files reviewed at latest revision, 3 unresolved discussions, some commit checks pending. storage/allocator_test.go, line 469 at r1 (raw file):
|
|
Reviewed 1 of 1 files at r2. storage/allocator_test.go, line 475 at r2 (raw file):
why 4? extract a constant to share with storage/allocator_test.go, line 482 at r2 (raw file):
perhaps storage/allocator_test.go, line 489 at r2 (raw file):
Looks like you forgot to flesh out this comment. storage/allocator_test.go, line 494 at r2 (raw file):
s/10/numStores/? storage/allocator_test.go, line 498 at r2 (raw file):
better if you clarify "large". it seems to be the minimum number that will trigger the rebalancer's heuristic? Comments from Reviewable |
Add a test to ensure that we don't try to rebalance when the cluster is sufficiently balanced.
0823281 to
8af068f
Compare
|
Review status: 0 of 1 files reviewed at latest revision, 8 unresolved discussions. storage/allocator_test.go, line 475 at r2 (raw file):
|
|
Reviewed 1 of 1 files at r3. Comments from Reviewable |
Add a test to ensure that we don't try to rebalance when the cluster is
sufficiently balanced.
This change is