GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — HA: follower never rejoins — StateMachineUpdater.reload() throws IllegalStateException immediately after a successful snapshot install · Issue #4754 · ArcadeData/arcadedb

HA: follower never rejoins — StateMachineUpdater.reload() throws IllegalStateException immediately after a successful snapshot install #4754

New issue
Copy link
New issue
Copy link
Closed
Bug
#4755
Closed
HA: follower never rejoins — StateMachineUpdater.reload() throws IllegalStateException immediately after a successful snapshot install#4754
Bug
#4755
Copy link
Assignees
robfrank
Labels
bugkubernetes
Milestone
26.7.1

Description

@robfrank
robfrank
opened on Jun 27, 2026
Issue body actions

Summary

On a 3-node Raft HA cluster, when a follower performs a full snapshot resync, the snapshot install now completes ("Full resync from leader completed"), but immediately afterwards Ratis's StateMachineUpdater.reload() fails a precondition and throws java.lang.IllegalStateException. This kills the StateMachineUpdater thread, the division transitions to CLOSING/CLOSED, and the follower then rejects all AppendEntries/heartbeats with ServerNotReadyException: ... current state is CLOSED.

The follower ends up as a zombie replica: the snapshot data is present and queryable, but its Raft division is dead, its commit index is frozen (the leader reports a fixed lag, e.g. 21125), and it never rejoins quorum. It does not self-heal, and because arcadedb.ha.raftPersistStorage defaults to false, restarting the follower forces another full snapshot install, which hits this same assertion again — so the follower is unrecoverable on this build.

This is the next failure on the resync path after #4749: with #4749 fixed the install no longer crashes on ServerDatabase.close(), so it now runs to completion — and trips this reload precondition instead.

Version / environment

  • ArcadeDB 26.7.1-SNAPSHOT (a build including the HA: Raft snapshot install crashes in notifyInstallSnapshotFromLeader — ServerDatabase.close() throws UnsupportedOperationException (26.6.1), follower never rejoins, cluster loses write quorum #4749 fix; install completes)
  • 3-node HA cluster (arcadesplit-0/1/2), Raft, Docker, -Xmx6g per node
  • Databases TestBigDB and the internal graph

Symptom

Follower (arcadesplit-2) log — install succeeds, then the assertion fires in the very next millisecond:

[ArcadeStateMachine] Snapshot installation requested from leader (firstLogIndex=(t:1, i:99974)). Starting full resync...
[ArcadeStateMachine] Installing snapshot for database 'TestBigDB' from leader arcadesplit-0:2480...
[ArcadeStateMachine] Installing snapshot for database 'graph' from leader arcadesplit-0:2480...
[ArcadeStateMachine] Full resync from leader completed
SEVER [StateMachineUpdater] arcadesplit-2_2434@group-…-StateMachineUpdater caught a Throwable.
java.lang.IllegalStateException
    at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:35)
    at org.apache.ratis.server.impl.StateMachineUpdater.reload(StateMachineUpdater.java:230)
    at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:191)
    at java.base/java.lang.Thread.run(Thread.java:1583)

Then, repeating forever, the division is closed and rejects replication:

SEVER [RaftServer$Division] arcadesplit-2_2434@group-…: Failed appendEntries* arcadesplit-0_2434->arcadesplit-2_2434 …,leaderCommit=99974,…,HEARTBEAT
org.apache.ratis.protocol.exceptions.ServerNotReadyException: arcadesplit-2_2434@group-… is not in [STARTING, RUNNING]: current state is CLOSING   (then CLOSED)

Cluster status confirms the zombie state — node-2 holds the data but its lag never moves:

arcadesplit-0 (leader): replicaLags { arcadesplit-1_2434: 0, arcadesplit-2_2434: 21125 }
all three nodes report the same Transaction edge count (no writes since the break)

Mechanism / root-cause hypothesis

StateMachineUpdater.reload() (Ratis) runs after an install-snapshot to reinitialize the state machine from the freshly installed snapshot, and asserts an invariant about the reloaded state — typically that the reinitialized state machine exposes a valid latest snapshot (non-null, index > 0 / consistent with lastAppliedIndex), or that the updater is in the expected RELOAD state. The IllegalStateException (a bare Preconditions.assertTrue failure at StateMachineUpdater.java:230) means that invariant is false right after ArcadeDB reports "Full resync from leader completed".

