clboss/Boss/ModG
Ken Sedgwick e00758aac3
Add rebalancer mode selector (classic/off) as a dynamic option
Introduces a single source of truth for which rebalancing track is
active.  Boss::Mod::RebalanceModeManager owns the mode in memory (no
sqlite, so a restart reverts to the configured default, giving a
known-good baseline on every boot) and registers clboss-rebalance-mode
as a dynamic option: the config file sets the startup default and
`setconfig clboss-rebalance-mode <mode>` switches it at runtime without
a restart.  It answers RequestRebalanceMode queries and reports the mode
under clboss-status.

Modes are "classic" (run the rebalancer) and "off" (a real quiesce,
also the supported way to disable rebalancing entirely).  This is the
seam that later lets a second rebalancing track coexist and be toggled
without a restart.

The classic-track rebalancers self-gate on the mode at their existing
decision points, modeled on RebalanceUnmanager: EarningsRebalancer gates
its trigger, InitialRebalancer gates its run, and JitRebalancer gates
the top of htlc_accepted so that in off mode it does not defer the HTLC
and adds no forwarding latency.  A header-only Boss::ModG::
RebalanceModeProxy provides get_mode for the gate sites.  off composes
with the existing per-peer unmanage balance tag: off wins globally,
otherwise the per-peer tag still excludes specific peers.

The three rebalancers' unit tests now install a RebalanceModeManager on
the test bus so the self-gate query is answered (default classic, so
they behave as before).  Without a responder the RequestRebalanceMode
ReqResp is never satisfied and leaks, which the valgrind-checked tests
flag as a failure.

New files: Boss/RebalanceMode.hpp, Boss/Msg/RequestRebalanceMode.hpp,
Boss/Msg/ResponseRebalanceMode.hpp, Boss/ModG/RebalanceModeProxy.hpp,
Boss/Mod/RebalanceModeManager.{hpp,cpp}.
2026-08-04 11:01:46 -07:00
..
Detail *: Silence clang warnings. 2020-11-02 19:02:35 +08:00
RebalanceModeProxy.hpp Add rebalancer mode selector (classic/off) as a dynamic option 2026-08-04 11:01:46 -07:00
RebalanceUnmanagerProxy.hpp Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
ReqResp.hpp Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
RpcProxy.cpp Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
RpcProxy.hpp Boss/ModG/RpcProxy.cpp: Utility proxy for RPC interface. 2022-05-02 05:15:18 +00:00
Swapper.cpp Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
Swapper.hpp Boss/Mod*: Wire up to the ignorer. 2020-11-20 11:20:44 +08:00