Skip to main content

ClusterEvent

Enum ClusterEvent 

Source
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: ClusterEventMeta

Cluster-event metadata.

§peer_name: String

The newly-watched peer’s node name.

§forward_addr: Option<String>

The peer’s forwarding address, when known.

§

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: ClusterEventMeta

Cluster-event metadata.

§peer_name: String

The recovered peer’s node name.

§forward_addr: Option<String>

The peer’s forwarding address, when known.

§

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: ClusterEventMeta

Cluster-event metadata.

§peer_name: String

The down peer’s node name.

§consecutive_down: u32

Consecutive ticks this peer has been observed down.

§confirmed: bool

Whether the debounce threshold has been crossed (adoption-eligible).

§

ShardAdopted

This node adopted shards previously owned by a failed peer.

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§shards: Vec<usize>

Shard indices adopted in this transition.

§from_peer: String

The peer the shards were adopted from.

§adopted_by: String

This node’s name (the new owner).

§

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: ClusterEventMeta

Cluster-event metadata.

§shards: Vec<usize>

Shard indices the failed attempt targeted.

§from_peer: String

The peer the shards would have been adopted from.

§error: String

Human-readable adoption error.

§

ShardAdoptionSkipped

Adoption was skipped because the shards are already held by a live third-party owner.

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§shards: Vec<usize>

Shard indices that were skipped.

§from_peer: String

The peer the shards would have been adopted from.

§held_by: String

The live node currently holding the shards.

§

WorkerConnected

A worker joined the connected set.

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§worker_id: String

Stable worker identifier.

§namespaces: Vec<String>

Namespaces this worker serves.

§task_queue: String

Task-queue pool this worker serves within its namespaces.

§transport: WorkerTransport

Delivery transport for this worker.

§node: Option<String>

Locality/node label, when the worker reported one.

§

WorkerDisconnected

A worker left the connected set.

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§worker_id: String

Stable worker identifier.

§namespaces: Vec<String>

Namespaces this worker served.

§reason: WorkerDeathReason

Why 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”.

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§node: String

This node’s name.

§

SupervisorStopped

The cluster supervisor stopped on this node (clean drain / shutdown).

Fields

§meta: ClusterEventMeta

Cluster-event metadata.

§node: String

This node’s name.

§

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: ClusterEventMeta

Cluster-event metadata.

§name: String

The minted namespace’s name (registry primary key).

§created_at: DateTime<Utc>

The durable record’s creation instant (its created_at).

§origin: String

How the namespace came to exist, as the stable snake_case label.

§

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: ClusterEventMeta

Cluster-event metadata.

§name: String

The namespace whose placement changed (registry primary key).

§placement: NamespacePlacementWire

The 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: ClusterEventMeta

Cluster-event metadata.

§namespace: String

The namespace this quota snapshot describes (registry primary key).

§in_flight: u64

Durable count of currently-Claimed outbox rows for the namespace — the in-flight activities the ceiling caps.

Exported to TypeScript as number; see the module docs for the accepted 2^53 ceiling (an in-flight count never approaches it).

§ceiling: u32

The tenant’s cluster-wide concurrency ceiling: its explicit max_in_flight_activities override, or the platform default when unset.

Trait Implementations§

Source§

impl Clone for ClusterEvent

Source§

fn clone(&self) -> ClusterEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClusterEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ClusterEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ClusterEvent

Source§

impl PartialEq for ClusterEvent

Source§

fn eq(&self, other: &ClusterEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClusterEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClusterEvent

Source§

impl TS for ClusterEvent

Source§

type WithoutGenerics = ClusterEvent

If this type does not have generic parameters, then 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 more
Source§

type OptionInnerType = ClusterEvent

If the implementing type is 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 ident(cfg: &Config) -> String

Identifier of this type, excluding generic parameters.
Source§

fn docs() -> Option<String>

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
Source§

fn name(cfg: &Config) -> String

Name of this type in TypeScript, including generic parameters
Source§

fn decl_concrete(cfg: &Config) -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
Source§

fn decl(cfg: &Config) -> String

Declaration of this type, e.g. type User = { user_id: number, ... }. This function will panic if the type has no declaration. Read more
Source§

fn inline(cfg: &Config) -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
Source§

fn inline_flattened(cfg: &Config) -> String

Flatten a type declaration. This function will panic if the type cannot be flattened.
Source§

fn visit_generics(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
Source§

fn output_path() -> Option<PathBuf>

Returns the output path to where T should be exported, relative to the output directory. The returned path does not include any base directory. Read more
Source§

fn visit_dependencies(v: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
Source§

fn dependencies(cfg: &Config) -> Vec<Dependency>
where Self: 'static,

Resolves all dependencies of this type recursively.
Source§

fn export(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem. To export this type together with all of its dependencies, use TS::export_all. Read more
Source§

fn export_all(cfg: &Config) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to the filesystem, together with all of its dependencies. To export only this type, without its dependencies, use TS::export. Read more
Source§

fn export_to_string(cfg: &Config) -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String. This function does not format the output, even if the format feature is enabled. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.