Background
The Apache Ratis HA module currently identifies peers positionally:
HA_SERVER_LIST is a comma-separated list of host:raftPort:httpPort:priority entries
- Each node's slot is derived from the numeric suffix of
HA_SERVER_NAME (e.g. ArcadeDB_0 -> peer index 0)
- Display names shown in logs and Studio are synthesized as
<localPrefix><sep><index> using the local node's name prefix
This works well for K8s StatefulSet deployments (arcadedb-0, arcadedb-1, ...) but is confusing in two cases:
- Operators who deploy with heterogeneous names (e.g.
frankfurt, london, nyc) must still embed a numeric suffix, and the displayed peer names get rebuilt from the local prefix and don't reflect the configured names.
- The mapping between
HA_SERVER_NAME and the position in HA_SERVER_LIST is implicit. If they get out of sync, a node claims the wrong slot.
Proposal
Add an optional name@ prefix to each entry in HA_SERVER_LIST. Fully backward compatible: entries without @ keep their current behavior; mixed clusters work; @ does not appear in any current valid format so detection is unambiguous.
HA_SERVER_LIST=frankfurt@10.0.0.1:2424:2480,london@10.0.0.2:2424:2480,nyc@10.0.0.3:2424:2480
Resolution rules:
- If a peer entry has
name@, the local node identifies its slot by matching HA_SERVER_NAME against the peer name first.
- If no name match is found, fall back to the existing
prefix_N / prefix-N suffix resolution.
- Display names use the configured peer name when present; otherwise the existing positional synthesis is used.
- Names must be unique within the cluster (validated at parse time).
Affected components
HA_SERVER_LIST parser (RaftPeerAddressResolver.parsePeerList)
- Local peer resolution (
RaftPeerAddressResolver.findLocalPeerId)
- Display-name building (
RaftHAServer constructor + getPeerDisplayName)
- Dynamic membership: optional
name parameter on addPeer admin command (POST payload field) so peers added at runtime also get a friendly name in logs/Studio
HAServerPlugin interface: optional 3-arg addPeer(peerId, address, name) default that delegates to the 2-arg version, so non-Raft implementations keep working
Out of scope
- No wire-level name exchange between nodes is needed:
HA_SERVER_LIST is already a cluster-wide setting, so each node already knows the configured names.
HA_SERVER_NAME itself does not need to change. With named peers, its numeric suffix simply becomes optional.
Background
The Apache Ratis HA module currently identifies peers positionally:
HA_SERVER_LISTis a comma-separated list ofhost:raftPort:httpPort:priorityentriesHA_SERVER_NAME(e.g.ArcadeDB_0-> peer index 0)<localPrefix><sep><index>using the local node's name prefixThis works well for K8s StatefulSet deployments (
arcadedb-0,arcadedb-1, ...) but is confusing in two cases:frankfurt,london,nyc) must still embed a numeric suffix, and the displayed peer names get rebuilt from the local prefix and don't reflect the configured names.HA_SERVER_NAMEand the position inHA_SERVER_LISTis implicit. If they get out of sync, a node claims the wrong slot.Proposal
Add an optional
name@prefix to each entry inHA_SERVER_LIST. Fully backward compatible: entries without@keep their current behavior; mixed clusters work;@does not appear in any current valid format so detection is unambiguous.Resolution rules:
name@, the local node identifies its slot by matchingHA_SERVER_NAMEagainst the peer name first.prefix_N/prefix-Nsuffix resolution.Affected components
HA_SERVER_LISTparser (RaftPeerAddressResolver.parsePeerList)RaftPeerAddressResolver.findLocalPeerId)RaftHAServerconstructor +getPeerDisplayName)nameparameter onaddPeeradmin command (POSTpayload field) so peers added at runtime also get a friendly name in logs/StudioHAServerPlugininterface: optional 3-argaddPeer(peerId, address, name)default that delegates to the 2-arg version, so non-Raft implementations keep workingOut of scope
HA_SERVER_LISTis already a cluster-wide setting, so each node already knows the configured names.HA_SERVER_NAMEitself does not need to change. With named peers, its numeric suffix simply becomes optional.