You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cluster-controller: drop unused node_direct join from node_drain::store #885
node_api_row in crates/libs/cluster/controller/server/src/node_drain/store.rs:545-571 queries a source node's OwnedNodeApiTarget with LEFT JOIN node_direct nd ON nd.node_id = n.id to populate direct_endpoint. Because of that join, node_drain/store.rs carries an exception in architecture-baseline.toml under [pattern_ratchet.direct_tables].
However, the node-drain reconciler is Kubernetes-only (SubstrateCapabilities::DIRECT.supports_node_drain is false), and its sole consumer of node_api_row is promotion_node_api_client (store.rs:2634), which passes target directly to self.substrate.kubernetes() (KubernetesSubstrate::resolve_node_api_endpoint). KubernetesSubstrate addresses nodes exclusively via NodeAddressing::SubstrateNodeId (nk.k8s_node_name) and never reads direct_endpoint.
Why it matters
ARCHITECTURE.toml fences node_direct to the Direct substrate (crates/libs/api/src/controllers/substrate/direct*). Keeping an unused LEFT JOIN node_direct in a Kubernetes-only reconciler pays an unnecessary join on every uncached source-node lookup during drain and keeps node_drain/store.rs in [pattern_ratchet.direct_tables].
Proposed approach
Remove LEFT JOIN node_direct nd ON nd.node_id = n.id from node_api_row in crates/libs/cluster/controller/server/src/node_drain/store.rs and set direct_endpoint: None on the returned OwnedNodeApiTarget.
Remove "crates/libs/cluster/controller/server/src/node_drain/store.rs" = 1 from [pattern_ratchet.direct_tables] in architecture-baseline.toml (cargo arch --write-baseline=direct_tables).
Severity
Low (removes an unused table join and ratchets down pattern_ratchet.direct_tables by one file).
Activity