Skip to content

ENG-30396: the SNAPSHOT oracle, and ENG-30676, ENG-30677 and ENG-30678 (milestone 37) - #36

Closed
jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m36from
ENG-30396-sqlancer-m37
Closed

jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m36from
ENG-30396-sqlancer-m37

Conversation

@jwiebema1

Copy link
Copy Markdown

Milestone 37 of ENG-30396 (tracked in ENG-30581, epic ENG-30580 "SQL Housekeeping"). Stacked on #35; review that and the PRs below it first.

Why

Milestone 30's coverage run found the snapshot code exercised little beyond what recovery uses: SnapshotRestore 802 of 1,518 lines, SnapshotUtil 439 of 852, TableSaveFile 268 of 518. Restoring with a duplicates path, CSV snapshots, @SnapshotScan and @SnapshotDelete never ran.

What it changes

  • The SNAPSHOT oracle. Each check works on a table of its own.
    • Save. The table is saved alone, as a native blocking snapshot. A third of the time it is also saved as CSV, whose files must hold the table's rows.
    • Restore into the emptied table. The table must get back exactly the rows that were saved.
    • Restore into the table as it is, with a duplicates path. The restore must add the saved rows that collide with none already there, and write the others to the duplicates files.
    • Scan and delete. @SnapshotScan must list the snapshot, and @SnapshotDelete removes it.
  • Where snapshots go. Each node writes to its own directory (SNAP_AUTO), because run-sqlancer.sh's nodes share a machine and in one directory they refuse each other's nonce. --snapshot-path names the cluster directory, where the oracle reads the files.
  • Counting rows. Rows are counted as distinct, since every replica writes its duplicates.
  • Queued saves. A save that VoltDB queues behind another snapshot is awaited through @Statistics SNAPSHOTSTATUS. run-sqlancer.sh sets USER_SNAPSHOT_RETRY_INTERVAL to 1 s; SQLANCER_USER_SNAPSHOT_RETRY overrides it. Checks take turns.

Bugs found

Ticket Issue Workaround while --avoid-known-bugs is true
ENG-30676 @SnapshotRestore of a table while a node rejoins wedges the cluster for good: sites wait in SnapshotRestore.executePlanFragment, and the rejoin never completes. Reproduction: voltdb/repros/ENG-30676.sh. Hang, Blocker. A restore waits on --ddl-hold's file, so it never overlaps a kill.
ENG-30677 Writes to the replicated side of a join view crash the server (SIGSEGV in ReplicatedMaterializedViewHandler) while @SnapshotRestore and DDL run on other tables. Reproduction: voltdb/repros/ENG-30677.sh. Server crash, Blocker. No DDL runs during a restore (a lock in VoltDBConnection).
ENG-30678 After a node rejoins, @SnapshotRestore with duplicatesPath leaves the duplicate rows out of the table and writes none of them to the duplicates files. Reproduction: voltdb/repros/ENG-30678.sh. Major. Where nodes fail, the duplicates files are not counted.

Coverage (run-coverage.sh, master bf8602e3, every oracle)

Milestone 41's coverage run, which included SNAPSHOT: SnapshotRestore 904 of 1,426 lines.

Testing

  • Local trials: 3 nodes, k=1, with and without kills. Each of the three bugs was found this way and reduced to its reproduction script.
  • The runner reports all three reproductions still broken.
  • mvn verify passes.
  • Lab: builds Add random seed to log sqlancer/sqlancer#56 and Log the random seed value sqlancer/sqlancer#57 of matrix-systemtest-apprunner-sqlancer (branch job ENG-30396-sqlancer-nightly, replays with these settings). They ran 16.1.0-SNAPSHOT (master kit 400) beside one node of 16.0.0, 45 minutes per run, with all thirty-one oracles.
    • Build Add random seed to log sqlancer/sqlancer#56 ran fork 585fbb8, milestones 34 to 43 before the last fix.
      • Reproductions: 84 still broken. ENG-30611 reports fixed, and the ticket is closed as fixed in V16.1.0.
      • Kill (3 nodes, k=1, a kill every 300 s): 8 kills, 8 rejoins.
      • Security (1 node, over TLS): PERMS checked 153 allowed and 174 refused statements; TASK made 286 checks.
      • Export with a kill every 300 s (3 nodes, k=2): all 4,617 rows exported, 1,240 through HTTP and 1,120 through JDBC (one twice).
      • Resize every 120 s: 10 grows, 9 shrinks.
      • XDCR: 340 XCONFLICT checks and 115 databases compared after convergence. 24 differing keys had no divergence logged; that is ENG-30679, counted rather than failed.
      • Crash every 600 s: 4 crashes, 4 recoveries.
      • Upgrade from 16.0.0 failed. A node being stopped for its upgrade refused DDL. The next fork commit handles this; see milestone 43.
    • Build Log the random seed value sqlancer/sqlancer#57 ran the upgrade run alone on fork e0cadfe, the head: 3 of 3 nodes upgraded, 414 TASK checks, 612 STATS calls and 15,923 primary key indexes checked.
    • Earlier builds: ENG-30789: the SQLCMD oracle: queries through sqlcmd as well as JDBC (milestone 58) #53 to Bump maven-surefire-plugin from 2.19.1 to 2.22.2 sqlancer/sqlancer#55 ran earlier heads of this stack. Their failures led to ENG-30682, ENG-30683, the ENG-30679 changes, the run-repros.sh port wait and TASK's timing fix.

…8 (milestone 37)

Milestone 30's coverage run found the snapshot save and restore code little
exercised beyond recovery. SNAPSHOT saves a table of its own alone (native,
blocking; a third of the time also CSV, whose files must hold its rows), changes
it, and restores it: into the emptied table, which must get back the rows saved,
or into the table as it is with a duplicates path, which must add the saved rows
that collide with none there and write the others to the duplicates files.
@SnapshotScan must list the snapshot; @SnapshotDelete removes it.

Snapshots go to each node's own directory (SNAP_AUTO): run-sqlancer.sh's nodes
share a machine, and in one directory they refuse each other's nonce;
--snapshot-path is the cluster directory, where the oracle reads the files.
Rows are counted as distinct (every replica writes its duplicates). A save that
VoltDB queues behind another snapshot is awaited (@statistics SNAPSHOTSTATUS),
and run-sqlancer.sh sets USER_SNAPSHOT_RETRY_INTERVAL to 1 s
(SQLANCER_USER_SNAPSHOT_RETRY overrides it). Checks take turns.

Bugs, each with a reproduction script:
- ENG-30676 (Blocker, hang): a restore while a node rejoins wedges the cluster;
  while avoiding known bugs, a restore waits on --ddl-hold's file.
- ENG-30677 (Blocker, crash): writes to a join view's replicated table crash
  the server while a restore and DDL run at once; while avoiding known bugs, no
  DDL runs during a restore (a lock in VoltDBConnection).
- ENG-30678 (Major): after a rejoin, a restore's duplicates are written to no
  file; while avoiding known bugs and nodes fail, the files are not counted.
@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-m37 branch November 25, 2026 13:44
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