You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HA: forwarded commands rejected with HTTP 401 'Invalid cluster token' around leader changes #9554
Follow-up of #9547 ("Also seen in the same run" section, not investigated there).
During the #9547HaChaosIT soak (seed -7841143843546363484, 3 nodes, all faults), node 1 logged forwarded commands that the leader rejected with HTTP 401 Invalid cluster token, around leader changes. The rejection surfaced through RaftReplicatedDatabase.forwardCommandToLeaderViaRaft -> reconstructLeaderException.
A forwarded command should never fail authentication because of a leader change. Possible causes to check:
the cluster token a node uses to forward is read from a stale or not-yet-initialized source while leadership moves;
the receiving node validates against a token it has not loaded yet (for example during an in-place restart or database replacement);
a 401 turned into a non-retryable client error, where a retry against the new leader would have succeeded.
The preserved logs of the #9547 run hold the occurrences. Replay command is in #9547.
Fixed by #9566. Nodes checked a peer's cluster token through the HA plugin, which had no usable token in two windows. At start, Ratis can already be elected leader (and receive forwarded commands) before the plugin registers itself, so the check fell back to the raw arcadedb.ha.clusterToken setting, which is empty when the token is derived. At stop, HA stops before the HTTP listener and dropped the token, so peers that still saw the node as leader got the same 401. The token is now found through the registered HA plugin when the usual lookup returns nothing, and the plugin keeps it after it stops. The snapshot download handler had its own copy of the lookup with the same defect and now shares the helper. A genuinely wrong token still gets a non-retryable 401, on purpose.
The fix is complete for the cases in this issue. Not covered by an end-to-end test: the stop window (it is covered by a unit test).
❤️ 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.
Activity
fix(#9554): accept peers' cluster token while the HA plugin starts an…
robfrank commentedon Oct 9, 2026
Fixed by #9566. Nodes checked a peer's cluster token through the HA plugin, which had no usable token in two windows. At start, Ratis can already be elected leader (and receive forwarded commands) before the plugin registers itself, so the check fell back to the raw
arcadedb.ha.clusterTokensetting, which is empty when the token is derived. At stop, HA stops before the HTTP listener and dropped the token, so peers that still saw the node as leader got the same 401. The token is now found through the registered HA plugin when the usual lookup returns nothing, and the plugin keeps it after it stops. The snapshot download handler had its own copy of the lookup with the same defect and now shares the helper. A genuinely wrong token still gets a non-retryable 401, on purpose.The fix is complete for the cases in this issue. Not covered by an end-to-end test: the stop window (it is covered by a unit test).
❤️ 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(#9554): accept peers' cluster token while the HA plugin starts an…