Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cluster compatibility

Supported stacks

ComponentVersionNotes
Aeron Java/C media driver1.54.3Maven Central release jars pinned in .upstream-pins; archive + consensus module
Aeron Cluster Java1.54.3clustered service container
rusteron (Rust bindings)0.3.6 (workspace Cargo.toml)rusteron-client, rusteron-media-driver; bundles Aeron C 1.54.3 (the tutorial sample also uses rusteron-archive). ergo-aeron-cluster turns rusteron’s static feature on by default, so a binary links Aeron’s C statically and runs without a libaeron beside it; default-features = false links it dynamically instead. rusteron builds Aeron’s C from source with CMake and a C compiler either way. static also links libuuid and libatomic on Linux (libbsd is linked on Linux with or without it). rusteron-archive also needs Java and Gradle at build time to build the Aeron archive jars, when they are not already built (Java)
ergo-sbe (codec generator)0.1.xschema 111 session + mark codecs
Rust1.99+the workspace rust-version (the cluster Cargo.toml declares none); edition 2024. CI builds the cluster crate with 1.99.0; the MSRV job checks ergo-sbe only
OSLinux x86-64 and arm64CI runs the cluster unit tests on ubuntu-24.04 and ubuntu-24.04-arm, and the live-cluster harness on ubuntu-24.04 only. macOS is not run in CI
Java25 (17+)Archive and Cluster; the test harness runs Temurin 25 in CI (21 for the Aeron 1.46.8 compatibility job). Java for Archive and Cluster

Schema identities

SchemaIdSBE versionsemanticVersion
Aeron Cluster Session111185.4
Aeron Cluster Mark11025.4

These are pinned in cluster/schemas/ and generated by cluster/build.rs. The generated codec API is unstable: use the high-level AeronCluster client, not the cluster_codec_types module directly.

Failure modes

The client handles these documented transitions:

TriggerExpected behaviour
Leader loss (the session’s egress image closes / publication CLOSED)Session moves to AwaitingNewLeader and polls for NewLeaderEvent
NewLeaderEvent (the last one in a poll)Bind to the image that delivered it; add the leader’s ingress publication without waiting; Connected once it connects, Disconnected if it has not within the message timeout
SessionEvent(CLOSED)Session moves to PendingClose, then Closed, even while a new leader’s publication is pending
Redirect during connectFollow leader_endpoints to the new leader
A member’s publication cannot be added (ingress_endpoints)Skip the member; Java does too, but adds again after a “temporarily unavailable” error. The add’s error once no member is left, or when a REDIRECT names a leader that cannot be added; a connect that times out names the skipped members
Handshake event larger than one MTUReassembled before it is parsed, as Java’s EgressPoller does
New ingress publication (redirect or new leader)Keep every unicast ingress channel setting but the endpoint, and re-add IPC and multicast channels unchanged, so the message limits do not change
Auth challengePass to CredentialsSupplier, send ChallengeResponse
Auth rejectionClusterError::AuthRejected with the cluster’s detail, at once
SessionEvent(ERROR) answering the connect (session limit, client version)ClusterError::ConnectFailed with the cluster’s detail, at once
Connect requestSent once; a challenge response or a redirect sends a new one
close()SessionCloseRequest while connected (up to three offers under back pressure), then Closed
Snapshot admin requestUp to three claims under back pressure, then a retryable ClusterError::Publication
Ingress publication at its maximum positionThe offer returns MaxPositionExceeded; the next poll leaves the session Closed
Egress frame of another SBE schemaEgressListener::on_extension_message; skipped during connect
Timeout (connect / poll / new-leader)ClusterError::Timeout / ClusterError::Disconnected
Listener panicClusterError::ListenerPanicked, session continues
Malformed egress frameClusterError::ProtocolError
Payload too largeClusterError::PayloadTooLarge
Publication backpressureRetryable ClusterError::Publication
connect()
Connected
ingress to the leader, session active
AwaitingNewLeader
waiting for a leader
PendingClose
poll() moves it to Closed
Closed
terminal
Err, no state yet
AuthRejected, ConnectFailed, Timeout, or an Aeron, channel or builder error
close() from any state but Closed
sends SessionCloseRequest only when Connected with ingress connected, offering it up to 3 times under back pressure
close() again
Err(SessionClosed)
Blue: the leader-change path. Orange: the close and error exits. Each arrow names its trigger; every exit to Closed is shown.
SessionEvent(OK)
fails
leader lost: egress image down on poll,
or an ingress offer NotConnected / Closed;
or a NewLeaderEvent
new leader’s ingress connected:
adopt its term and leader
NewLeaderEvent: re-add ingress, rebind egress, restart the clock;
or the new egress closed first: drop the add, wait again
SessionEvent(CLOSED),
or ingress MaxPositionExceeded
SessionEvent(CLOSED): drops the pending publication
timeout → Err(Disconnected)
No new leader’s ingress pending: new_leader_timeout, the configured value, else 2 × the leader heartbeat from the OK, or 20 s when the OK has none.
A new leader’s ingress pending: message_timeout.
the same poll() after CLOSED,
the next one after MaxPositionExceeded
Aeron Cluster client: session states, triggers and exits

