Skip to main content

M3_PLACEMENT_ESTRATEGIA_SINGLE_NODE

Constant M3_PLACEMENT_ESTRATEGIA_SINGLE_NODE 

Source
pub const M3_PLACEMENT_ESTRATEGIA_SINGLE_NODE: &str = "SingleNode";
Expand description

Canonical M3 crate::aplicacao::PlacementStrategy::SingleNode variant discriminator scalar-value — the exact byte-string the Serialize derive on the un-renamed enum emits under M3_PLACEMENT_KEY_ESTRATEGIA whenever the typed slot’s distribution strategy is the single-cluster-active-at-a-time arm (OTP distributed-application takeover, MESH-COMPOSITION.md §II.1).

The scalar every downstream cluster-side dispatcher probes verbatim to pick the takeover semantics:

  • the lareira-fleet-programs aggregator’s per-entry placement.estrategia strategy dispatch (if $strat == "SingleNode" { ... }),
  • the future app-operator reconciler’s per-Aplicacao strategy-branch (match placement.estrategia { "SingleNode" => … }),
  • the future mesh.pleme.io/v1alpha1/Aplicacao CR materializer’s admission-time enum-arm bind, and
  • the M3 Adaptive compression pass’s per-strategy weighting per MESH-COMPOSITION.md §V.

The scalar is derived by #[derive(Serialize)] on the crate::aplicacao::PlacementStrategy enum with no #[serde(rename_all = …)] attribute, so the emitted string is byte-for-byte the source-side variant name. Lifting the byte to one &'static str closes the drift footgun structurally: a future refactor renaming the variant (SingleNodeSingleton for OTP- vocabulary parity, Active for shorter-form-clarity, etc.) OR adding a #[serde(rename_all = "kebab-case")] attribute would silently emit a placement.estrategia: scalar whose distribution strategy lands under one spelling while every downstream consumer still dispatches on another — the aggregator’s strategy branch, the operator’s reconcile posture, the CR materializer’s admission-time enum-arm bind would each silently no-op onto the enum’s default() (Replicated) and the workload would come up on every declared cluster active-active rather than the single-cluster-takeover the typed slot named. The serde round-trip pin the sweep introduces ([crate::aplicacao::tests::placement_strategy_variants_serialize_to_lifted_scalar_values]) catches the drift at caixa-core build time rather than at the aggregator’s dispatch step or the operator’s reconcile posture.

Peer of M3_PLACEMENT_ESTRATEGIA_REPLICATED / M3_PLACEMENT_ESTRATEGIA_SHARDED on the same closed PlacementStrategy enum surface — together the three constants name every author-reachable arm of the M3 distribution-strategy discriminator, mirroring the closed-enum-scalar-value trajectory CILIUM_AUTH_MODE_REQUIRED / CILIUM_AUTH_MODE_DISABLED (8ab119f) established on the sibling Cilium MutualAuthenticationMode OpenAPI schema enum.