|
| 1 | +# This test verifies that the allocator can satisfy zone constraints when stores |
| 2 | +# have limited disk capacity and replicas need to be rebalanced due to disk |
| 3 | +# fullness. The test sets up a 9-node cluster across 4 regions (a, b, c, d) with |
| 4 | +# 3, 2, 1, and 3 nodes respectively. It creates 10 ranges with 5 replicas each, |
| 5 | +# initially placed only on stores s1, s2, s4, s5, s6 (regions a, b, c). Each store |
| 6 | +# has a 10GB capacity and each range is 500MiB, making stores s1, s2, s4, s5, s6 |
| 7 | +# approximately 61% full initially. The span config requires 2 replicas in region |
| 8 | +# a, 2 in region b, and 1 in region c, with lease preferences for region a. |
| 9 | +# |
| 10 | +# Expected outcome: The allocator should rebalance replicas to satisfy the zone |
| 11 | +# constraints while managing disk capacity. Since stores s1 and s2 in region a are |
| 12 | +# initially full, some replicas should move to s3 (also in region a) to maintain |
| 13 | +# the constraint of 2 replicas in region a while reducing disk pressure. Leases |
| 14 | +# should be distributed within region a (s1, s2, s3) due to lease preferences when |
| 15 | +# count-based rebalancing is enabled. |
| 16 | +gen_cluster nodes=9 region=(a,b,c,d) nodes_per_region=(3,2,1,3) store_byte_capacity_gib=10 |
| 17 | +---- |
| 18 | + |
| 19 | +gen_ranges ranges=10 repl_factor=5 placement_type=replica_placement bytes_mib=500 |
| 20 | +{s1,s2,s4,s5,s6}:1 |
| 21 | +---- |
| 22 | +{s1:*,s2,s4,s5,s6}:1 |
| 23 | + |
| 24 | +set_span_config |
| 25 | +[0,9999999999): num_replicas=5 num_voters=5 constraints={'+region=a':2,'+region=b':2,'+region=c':1} lease_preferences=[['+region=a']] |
| 26 | +---- |
| 27 | + |
| 28 | +setting split_queue_enabled=false |
| 29 | +---- |
| 30 | + |
| 31 | +# TODO(wenyihu6): for mma-only, why didn't we balance more replicas to s3 before stabilizing? |
| 32 | +# TODO(wenyihu6): tests more cases here |
| 33 | +# 1. whats happens if zone config started being satisfied but the full-disk |
| 34 | +# target is against the goal of zone/lease constraints |
| 35 | +# 2. what happens if zone config started being un-satisfied but the full-disk |
| 36 | +# target is against the goal of zone/lease constraints |
| 37 | +# 3. what happens if count-based rebalancing is against any of these goals ^ |
| 38 | + |
| 39 | +eval duration=3m samples=1 seed=42 cfgs=(sma-count,mma-count) metrics=(cpu,cpu_util,leases,replicas,disk_fraction_used) |
| 40 | +---- |
| 41 | +disk_fraction_used#1: first: [s1=0.61, s2=0.61, s3=0.00, s4=0.61, s5=0.61, s6=0.61, s7=0.00, s8=0.00, s9=0.00] (stddev=0.30, mean=0.34, sum=3) |
| 42 | +disk_fraction_used#1: last: [s1=0.49, s2=0.37, s3=0.37, s4=0.61, s5=0.61, s6=0.61, s7=0.00, s8=0.00, s9=0.00] (stddev=0.26, mean=0.34, sum=3) |
| 43 | +disk_fraction_used#1: thrash_pct: [s1=48%, s2=26%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=74%) |
| 44 | +leases#1: first: [s1=10, s2=0, s3=0, s4=0, s5=0, s6=0, s7=0, s8=0, s9=0] (stddev=3.14, mean=1.11, sum=10) |
| 45 | +leases#1: last: [s1=6, s2=0, s3=4, s4=0, s5=0, s6=0, s7=0, s8=0, s9=0] (stddev=2.13, mean=1.11, sum=10) |
| 46 | +leases#1: thrash_pct: [s1=24%, s2=21%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=45%) |
| 47 | +replicas#1: first: [s1=10, s2=10, s3=0, s4=10, s5=10, s6=10, s7=0, s8=0, s9=0] (stddev=4.97, mean=5.56, sum=50) |
| 48 | +replicas#1: last: [s1=8, s2=6, s3=6, s4=10, s5=10, s6=10, s7=0, s8=0, s9=0] (stddev=4.19, mean=5.56, sum=50) |
| 49 | +replicas#1: thrash_pct: [s1=48%, s2=26%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=74%) |
| 50 | +artifacts[sma-count]: 7ef09084dfb9e631 |
| 51 | +========================== |
| 52 | +disk_fraction_used#1: first: [s1=0.61, s2=0.61, s3=0.00, s4=0.61, s5=0.61, s6=0.61, s7=0.00, s8=0.00, s9=0.00] (stddev=0.30, mean=0.34, sum=3) |
| 53 | +disk_fraction_used#1: last: [s1=0.43, s2=0.43, s3=0.37, s4=0.61, s5=0.61, s6=0.61, s7=0.00, s8=0.00, s9=0.00] (stddev=0.25, mean=0.34, sum=3) |
| 54 | +disk_fraction_used#1: thrash_pct: [s1=72%, s2=72%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=143%) |
| 55 | +leases#1: first: [s1=10, s2=0, s3=0, s4=0, s5=0, s6=0, s7=0, s8=0, s9=0] (stddev=3.14, mean=1.11, sum=10) |
| 56 | +leases#1: last: [s1=5, s2=1, s3=4, s4=0, s5=0, s6=0, s7=0, s8=0, s9=0] (stddev=1.85, mean=1.11, sum=10) |
| 57 | +leases#1: thrash_pct: [s1=24%, s2=40%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=64%) |
| 58 | +replicas#1: first: [s1=10, s2=10, s3=0, s4=10, s5=10, s6=10, s7=0, s8=0, s9=0] (stddev=4.97, mean=5.56, sum=50) |
| 59 | +replicas#1: last: [s1=7, s2=7, s3=6, s4=10, s5=10, s6=10, s7=0, s8=0, s9=0] (stddev=4.17, mean=5.56, sum=50) |
| 60 | +replicas#1: thrash_pct: [s1=72%, s2=72%, s3=0%, s4=0%, s5=0%, s6=0%, s7=0%, s8=0%, s9=0%] (sum=143%) |
| 61 | +artifacts[mma-count]: 4874ec1d0424aa31 |
| 62 | +========================== |
0 commit comments