What CI runs against a live cluster

The harness (cluster-test-harness/tests/) runs in ci.yml (aeron-cluster-integration, Aeron 1.54.3, Java 25) and in cluster-compatibility.yml (Aeron 1.46.8, Java 21, when the cluster crate, the harness, sbe/src/, a manifest, Cargo.lock, the toolchain pin, the Aeron jar pins or fetch script, or the recipes it runs change; scripts/check-workflow-paths.sh fails if its filter drops one).

CoveredTest file
3-node connect, leader failover, redirectfailover.rs, failover_own_driver.rs, client_parity.rs, nonblocking.rs
New leader that never connects times outnonblocking.rs (a_new_leader_that_never_connects_times_out)
SessionEvent(CLOSED) while a new leader is pendingnonblocking.rs
Ingress channel settings kept across failover and redirectingress_channel_settings.rs
Fragmented egress reassembled by pollegress_fragmentation.rs
poll with fragment_limit 0 reads nothing but finishes a failovernonblocking.rs
Restart, reconnect, quorum loss, log recoveryrestart.rs
Null, simple and empty credentials; a challenge answered correctly; wrong credentials and a wrong challenge answer rejected with ClusterError::AuthRejectedauth.rs
Cluster closes a session that sends no keep-alives; keep-alives hold one openclient_parity.rs
One connect request per connect; a connect error fails the connect at once; session limitclient_parity.rs
A fan-out connect past a member that cannot be added; every member failing; the timeout naming the skipped memberclient_parity.rs
A handshake event spanning several fragments, on the async, blocking and fan-out connectsclient_parity.rs
Dropping an async connect releases its subscription and publications on a shared Aeron clientclient_parity.rs
Reaching the ingress maximum position closes the sessionclient_parity.rs
controlled_poll_egress (Abort, Break, Commit, Continue, lifecycle events, listener panic recovery)client_parity.rs
Admin snapshot request answered on on_admin_response: OK when authorised, UNAUTHORISEDACCESS by default, ERROR for an unknown request typeadmin_snapshot.rs

The harness lets the async connect timeout expire only after a member was skipped, which returns ClusterError::ConnectFailed (client_parity.rs). Unit tests in cluster/src/ (run by ci.yml’s test job) cover challenge dispatch (egress.rs), the challenge response (credentials.rs, client.rs) and the new-leader timeout (client.rs, test_new_leader_timeout_disconnects). No test drives ClusterError::Timeout.

Limitations

  • No dynamic membership (static cluster only).
  • No snapshot/recovery integration.
  • No TLS/mTLS at the Aeron transport layer.
  • The cluster_codec_types module is #[doc(hidden)] and not stable API.
  • Ingress is always an exclusive publication, and the client does not expose its raw publication or subscription.
  • After leader loss the old ingress publication stays open until the new leader’s replaces it or the client is dropped (Java closes it at once); offers are refused by state meanwhile.
  • A failed new-leader publication add is reported once and not retried (Java retries a RESOURCE_TEMPORARILY_UNAVAILABLE add).
  • clientInfo is name=<client name> ergo-aeron-cluster <version>, and the default client name is cluster-client (Java: name=<name> version=<v> commit=<sha>, default name empty).