Allocation: Shared cache capacity monitor implemenation - #155646
Allocation: Shared cache capacity monitor implemenation#155646surya-estc wants to merge 6 commits into
Conversation
surya-estc
commented
Jul 31, 2026
- Add monitor implementation by tracking the previous and current commitments per node
- Calls reroute once there is a valid over-subscription condition
- Implements reroute throttling
- Closes https://github.com/elastic/elasticsearch-team/issues/4588
- Add unit tests
- Will update ITs once Allocation: Implement canRemain function for shared cache capacity decider #154863 is merged
There was a problem hiding this comment.
Pull request overview
This PR adds a stateless allocation monitor that watches per-node shared cache commitments (from ClusterInfo) and triggers allocation reroutes when search nodes newly cross the shared-cache capacity watermarks, along with a new dynamic throttle setting and accompanying unit tests.
Changes:
- Introduces
SharedCacheCapacityMonitorto detect high/low watermark transitions in node cache commitments and callRerouteService#reroute. - Wires the monitor into
StatelessPluginand exposes a new dynamic setting to rate-limit reroute requests. - Adds
SharedCacheCapacityMonitorTestscovering transition classification, reroute triggering rules, throttling, and live setting updates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| x-pack/plugin/stateless/src/main/java/org/elasticsearch/xpack/stateless/allocation/SharedCacheCapacityMonitor.java | New monitor implementation that evaluates cache commitment watermark transitions and triggers reroutes with throttling. |
| x-pack/plugin/stateless/src/main/java/org/elasticsearch/xpack/stateless/allocation/SharedCacheCapacityAllocationDecider.java | Adds cluster.routing.allocation.shared_cache_capacity.reroute_interval setting used by the monitor. |
| x-pack/plugin/stateless/src/main/java/org/elasticsearch/xpack/stateless/StatelessPlugin.java | Registers the new monitor as a ClusterInfoService listener and exposes the new setting via getSettings(). |
| x-pack/plugin/stateless/src/test/java/org/elasticsearch/xpack/stateless/allocation/SharedCacheCapacityMonitorTests.java | New unit tests validating monitor decisions, reroute triggering behavior, throttling, and dynamic settings updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|