Expand description
The pure strategy interface and the strategy implementations.
A strategy is two pure functions over (observed cluster state, live signals, now):
Strategy::update_statereturns the durable writes the strategy wants (cut-overs, record writes/clears). The controller transacts these in the tick’s first phase.Strategy::desired_replicasreturns the replica slots the strategy contributes to the cluster’s desired set. The controller unions every strategy’s contribution in the tick’s second phase.
Both are pure: same inputs, same output, no I/O. The controller is the sole
mutator. Strategies never touch the ClusterControllerCtx directly. They
declare the live signals they need via Strategy::signal_request and the
controller fetches those before evaluating them.
Structs§
- Baseline
Strategy - The implicit baseline strategy, always present.
- Config
Signals - Environment-wide configuration the strategies consult, latched by the kernel once per tick from the controller’s dyncfgs so every strategy decides against one consistent config. Not durable cluster state, so never witness material.
- Desired
Replica - A replica slot a strategy desires this tick. The reconcile kernel unions
slots across strategies and matches them by
ReplicaShapeagainst the actual replica set. - Graceful
Reconfiguration Strategy - The graceful (zero-downtime) reconfiguration strategy.
- Hydration
Burst Strategy - The hydration-burst strategy.
- Live
Signals - The fulfilled live signals for one cluster, fetched by the kernel per the
unioned
SignalRequestand passed alongsideClusterState. - OnRefresh
Strategy - The
ON REFRESHscheduling strategy. - Signal
Request - The live signals a strategy asks the kernel to fetch before evaluating a
cluster, declared through
Strategy::signal_request.
Traits§
- Strategy
- One cluster-autoscaling strategy: a pair of pure functions the controller runs each tick. See the module docs.