storage: add Allocator.TransferLease{Source,Target}#10464
storage: add Allocator.TransferLease{Source,Target}#10464petermattis merged 1 commit intocockroachdb:masterfrom
Conversation
dd03d64 to
9650a58
Compare
|
Could you look at #10193 and #10497 before moving ahead with this? There's something funky going on with lease transfers in the latter (and the former has a similar issue). Reviewed 3 of 3 files at r1. pkg/storage/allocator.go, line 379 at r1 (raw file):
can you clarify that overfull refers to leases here? also this is a strange name for a method that returns a bool pkg/storage/allocator_test.go, line 703 at r1 (raw file):
how come each test case needs a new slice? pkg/storage/allocator_test.go, line 734 at r1 (raw file):
optional: could be nice to introduce sub-tests here, which would give each test a name pkg/storage/allocator_test.go, line 768 at r1 (raw file):
optional: could be nice to introduce sub-tests here, which would give each test a name pkg/storage/replicate_queue.go, line 188 at r1 (raw file):
what does zero mean here? this is the only "real" caller to pkg/storage/replicate_queue.go, line 192 at r1 (raw file):
what is this comment now explaining? pkg/storage/replicate_queue.go, line 207 at r1 (raw file):
nit: pkg/storage/replicate_queue.go, line 210 at r1 (raw file):
should this include the store to which the lease transfer was sent? pkg/storage/replicate_queue.go, line 247 at r1 (raw file):
ditto Comments from Reviewable |
7558355 to
316ed65
Compare
|
I can't reproduce the failures in #10193 and #10497 due to another error occurring first. See #10501. Review status: 0 of 4 files reviewed at latest revision, 9 unresolved discussions. pkg/storage/allocator.go, line 379 at r1 (raw file):
|
|
Reviewed 4 of 4 files at r2. pkg/storage/allocator.go, line 239 at r2 (raw file):
set of nodes? pkg/storage/allocator_test.go, line 703 at r1 (raw file):
|
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. Comments from Reviewable |
316ed65 to
853b3c3
Compare
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. pkg/storage/allocator.go, line 239 at r2 (raw file):
|
|
Reviewed 2 of 2 files at r3. pkg/storage/allocator_test.go, line 737 at r2 (raw file):
|
853b3c3 to
778e56b
Compare
|
Review status: 3 of 4 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. pkg/storage/allocator_test.go, line 737 at r2 (raw file):
|
|
Reviewed 1 of 1 files at r4. Comments from Reviewable |
778e56b to
f1cbdff
Compare
|
Reviewed 2 of 4 files at r2, 1 of 2 files at r3, 1 of 1 files at r4. pkg/storage/allocator.go, line 334 at r4 (raw file):
Why does this take pkg/storage/allocator_test.go, line 729 at r4 (raw file):
We should have some tests with non-empty constraints too (doesn't have to be in this PR) pkg/storage/replicate_queue.go, line 207 at r4 (raw file):
Nit: either remove the hyphens in this comment (and the one below) or change it to the go-style variable name. pkg/storage/replicate_queue.go, line 242 at r4 (raw file):
There are two behavioral changes in this PR: the fact that AllocatorRemove will now transfer leases away from overfull stores, and this one to balance leases in AllocatorNoop. What is the result of allocsim with this part commented out (to see the first part in isolation)? Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. pkg/storage/allocator.go, line 334 at r4 (raw file):
|
a7736e0 to
af4be7d
Compare
|
Reviewed 4 of 4 files at r5. pkg/storage/allocator.go, line 243 at r5 (raw file):
nit: this function doesn't actually check if leaseStoreID is non-zero pkg/storage/allocator.go, line 257 at r5 (raw file):
NYC but could pre-allocate here pkg/storage/allocator_test.go, line 729 at r4 (raw file):
|
|
Review status: all files reviewed at latest revision, 9 unresolved discussions, some commit checks failed. pkg/storage/allocator.go, line 243 at r5 (raw file):
|
af4be7d to
d2842e4
Compare
|
Reviewed 2 of 2 files at r6. pkg/storage/replicate_queue.go, line 192 at r5 (raw file):
|
|
Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful. pkg/storage/replicate_queue.go, line 192 at r5 (raw file):
|
d2842e4 to
e109d2e
Compare
|
Review status: 2 of 5 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. pkg/storage/replicate_queue_test.go, line 98 at r7 (raw file):
@tamird Notice the improvement that was possible here. Comments from Reviewable |
|
Reviewed 3 of 3 files at r7. pkg/storage/replicate_queue_test.go, line 67 at r7 (raw file):
can able be written as pkg/storage/replicate_queue_test.go, line 91 at r7 (raw file):
isn't this susceptible to rot? It'd be nice to count them. pkg/storage/replicate_queue_test.go, line 98 at r7 (raw file):
|
e109d2e to
30f6a02
Compare
|
Added |
|
Review status: 4 of 5 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. pkg/storage/replicate_queue_test.go, line 67 at r7 (raw file):
|
|
Reviewed 1 of 1 files at r8. pkg/storage/replicate_queue_test.go, line 91 at r7 (raw file):
|
fc4ee63 to
adafe59
Compare
|
Review status: 4 of 5 files reviewed at latest revision, 6 unresolved discussions, some commit checks pending. pkg/storage/replicate_queue_test.go, line 91 at r7 (raw file):
|
|
Reviewed 1 of 1 files at r9. pkg/storage/replicate_queue_test.go, line 91 at r7 (raw file):
|
5bbe59a to
051a174
Compare
|
Review status: 4 of 5 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. pkg/storage/replicate_queue_test.go, line 91 at r7 (raw file):
|
|
Reviewed 1 of 1 files at r10. pkg/storage/replicate_queue_test.go, line 54 at r9 (raw file):
|
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. pkg/storage/replicate_queue_test.go, line 54 at r9 (raw file):
|
4c353a4 to
bc2f9d1
Compare
|
Tracked down the |
|
Reviewed 4 of 4 files at r11. pkg/storage/allocator.go, line 556 at r11 (raw file):
s/candidate/source/g for consistency with the caller. perhaps this should be a method on the store list? pkg/storage/replicate_queue.go, line 117 at r11 (raw file):
"see if there's a rebalancing opportunity present" is not a useful comment. The rest of this comment seems pretty complicated - it talks about the negative case (no current lease) rather than the positive case which the code that immediately follows it operates on. It seems to me that if there is a current lease, then the lease holder is immediately considered for lease rebalancing, and that's all that this comment really needs to say. Also, is it possible to get here without holding the lease? Comments from Reviewable |
bc2f9d1 to
eef3cde
Compare
|
Review status: all files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. pkg/storage/allocator.go, line 556 at r11 (raw file):
|
|
Reviewed 2 of 2 files at r12. pkg/storage/replicate_queue.go, line 118 at r12 (raw file):
s/for// ? also add a comma for the subordinate clause. Comments from Reviewable |
Before (`allocsim -n 4 -w 4`):
_elapsed__ops/sec___errors_replicas_________1_________2_________3_________4
5m0s 1472.5 0 2124 704/687 492/0 522/0 406/0
After:
_elapsed__ops/sec___errors_replicas_________1_________2_________3_________4
5m0s 1506.7 0 2157 520/183 548/180 547/166 542/180
I do see a little bit of thrashiness with the lease-transfer heuristics,
though it settles down relatively quickly so I'm not sure if it is worth
addressing yet.
Depends on cockroachdb#10420
eef3cde to
1844549
Compare
|
Review status: 4 of 5 files reviewed at latest revision, 6 unresolved discussions, some commit checks pending. pkg/storage/replicate_queue.go, line 118 at r12 (raw file):
|
|
Reviewed 1 of 1 files at r13. Comments from Reviewable |
Before (
allocsim -n 4 -w 4):After:
I do see a little bit of thrashiness with the lease-transfer heuristics,
though it settles down relatively quickly so I'm not sure if it is worth
addressing yet.
Depends on #10420
This change is