pub enum ClusterEvent {
Show 13 variants
PeerAdded {
meta: ClusterEventMeta,
peer_name: String,
forward_addr: Option<String>,
},
PeerConnected {
meta: ClusterEventMeta,
peer_name: String,
forward_addr: Option<String>,
},
PeerDisconnected {
meta: ClusterEventMeta,
peer_name: String,
consecutive_down: u32,
confirmed: bool,
},
ShardAdopted {
meta: ClusterEventMeta,
shards: Vec<usize>,
from_peer: String,
adopted_by: String,
},
ShardAdoptionFailed {
meta: ClusterEventMeta,
shards: Vec<usize>,
from_peer: String,
error: String,
},
ShardAdoptionSkipped {
meta: ClusterEventMeta,
shards: Vec<usize>,
from_peer: String,
held_by: String,
},
WorkerConnected {
meta: ClusterEventMeta,
worker_id: String,
namespaces: Vec<String>,
task_queue: String,
transport: WorkerTransport,
node: Option<String>,
},
WorkerDisconnected {
meta: ClusterEventMeta,
worker_id: String,
namespaces: Vec<String>,
reason: WorkerDeathReason,
},
SupervisorStarted {
meta: ClusterEventMeta,
node: String,
},
SupervisorStopped {
meta: ClusterEventMeta,
node: String,
},
NamespaceCreated {
meta: ClusterEventMeta,
name: String,
created_at: DateTime<Utc>,
origin: String,
},
NamespacePlacementChanged {
meta: ClusterEventMeta,
name: String,
placement: NamespacePlacementWire,
},
NamespaceQuotaState {
meta: ClusterEventMeta,
namespace: String,
in_flight: u64,
ceiling: u32,
},
}Expand description
A cluster/topology/ownership delta pushed over the ops console real-time channel.
Tagged union on type to match the existing crate::Event wire shape. Every variant carries
ClusterEventMeta as meta. Cluster events are deployment-scoped, not namespace-stamped at
the envelope level; the Worker* variants carry their own namespaces so the server-side gate
can intersect them against the caller’s grants (see the deferred cluster_filter).
Variants§
PeerAdded
A peer was added to this node’s watch set (cluster-membership grew mid-session).
Distinct from Self::PeerConnected: this is a topology change (a new peer to watch),
not a liveness transition. Without it, a peer that joins after the priming
ClusterSnapshot would silently never appear on the map until the next snapshot.
Fields
meta: ClusterEventMetaCluster-event metadata.
PeerConnected
A watched peer transitioned from down/unknown to connected (a liveness recovery).
EMIT NOTE: the supervisor tick() resets consecutive_down/adopted on the same tick it
observes connected, so the recovery condition (was_down = consecutive_down > 0 || adopted) MUST be captured before that reset and the emit driven by the captured value.
Emitting after the reset produces no recovery events (every tick looks freshly connected).
Fields
meta: ClusterEventMetaCluster-event metadata.
PeerDisconnected
A watched peer was observed down on a supervisor tick.
Emitted on every tick the peer is observed down; confirmed flips to true once
consecutive_down >= confirmations (the debounce threshold that authorizes adoption).
Fields
meta: ClusterEventMetaCluster-event metadata.
ShardAdopted
This node adopted shards previously owned by a failed peer.
Fields
meta: ClusterEventMetaCluster-event metadata.
ShardAdoptionFailed
An adoption attempt failed and will be retried on a subsequent tick.
HONESTY: the original design hardcoded will_retry: true. That is a silent lie — a peer
later observed connected resets adopted and stops retrying, and the
“handled elsewhere” path terminally stops. The retry decision is not expressible as a
constant, so the field is omitted; the ops console infers retry by observing whether a
subsequent Self::ShardAdopted / Self::ShardAdoptionSkipped for the same
(from_peer, shards) arrives, rather than trusting a promise that may never be kept
(ADR-016 no-silent-failure).
Fields
meta: ClusterEventMetaCluster-event metadata.
ShardAdoptionSkipped
Adoption was skipped because the shards are already held by a live third-party owner.
Fields
meta: ClusterEventMetaCluster-event metadata.
WorkerConnected
A worker joined the connected set.
Fields
meta: ClusterEventMetaCluster-event metadata.
transport: WorkerTransportDelivery transport for this worker.
WorkerDisconnected
A worker left the connected set.
Fields
meta: ClusterEventMetaCluster-event metadata.
reason: WorkerDeathReasonWhy the worker left (see WorkerDeathReason wiring note).
SupervisorStarted
The cluster supervisor started on this node (lifecycle).
Lets the calm-state view (ADR-019) distinguish “supervisor running, all peers healthy” from “supervisor not running”.
SupervisorStopped
The cluster supervisor stopped on this node (clean drain / shutdown).
NamespaceCreated
A brand-new namespace was minted in the durable registry (Control-Plane Phase 1, S8).
Emitted exactly once per genuinely-new namespace at the registry’s single
MintOutcome::Created choke-point — so the worker-register seam (S5), the
workflow-start safety net (S6), and the explicit POST /namespaces path
(S7) all surface the same delta. An idempotent re-reference of an existing
namespace (MintOutcome::AlreadyExisted) never emits this, so the ops
console appends each namespace exactly once with no refresh.
origin is the stable snake_case label (worker_mint / start_mint /
explicit / inferred_from_state) rather than the aion-store
NamespaceOrigin enum, because this leaf crate must not depend on the
store crate; the label is the same string the audit tracing event logs.
created_at is the durable record’s first-mint instant, carried so the
console’s created column matches the registry without a follow-up fetch.
Fields
meta: ClusterEventMetaCluster-event metadata.
NamespacePlacementChanged
A namespace’s durable placement directive was changed (Control-Plane
Phase 2, P2-P2 — PUT /namespaces/{name}/placement).
Emitted on the SAME deploy-scoped channel as Self::NamespaceCreated
after the placement is durably set, so the ops console’s namespace panel
reflects an operator’s placement change live with no refresh. placement
is the stable wire projection (NamespacePlacementWire) of the durable
NamespacePlacement, carried as a kind label + label set rather than the
aion-store enum, because this leaf crate must not depend on the store
crate (the same discipline Self::NamespaceCreated applies to origin).
Fields
meta: ClusterEventMetaCluster-event metadata.
placement: NamespacePlacementWireThe new placement directive, as the stable wire projection.
NamespaceQuotaState
A periodic snapshot of a namespace’s concurrency-quota state (Control-Plane
Phase 2, P2-Q3), pushed on the SAME deploy-scoped channel as
Self::NamespaceCreated so the ops console renders a live “in-flight /
ceiling” badge that ticks as work flows.
This is the ONE edge-triggered exception’s honest counterweight: unlike the other variants (each emitted at a real subsystem mutation), quota state changes on every claim/settle, so per-row emission would be a firehose. Instead a throttled snapshot task samples each active namespace’s REAL durable state once per cadence and emits this — a periodic snapshot per active namespace, never a client poll. The console folds the latest snapshot per namespace, superseding the prior value.
in_flight is the durable Claimed outbox-row count for the namespace
(count_claimed_outbox_rows) — the SAME notion the keyed backpressure caps,
never the dead inflight_activities gauge (P2-Q0). ceiling is the tenant’s
cluster-wide contract: its explicit max_in_flight_activities override
or the platform default — the number the operator set, not the per-node
proportional slice (exposing per-node math is the leaky-abstraction footgun
§3.6 rejects). On a single node the durable in_flight this node sees is the
whole cluster’s; multi-node exact aggregation is the reserved §3.6 follow-up.
Fields
meta: ClusterEventMetaCluster-event metadata.
Trait Implementations§
Source§impl Clone for ClusterEvent
impl Clone for ClusterEvent
Source§fn clone(&self) -> ClusterEvent
fn clone(&self) -> ClusterEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClusterEvent
impl Debug for ClusterEvent
Source§impl<'de> Deserialize<'de> for ClusterEvent
impl<'de> Deserialize<'de> for ClusterEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ClusterEvent
Source§impl PartialEq for ClusterEvent
impl PartialEq for ClusterEvent
Source§impl Serialize for ClusterEvent
impl Serialize for ClusterEvent
impl StructuralPartialEq for ClusterEvent
Source§impl TS for ClusterEvent
impl TS for ClusterEvent
Source§type WithoutGenerics = ClusterEvent
type WithoutGenerics = ClusterEvent
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = ClusterEvent
type OptionInnerType = ClusterEvent
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more