Skip to content

ENG-30396: graceful stops and shutdowns, voltadmin stop and shutdown --save, and ENG-30704/ENG-30705 (milestone 48) - #47

Closed
jwiebema1 wants to merge 3 commits into
ENG-30396-sqlancer-m47from
ENG-30396-sqlancer-m48
Closed

jwiebema1 wants to merge 3 commits into
ENG-30396-sqlancer-m47from
ENG-30396-sqlancer-m48

Conversation

@jwiebema1

Copy link
Copy Markdown

Why

Every node failure and crash the runs made was a kill -9. Milestone 44's coverage run found the graceful ways down never run:

  • voltadmin stop, through @PrepareStopNode and @StopNode;
  • voltadmin shutdown --save, which takes a shutdown snapshot;
  • the restart that recovers from that snapshot.

InvocationDispatcher had 284 of 1,028 lines covered.

What it changes

  • run-sqlancer.sh --graceful true|false (default true).
    • Kill runs: every other --kill-interval failure (the second, fourth, ...) is a voltadmin stop through another node, and the node then rejoins as after a kill. The new stop_node retries while VoltDB refuses the stop, which it does for a few seconds after a rejoin.
    • Crash runs: every other --crash-interval crash is a voltadmin shutdown --save, bounded at 300 s. Then every node restarts and recovers from the shutdown snapshot and the command log.
  • Logs and summary: chaos.log and crash.log have stop N and crash N: every node shut down lines. The summary counts graceful stops and shutdowns apart from kills and crashes.
  • New node-failure errors: "Server is paused" and "Server is shutting down", which calls get while the cluster shuts down.
  • README: a "Graceful stops and shutdowns" section, ENG-30704 in the known-bugs table, and the status now says milestone 48.

Bugs found

  • ENG-30704 (Minor): a node stopped with voltadmin stop sometimes logs FATAL partition detection ("fewer than half of the previous servers") after it has shut down. The survivors hang up on it before its JVM exits.
    • It happened in 5 of 6 stops across two loaded coverage runs, and in none of 20 stops of an idle cluster, so there is no reliable reproduction.
    • The harness doesn't count FATAL lines a stopped node logs after its "The database node has been shutdown" line; they go into chaos.excluded.
  • ENG-30705 (Major, 16.0.0 too): a task that ON ERROR STOP has stopped runs again after the node that ran it fails. The node that takes over starts it again (RUNNING) and runs its procedure once more.
    • TASK found it in lab build Speed degradation? sqlancer/sqlancer#61's kill run, after a kill rather than a graceful stop.
    • repros/ENG-30705.sh reproduces it at once.
    • While avoiding known bugs, in runs where nodes fail, TASK doesn't check the state of a task an error stopped; the row counts are still checked.

Coverage (run-coverage.sh's 10-minute kill and crash runs, against milestone 44's)

Class Milestone 44 Milestone 48
InvocationDispatcher 284 of 1,028 357 of 1,028
dispatchStopNode 0 of 18 13 of 18
dispatchPrepareStopNode 0 of 24 19 of 24
takeShutdownSaveSnapshot 0 of 54 33 of 54
ClientInterface 493 of 824 528 of 824

The instrumented build was rebuilt from the same commits (internal bf8602e3, pro 74728eb4) after the macOS /tmp cleanup emptied the old one.

Testing

  • Local kill run (3 nodes, k=1, a failure a minute, 7 minutes): 3 kills, 2 graceful stops and 5 rejoins; it passed.
  • Local crash run (a crash every 2 minutes, 9 minutes): 2 crashes, 2 shutdowns with --save and 4 recoveries; it passed. Node 0's log shows the SHUTDOWN_... snapshot taken and restored.
    • The first attempt failed on "Server is shutting down", now a node-failure error.
  • Coverage runs: both passed, the kill run with 4 kills, 3 graceful stops and 7 rejoins. The first attempt of the kill run failed on ENG-30704's FATAL lines; the second had them too and doesn't count them.
  • mvn verify -DskipTests passes.
  • Lab: builds of matrix-systemtest-apprunner-sqlancer (branch job ENG-30396-sqlancer-nightly, replays) against 16.1.0-SNAPSHOT (master kit 400), 45 minutes per run, all thirty-two oracles.

…, shutdown --save)

Every node failure and crash was a kill -9, so milestone 44's coverage run
found voltadmin stop (@PrepareStopNode, @stopnode), shutdown --save and the
restart from the shutdown snapshot never run. With --graceful true (the
default), every other --kill-interval failure is a voltadmin stop through
another node (stop_node, retried while VoltDB refuses it), then a rejoin; and
every other --crash-interval crash is a voltadmin shutdown --save, then a
restart that recovers from the shutdown snapshot. The logs and the summary
count graceful stops and shutdowns apart from kills and crashes. "Server is
paused" and "Server is shutting down" are node-failure errors.

ENG-30704 (Minor): a stopped node sometimes logs FATAL partition detection
after its shutdown, as the survivors hang up on it before its JVM exits; the
FATAL lines it logs after "The database node has been shutdown" are not
counted (chaos.excluded).
…k runs again after a failover)

TASK's ON ERROR STOP check found @statistics TASK showing a stopped task as
RUNNING: when the node that ran it was killed, the node that took over
started the task again and ran its procedure once more. Filed as ENG-30705
(Major; 16.0.0 too) with repros/ENG-30705.sh; while avoiding known bugs and
nodes fail, TASK does not check that state (the row counts still are).
@jwiebema1

Copy link
Copy Markdown
Author

Superseded by #51, which combines every ENG-30396 PR of this repo into one. This PR's branch is kept, and its description still has this milestone's details and lab results.

@jwiebema1 jwiebema1 closed this Nov 18, 2026
@jwiebema1
jwiebema1 deleted the ENG-30396-sqlancer-m48 branch November 25, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant