Repository navigation
Description
Summary
Found while fixing a review comment on #7401's connect cluster PR.
arcadedb.ha.serverList lets an operator give a peer a non-default election priority (e.g. 0 for a
witness that must never become leader, or a high value for a preferred leader):
host:raftPort:httpPort:priority
host:{raft:..,http:..,priority:..}
RaftHAServer.selectStepDownTargets and Ratis's own leader election both read the live
RaftPeer.getPriority(), so this is not cosmetic - it is how a witness stays out of the leader role.
POST /api/v1/cluster/peer (PostAddPeerHandler) has no equivalent. Its JSON payload is
{peerId, address, name} only:
final String peerId = payload.getString("peerId", "");
final String address = payload.getString("address", "");
final String name = payload.getString("name", "").trim();
...
raftHAServer.addPeer(peerId, address, name.isEmpty() ? null : name);so a peer added at runtime through this route always gets Ratis's own default priority, with no way
to ask for anything else. The same was true of connect cluster <address> until #7401's review pass
added a 4-argument addPeer overload that carries a parsed priority through for that one caller -
RaftClusterManager.addPeer(peerId, address, name, priority) - but PostAddPeerHandler was left on
the 3-arg overload because extending an HTTP request contract is a different, larger change than
wiring one caller inside ha-raft.
Suggested scope
- Add an optional
priorityfield to thePOST /api/v1/cluster/peerrequest body. - Have
PostAddPeerHandlercall the priority-carryingaddPeeroverloadRaftHAServeralready
exposes package-privately (may need to widen its visibility, or add a matching public overload). - Update
PluginApiSpec's OpenAPI description foraddClusterPeerandAddPeerRequest. - A test: add a peer with an explicit low priority through this route, assert it is excluded by
selectStepDownTargets/leader election the way aserverList-declared witness is.
Notes
No reported user impact - found during review of #7401, not by hitting it in use.
Related: #7401 (connect cluster, where the sibling gap was fixed for that one entry point).
Activity
address review: carry the declared peer priority into the joined conf…
fix(#7523,#7529): reject narrowed priority values, complete the secur…
docs(#7515,#7523,#7529): point the race at its tracking issue, name t…
Merge pull request #7764 from ArcadeData/fix/issues-7515-7523-7524-75…
lvca commentedon Sep 17, 2026
Fixed in PR #7764 (merged).
POST /api/v1/cluster/peernow accepts an optionalpriorityfield, so you can add a peer as a non-voting witness (priority: 0) or a preferred leader (a higher value) at the same time you add it - no need to pre-declare it in the startup configuration.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#7515,ArcadeData#7523,ArcadeData#7524,ArcadeData#7528,A…