So the ArcadeDB side (ArcadeStateMachine install/reinitialize path) appears to finish the resync without leaving Ratis in the state reload() requires — e.g. not updating/exposing the installed snapshot's index, or completing the install on a path that doesn't drive the updater through the expected RELOAD → RUNNING transition. (I couldn't capture the exact failing precondition from the logs — only the two Installing snapshot … INFO lines precede Full resync from leader completed — so the specific invariant is a hypothesis; a Ratis-side debug log or the assertion message would pin it.)

Impact

follower needs full snapshot -> install completes ("Full resync from leader completed")
  -> StateMachineUpdater.reload() Preconditions.assertTrue -> IllegalStateException
    -> StateMachineUpdater thread dies -> division CLOSING/CLOSED
      -> follower rejects all AppendEntries (ServerNotReadyException: CLOSED)
        -> commit index frozen, lag never decreases, follower never rejoins
          -> cluster permanently degraded to 2/3 (no fault tolerance); no self-heal

Because raftPersistStorage defaults to false, a restart drops the follower's Raft state and forces another full snapshot → the assertion fires again → the follower cannot be recovered on this build short of rebuilding the whole cluster from empty (so no node ever resyncs).

Reproduction

  1. 3-node HA cluster, -Xmx6g, replicationFactor=3.
  2. Build a multi-million-edge graph under load.
  3. Force a follower into a full snapshot resync — stop it, remove its data volume, start it (so it must full-install from the leader). (Also reproduces by leaving a follower far enough behind that the leader ships a snapshot.)
  4. The install completes, then StateMachineUpdater.reload() throws IllegalStateException; the follower's division closes and it never rejoins. 100% reproducible across attempts.

Suggested investigation

  • In ArcadeStateMachine, ensure the install-snapshot / reinitialize completion path leaves the state machine reporting the installed snapshot (correct getLatestSnapshot() index ≥ the install index) and drives the Ratis updater through the expected RELOAD → RUNNING transition before any further apply/heartbeat is processed.
  • Add the failing assertion's message (or a Ratis debug log around StateMachineUpdater.reload) so the exact invariant is visible.

Related

  • HA: Raft snapshot install crashes in notifyInstallSnapshotFromLeader — ServerDatabase.close() throws UnsupportedOperationException (26.6.1), follower never rejoins, cluster loses write quorum #4749 — install crashed in notifyInstallSnapshotFromLeader via ServerDatabase.close() (fixed). This is the next failure once the install runs to completion.
  • HA: follower OOMs deserializing inbound AppendEntries during snapshot/catch-up resync (replication batch not bounded to heap) #4752 / PR fix(#4752): make AppendEntries element limit configurable, default 64 #4753 — follower OOM deserializing catch-up AppendEntries (separate; this report is a deterministic post-install assertion, not memory).
  • HA snapshot serving timed out after 300000ms #4729 — HA snapshot serving timeout (same resync area, leader side).

Happy to provide full follower/leader logs or a heap-independent repro.

Activity

  1. robfrank
    added
    bug
    on Jun 27, 2026
  2. robfrank
    added this to the 26.7.1 milestone on Jun 27, 2026
  3. robfrank
    self-assigned this
    on Jun 27, 2026
  4. robfrank
    added the
    Bug
    issue type on Jun 27, 2026
  5. robfrank
    added a commit that references this issue on Jun 27, 2026

    fix(#4754): implement LifeCycle transitions so StateMachineUpdater.re…

    c04b9fb
  6. robfrank
    closed this as completedin #4755on Jun 27, 2026
  7. robfrank commented on Jun 28, 2026

    @robfrank
    robfrank
    on Jun 28, 2026
    CollaboratorAuthor
    More actions

    Confirmed heap-independent, and triggered by any follower restart — more severe than first described

    Two findings after correcting a heap misconfiguration in the test harness (it had been running at an effective 2 GB heap; now correctly at MAXRAM=6.00GB):

    1. Heap-independent. This reproduces deterministically at a correct 6 GB heap with no OutOfMemoryError anywhere — the failure is purely the StateMachineUpdater.reload() precondition (java.lang.IllegalStateException at StateMachineUpdater.java:230). The earlier 2 GB heap was masking it with OOMs (#4752); with the heap fixed, the assertion is the sole cause.

    2. Triggered by ANY follower restart, not just --wipe / a fresh add. With arcadedb.ha.raftPersistStorage=false (the default), a follower drops its Raft state on restart and goes through the snapshot/reload path on rejoin — so the assertion fires ~1 second after startup on every restart, including a plain docker compose restart with the data volume intact and the follower only ~99 entries behind. Observed across 5 consecutive restart attempts:

    06:59:16  SEVER [StateMachineUpdater] ...caught a Throwable.  java.lang.IllegalStateException
    07:01:22  SEVER [StateMachineUpdater] ...caught a Throwable.  java.lang.IllegalStateException
    07:02:36  SEVER [StateMachineUpdater] ...caught a Throwable.  java.lang.IllegalStateException
    07:03:25  (volume removed → full snapshot)                    java.lang.IllegalStateException
    07:11:04  (plain restart, volume kept, MAXRAM=6.00GB)         java.lang.IllegalStateException
    

    Each time the division ends CLOSED, the follower freezes at its lag (ClusterMonitor: lag=22735 (was 22735), advancing at 0 entries/tick), rejects all AppendEntries with ServerNotReadyException: ... CLOSED, and never rejoins.

    Net effect: on this build a follower that restarts (or crashes and comes back) cannot rejoin the quorum — it stays a zombie replica and the cluster is permanently degraded to N-1 until rebuilt from empty. That makes this a serious HA availability bug, not just an add-a-node edge case. (Likely related: whether notifyInstallSnapshotFromLeader / reload leaves the state machine reporting the installed snapshot index, and whether raftPersistStorage=true lets a restart resume via log replay instead of the snapshot→reload path — untested.)

  8. tae898
    added 2 commits that reference this issue on Jun 28, 2026

    chore(studio-deps-dev)(deps-dev): bump the build-tools group in /stud…

    7030d53

    chore(studio-deps-dev)(deps-dev): bump the build-tools group in /stud…

    846b39d
  9. robfrank
    added
    kubernetes
    on Jun 30, 2026
  10. robfrank
    added a commit that references this issue on Aug 14, 2026

    fix(#4754): implement LifeCycle transitions so StateMachineUpdater.re…

    df1a829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @robfrank
    robfrank

Labels

bugkubernetes

Type

Bug

Projects

No projects

    Milestone

    • 26.7.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.