Skip to content

HA: after stuck-diverged self-reformat, follower never receives a single append (matchIndex=-1 forever) — RUNNING and leader-aware but permanently empty, leader reports it HEALTHY #5295

Closed

Description

@ruispereira

Follow-up to #5291, but a distinct defect — filing separately per the pattern of the previous reports. On 26.8.1-SNAPSHOT (digest 8ee87c28…, all 3 nodes): the new stuck-diverged self-reformat fires correctly, but the rejoin after it never completes — the follower ends up RUNNING and leader-aware with matchIndex: -1 forever (not even the term's CONFIGURATIONENTRY gets appended), while the leader's status API reports it HEALTHY. No errors on either side; readiness 503 indefinitely.

Sequence (UTC, 2026-07-15 — same cluster as #5291, immediately after its full parallel reformat)

  1. ~09:29 — full parallel reformat to escape the HA: follower crash-loops every 3s on 'Failed updateLastAppliedTermIndex: newTI (t:3) < oldTI (t:4)' after pod recreation — CLOSED-member auto-restart loops forever, divergedFollowerRecovery never triggers #5291 crash loop: wipe raftStorageDirectory on all 3 nodes + simultaneous --grace-period=0 --force delete. Caveat that set up this scenario: arcadedb-0 was in the HA: follower crash-loops every 3s on 'Failed updateLastAppliedTermIndex: newTI (t:3) < oldTI (t:4)' after pod recreation — CLOSED-member auto-restart loops forever, divergedFollowerRecovery never triggers #5291 3-second crash-restart loop when the wipe ran, and the in-place member restart re-persisted the storage between the rm -rf and the SIGKILL — so while pods 1/2 came back clean and bootstrapped a fresh group (term=5, commitIndex=-1), arcadedb-0 came back with resurrected pre-wipe state (appliedTerm=4, appliedIndex=4967).

  2. 09:33:40 — the new HealthMonitor correctly detects it:

    WARNI [HealthMonitor] Follower stuck-diverged from leader for 60011ms, reformatting Raft storage and rejoining (attempt 1)
    WARNI [RaftHAServer] Follower stuck at a stale term (currentTerm=5, appliedTerm=4, appliedIndex=4967, commitIndex=4967); reformatting Raft storage and rejoining so the leader can reconcile it via snapshot-install.
    

    👏 — this is exactly the classification we asked for in HA: follower crash-loops every 3s on 'Failed updateLastAppliedTermIndex: newTI (t:3) < oldTI (t:4)' after pod recreation — CLOSED-member auto-restart loops forever, divergedFollowerRecovery never triggers #5291, and it works for the stale-term case.

  3. 09:33:40.392 — during the reformat restart, the leader's in-flight append of the configuration entry is cancelled (expected, the member is restarting):

    WARNI [GrpcServerProtocolService] APPEND_ENTRIES onError, lastRequest: ...arcadedb-2..._2434 -> ...arcadedb-0..._2434#1-t5,
      previous=<PROTO_DEFAULT>, leaderCommit=-1, entries: size=1, first=(t:5, i:0), CONFIGURATIONENTRY(...): CANCELLED: client cancelled
    
  4. 09:33:41-42 — the reformatted node comes up and sees the cluster:

    INFO [ArcadeStateMachine] ArcadeStateMachine initialized (groupId=group-E6A6271798FD)
    INFO [ArcadeStateMachine] Leader elected: vcc-superx-arcadedb-2 (...) (term=5)
    INFO [RaftHAServer] RaftClient refreshed with fresh gRPC channels after leader change
    
  5. Then nothing, ever. 5+ minutes of total silence on the node (no bootstrap, no resync, no snapshot, no errors); readiness stays 503.

State of both sides while stuck

arcadedb-0 (the limbo node) /api/v1/cluster:

{"localPeerId":"...arcadedb-0..._2434","raftState":"RUNNING","isLeader":false,
 "leaderId":"...arcadedb-2..._2434","leaderHttpAddress":"...arcadedb-2...:2480","electionCount":1, ...}

Leader (arcadedb-2) /api/v1/cluster peer telemetry:

{"id":"...arcadedb-0...","role":"FOLLOWER","matchIndex":-1,"replicationLag":-1,"replicaStatus":"HEALTHY"}
{"id":"...arcadedb-1...","role":"FOLLOWER","matchIndex":2,"replicationLag":0,"replicaStatus":"HEALTHY"}

matchIndex: -1 after 5 minutes means the leader has never successfully appended anything to this follower — not even entry (t:5, i:0). The appender's retry after the CANCELLED at 09:33:40 either never happened or fails silently (nothing in the leader's log about arcadedb-0 after that line). DNS/network are fine (same pods, stable IPs since 09:30; the node's own RaftClient reached the leader to learn leaderId).

Asks

  • After the stuck-diverged reformat restarts the member, make sure the leader-side appender re-engages (the cancelled in-flight append seems to kill it — same "dead appender" family as the earlier reports, now triggered by the recovery path itself).
  • replicaStatus: HEALTHY with matchIndex: -1 / replicationLag: -1 after minutes is the third distinct incident where the status API masked a dead replication path (crash-looping node yesterday, non-member before that, never-appended now). Suggest: any follower without a successful append in N seconds must not be HEALTHY.
  • The stuck-diverged reformat says "(attempt 1)" — but no attempt 2 ever fired despite the node remaining leaderless-in-effect (matchIndex -1) for 5+ minutes. If the post-reformat rejoin doesn't complete within a window, the monitor should retry or escalate.

Recovery

Will attempt a leadership transfer (fresh appenders) and report back; the full parallel reformat obviously also clears it but costs a full outage each time.

Activity

  1. ruispereira commented on Jul 15, 2026

    @ruispereira
    ContributorAuthor

    Recovery confirmed — and it validates the diagnosis. A leadership transfer to the other healthy follower (POST /api/v1/cluster/leader with {"peerId": ...}) recovered the limbo node in seconds: the new leader's fresh appenders immediately replicated to it (matchIndex -1 → 4, level with the other follower) and it went Ready. So the blocker was purely the old leader's dead appender, killed by the CANCELLED in-flight append during the self-reformat restart and never recreated.

    Two extra data points:

  2. added this to the 26.8.1 milestone on Jul 15, 2026
  3. self-assigned this
    on Jul 15, 2026
  4. added theissue type on Jul 15, 2026
  5. added 2 commits that reference this issue on Jul 15, 2026
  6. lvca commented on Jul 15, 2026

    @lvca
    Member

    Fixed in main.

    You nailed the diagnosis. The real defect was on the leader: the cluster monitor decided a follower's health purely from its numeric replication lag. When the group had only committed a couple of entries, a follower stuck at matchIndex=-1 (never received a single append) had a lag small enough to fall under the warning threshold, so it was reported HEALTHY. That same threshold also gated the two existing self-healing paths, so neither of them ever kicked in.

    The monitor now treats "never appended anything while the leader has committed entries" as a dead replication path regardless of how small the lag looks: after a short grace (to not flag a follower that's simply mid-join or mid-snapshot) it reports the follower STALLED and triggers the leader to force a resync automatically. A follower that starts replicating within the grace is never flagged.

    Two notes:

    • On the leader-side appender itself: a leadership transfer (which you already confirmed recovers it in seconds) remains the reliable manual lever, and the new STALLED status now says so explicitly instead of hiding the problem behind HEALTHY.
    • The follower reformatting itself again wouldn't have helped here, since the stuck side was the leader's appender, so the fix lives on the leader.

    Available in the next 26.8.1-SNAPSHOT build.


    ❤️ 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.

  7. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions