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
POST /api/v1/cluster/leader: NPE (500) on missing body, and success response when leadership did not actually transfer #5276
Two small bugs in the leadership-transfer management endpoint, hit while applying the #4696 workaround on 26.8.1-SNAPSHOT (full context in #5268):
Missing body → NPE → 500.POST /api/v1/cluster/leader with an empty body returns a bare 500 Internal Server Error; server side logs:
SEVER [PostTransferLeaderHandler] Error on command execution (PostTransferLeaderHandler):
Cannot invoke "com.arcadedb.serializer.json.JSONObject.getString(String, String)" because "payload" is null
Expected: 400 Bad Request with a message describing the required body ({"target": "<peerId>"}).
False success. With a valid body ({"target": "<peer-id of a healthy, up-to-date follower>"}) the endpoint returned {"result":"Leadership transferred"} — but leadership never moved: the incumbent logged Leader churn: ... re-elected (term=4) seconds later and stayed leader; the target never became leader. The handler appears to report the transfer request as success rather than the transfer outcome. Expected: either wait/verify and report the actual outcome, or return an explicitly asynchronous "transfer initiated" response.
(In our case the target follower was HEALTHY with replicationLag 0, so eligibility wasn't the obvious explanation — but if the transfer was rejected for eligibility reasons, that rejection was also invisible to both the caller and the log.)
Related observation from a successful internal transfer during bootstrap (same snapshot build): the confirmation path logged RaftClusterManager: Leadership transferred to ... (confirmed after IOException) — i.e. even when the transfer succeeds, the manager appears to detect it by catching an IOException from the old channel rather than by a positive acknowledgement. Consistent with the false-success in this report: the outcome detection is indirect on both paths.
Fixed in main (commit 537db5a), shipping in 26.8.1.
Both bugs are fixed, and we found a third that explains your "false success": the endpoint expects the field peerId, and your {"target": ...} was silently ignored - so the request was executed as "transfer to any peer", Ratis picked its own candidate, and leadership bounced back to the incumbent while the response reported success.
Now:
a missing body returns 400 with the expected format ({"peerId": "<peer-id>", "timeoutMs": <ms, optional>}, or {} to let the cluster pick the target);
an unrecognized field returns 400 naming it, instead of being silently ignored;
a successful transfer response includes the confirmed leaderId, so you can verify the outcome instead of trusting a success string.
❤️ 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
ruispereira commentedon Jul 14, 2026
Related observation from a successful internal transfer during bootstrap (same snapshot build): the confirmation path logged
RaftClusterManager: Leadership transferred to ... (confirmed after IOException)— i.e. even when the transfer succeeds, the manager appears to detect it by catching an IOException from the old channel rather than by a positive acknowledgement. Consistent with the false-success in this report: the outcome detection is indirect on both paths.fix(#5276): validate POST /api/v1/cluster/leader body and report the …
lvca commentedon Jul 14, 2026
Fixed in
main(commit 537db5a), shipping in 26.8.1.Both bugs are fixed, and we found a third that explains your "false success": the endpoint expects the field
peerId, and your{"target": ...}was silently ignored - so the request was executed as "transfer to any peer", Ratis picked its own candidate, and leadership bounced back to the incumbent while the response reported success.Now:
{"peerId": "<peer-id>", "timeoutMs": <ms, optional>}, or{}to let the cluster pick the target);leaderId, so you can verify the outcome instead of trusting a success string.❤️ 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(#5276): validate POST /api/v1/cluster/leader body and report the …