1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Cluster membership for Datum.
//!
//! This crate is intentionally a membership layer only. It wraps `foca` 1.x as
//! the private SWIM engine and keeps all foca identities, configuration, timers,
//! and notifications out of the public API. The public model mirrors the useful
//! Akka Cluster member states Datum needs before placement arrives:
//! [`MemberState::Joining`], [`MemberState::Up`], [`MemberState::Leaving`],
//! [`MemberState::Exiting`], [`MemberState::Down`], and
//! [`MemberState::Removed`].
//!
//! The implementation is split into two planes. The membership actor owns the
//! registry, state transitions, [`Signal`] current-state publication, lossless
//! [`Subscription`] event publication, and downing decisions. The gossip plane is
//! one Tokio task that owns the UDP socket and foca instance; it receives
//! datagrams, drains foca runtime sends/timers/notifications, and never spawns an
//! actor per packet.
//!
//! Current-state reads use `Signal<ClusterState>` because operators usually want
//! the latest immutable view without replay. Membership changes use
//! `Subscription<MemberEvent>` because active subscribers must observe every
//! accepted state transition in sequence. `Subscription` is bounded and
//! backpressures the publisher instead of dropping membership events.
//!
//! Failure detection and downing are deliberately separate. Foca suspicion marks
//! a member unreachable; a [`DowningProvider`] decides when that unreachable
//! member becomes [`MemberState::Down`]. The default [`TimeoutDowning`] is simple
//! and useful for tests and small deployments, but it is not a split-brain
//! resolver: v0.10 has no quorum, lease, or majority strategy. A split-brain
//! resolution provider is a named follow-up before placement can make strong
//! singleton or sharding claims.
//!
//! C3 placement uses a deterministic coordinator convention rather than an
//! election protocol: every node picks the oldest reachable `Up` member from
//! its local C1 view, tie-broken by node id. C1 does not assign Akka up numbers,
//! so v0.10 uses the propagated member incarnation as the age key. This is
//! deterministic for a shared view, but it is not fencing: under a partition
//! plus timeout downing, both sides can transiently have a coordinator. Quorum
//! or lease fencing is a v0.11+ follow-up.
//!
//! UDP is the v0.10 gossip transport. QUIC plus mTLS is deferred for the control
//! plane and future secure gossip transport; the public API is transport-neutral
//! so that change does not expose foca internals.
pub use ClusterConfig;
pub use ;
pub use ;
pub use ;
pub use ClusterNode;
pub use ;
/// The `datum-cluster` crate version.
pub const VERSION: &str = env!;