Commit 4d5d665
committed
(improvement) additional improvements to HostFilter and default policy.
DefaultLoadBalancingPolicy: add make_query_plan_with_exclusion
- forward exclusions to child policy
- preserve target_host preference while skipping excluded hosts
HostFilterPolicy: add make_query_plan_with_exclusion
- forward exclusions to child policy
- filter excluded hosts via predicate in exclusion-aware plans
- add isinstance guard to avoid redundant set() conversion when
excluded is already a set
Also add isinstance guard in DefaultLoadBalancingPolicy.make_query_plan_with_exclusion
for consistency.
Benchmark (100K queries, 45-node/5-DC topology, Python 3.14, median of 5 runs):
Policy | Kops/s | vs master | delta | Mem KB
-----------------------------------------------------------------
DCAware | 206 | +94% | | 1.5
RackAware | 172 | +153% | | 2.0
TokenAware(DCAware) | 97 | +439% | | 1.7
TokenAware(RackAware) | 89 | +424% | | 2.2
Default(DCAware) | 132 | +45% | -4% | 1.6
HostFilter(DCAware) | 54 | +2% | -17% | 1.7
This commit primarily adds exclusion-aware interfaces to Default and
HostFilter policies. The throughput deltas are within noise; the main
benefit is architectural — enabling these policies to participate in
the exclusion protocol for composition with TokenAware.
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>1 parent 93ede64 commit 4d5d665
1 file changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
927 | 939 | | |
928 | 940 | | |
929 | 941 | | |
| |||
1641 | 1653 | | |
1642 | 1654 | | |
1643 | 1655 | | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1644 | 1679 | | |
1645 | 1680 | | |
1646 | 1681 | | |
| |||
0 commit comments