|
| 1 | +# This test tests an edge case where the leaseholder is removed from the range. |
| 2 | +# Regression test for a bug where processStoreLeaseholderMsgInternal was |
| 3 | +# iterating over the pending changes and removing them inside the loop. |
| 4 | +set-store |
| 5 | + store-id=1 node-id=1 attrs=purple locality-tiers=region=us-west-1,zone=us-west-1a |
| 6 | + store-id=2 node-id=2 attrs=yellow locality-tiers=region=us-east-1,zone=us-east-1a |
| 7 | +---- |
| 8 | +node-id=1 failure-summary=ok locality-tiers=region=us-west-1,zone=us-west-1a,node=1 |
| 9 | + store-id=1 membership=full attrs=purple locality-code=1:2:3: |
| 10 | +node-id=2 failure-summary=ok locality-tiers=region=us-east-1,zone=us-east-1a,node=2 |
| 11 | + store-id=2 membership=full attrs=yellow locality-code=4:5:6: |
| 12 | + |
| 13 | +store-leaseholder-msg |
| 14 | +store-id=1 |
| 15 | + range-id=1 load=[80,80,80] raft-cpu=20 config=(num_replicas=3 constraints={'+region=us-west-1:1'} voter_constraints={'+region=us-west-1:1'}) |
| 16 | + store-id=1 replica-id=1 type=VOTER_FULL leaseholder=true |
| 17 | +---- |
| 18 | + |
| 19 | +ranges |
| 20 | +---- |
| 21 | +range-id=1 load=[cpu:80, write-bandwidth:80, byte-size:80] raft-cpu=20 |
| 22 | + store-id=1 replica-id=1 type=VOTER_FULL leaseholder=true |
| 23 | + |
| 24 | +make-pending-changes range-id=1 |
| 25 | + rebalance-replica: remove-store-id=1 add-store-id=2 |
| 26 | +---- |
| 27 | +pending(2) |
| 28 | +change-id=1 store-id=2 node-id=2 range-id=1 load-delta=[cpu:88, write-bandwidth:88, byte-size:88] start=0s |
| 29 | + prev=(replica-id=none type=VOTER_FULL) |
| 30 | + next=(replica-id=unknown type=VOTER_FULL leaseholder=true) |
| 31 | +change-id=2 store-id=1 node-id=1 range-id=1 load-delta=[cpu:-80, write-bandwidth:-80, byte-size:-80] start=0s |
| 32 | + prev=(replica-id=1 type=VOTER_FULL leaseholder=true) |
| 33 | + next=(replica-id=none type=VOTER_FULL) |
| 34 | + |
| 35 | +# Advance time to 1s so that we can see pending changes for removed ranges are |
| 36 | +# properly enacted. |
| 37 | +tick seconds=1 |
| 38 | +---- |
| 39 | +t=1s |
| 40 | + |
| 41 | +store-leaseholder-msg |
| 42 | +store-id=1 |
| 43 | +---- |
| 44 | + |
| 45 | +# The pending changes are enacted with enactedAtTime set to 1s. |
| 46 | +get-pending-changes |
| 47 | +---- |
| 48 | +pending(2) |
| 49 | +change-id=1 store-id=2 node-id=2 range-id=1 load-delta=[cpu:88, write-bandwidth:88, byte-size:88] start=0s enacted=1s |
| 50 | + prev=(replica-id=none type=VOTER_FULL) |
| 51 | + next=(replica-id=unknown type=VOTER_FULL leaseholder=true) |
| 52 | +change-id=2 store-id=1 node-id=1 range-id=1 load-delta=[cpu:-80, write-bandwidth:-80, byte-size:-80] start=0s enacted=1s |
| 53 | + prev=(replica-id=1 type=VOTER_FULL leaseholder=true) |
| 54 | + next=(replica-id=none type=VOTER_FULL) |
| 55 | + |
| 56 | +ranges |
| 57 | +---- |
0 commit comments