[tech-debt] Unused data-structures when consistent-hashing LBs are used
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 428
Description
*Unused data-structures when consistent-hashing LBs are used*
*Description*:
When hosts are updated for a cluster (e.g., when EDS is updated or when a new cluster is introduced) the code calls [updateHosts()](https://github.com/envoyproxy/envoy/blob/bb80b323080ff2ae62b4c18513f2d5093fd23bec/source/common/upstream/upstream_impl.cc#L567) that builds 2 internal schedulers [healthy_locality_scheduler_](https://github.com/envoyproxy/envoy/blob/bb80b323080ff2ae62b4c18513f2d5093fd23bec/source/common/upstream/upstream_impl.h#L670) and [degraded_locality_scheduler_](https://github.com/envoyproxy/envoy/blob/bb80b323080ff2ae62b4c18513f2d5093fd23bec/source/common/upstream/upstream_impl.h#L672C48-L672C76).
However these are not used when the data-plane routes a request and the cluster is using a consistent hashing LB policy (e.g., MAGLEV, RING-HASH).
The code can probably be refactored a bit to reduce both CPU (config-path) and memory overhead that is not needed in these cases.
Contributor guide
Assessment
This issue has not been assessed yet.