Skip to content

ENG-30396: DIFF oracle: differential testing against the last release (milestone 20) - #20

Closed
jwiebema1 wants to merge 4 commits into
ENG-30396-sqlancer-m19from
ENG-30396-sqlancer-m20
Closed

jwiebema1 wants to merge 4 commits into
ENG-30396-sqlancer-m19from
ENG-30396-sqlancer-m20

Conversation

@jwiebema1

@jwiebema1 jwiebema1 commented Nov 9, 2026 •

Copy link
Copy Markdown

Milestone 20 of ENG-30396 (tracked in ENG-30581, epic ENG-30580 "SQL Housekeeping"): differential testing against the last release. Stacked on #19 (milestone 19), which is stacked on #18 to #1; review those first.

The nightly job runs the new oracle once VoltDB/internal#6365 is merged; VoltDB/pro#7109 starts the 16.0.0 mirror it needs in run-jenkins-sqlancer-test.sh.

Why

Every other oracle compares VoltDB with itself: a query against a rewritten form of it (NoREC, TLP), against literal values (PQS), against parameters, views, procedures or a changed schema. A wrong result that every form shares goes unseen. Comparing with another version catches what changed between the two, whichever form the query takes: a regression, a fix, or a deliberate change in behavior.

What it changes

  • --mirror host:port[,...] (provider option, VoltDBConnection): the client addresses of a second cluster, normally the last release. Every statement that changes the database (DDL, INSERT, UPDATE, UPSERT, DELETE, and the oracles' own CREATE PROCEDURE and ALTER TABLE) also runs on the mirror, so the two hold the same rows. Leftovers are dropped on both when a database name is reused.
    • A change that succeeds on one cluster and fails on the other marks the database diverged; so does a statement a node failure interrupted, as it may have committed on one side only.
  • DIFF (oracle/VoltDBDifferentialOracle): runs the same generated query on both clusters and compares the rows as multisets. The query is a SELECT of columns and expressions with a WHERE clause, or a GROUP BY query with aggregates and maybe WHERE and HAVING clauses, over the FROM clauses and joins the other oracles use.
    • FLOATs compare to 12 significant digits (a SUM of FLOATs may add in another order); exact numbers compare by value.
    • A query with an expected error on either cluster is skipped, and so is every check on a diverged database. Without --mirror, DIFF skips every check.
    • A failure hands SQLancer a reproducer, so --use-reducer can reduce it; the reduction replays the statements on both clusters.
  • run-sqlancer.sh --mirror-voltdb DIR [--mirror-license FILE] starts one node of the kit in DIR beside the cluster, on the port slot after the last node's, k=0 with the same sites per host. It passes --mirror, records the mirror's version in the manifest, saves its server log under servers/mirror, and gives up on its shutdown after 120 s, like the cluster's.
    • --mirror-java-home DIR gives the mirror its own JAVA_HOME: 16.0.0 needs Java 17 or 21 and exits at once on the Java 25 the lab agents run the cluster on. A mirror that exits stops the run at once, with the last line of its start log.
  • GEO runs on one database in four. Its four catalog updates per database (CREATE TABLE, CREATE INDEX, two DROPs) block the whole cluster. Run on every database, as in milestone 19, they cost the other oracles about 40% of their queries: locally, 150 seconds on 1 node with 4 threads made 7,724 queries without GEO, 4,481 with it on every database, and 5,958 with it on one in four.
  • The README: a DIFF section, the options, the nightly table, the bug table.

Bugs found

Ticket Issue Workaround while --avoid-known-bugs is true
ENG-30255 (already fixed after 16.0.0) GROUP BY on a DECIMAL that is NULL aborts a 16.0.0 server: NValue::hashCombine throws in the hash aggregate. DIFF found it in its first trial, on the mirror. DIFF doesn't group by a DECIMAL column.

No difference between 16.0.0 and 16.1.0-SNAPSHOT turned up in the trials or the lab run.

Testing

  • mvn verify (checkstyle, PMD, formatter) passes.

  • Local trials against 16.1.0-SNAPSHOT at internal 17c453541b with a 16.0.0 mirror, both built privately, all seventeen oracles, --use-reducer:

    • 1 node, 20 minutes: 40,630 queries, PASS.
    • 3 nodes, k=1, a random node killed every 120 seconds, 20 minutes: 9 kills, 9 rejoins, 14,054 queries, PASS.
    • DIFF alone, 2 minutes: 4,679 queries, PASS.
  • Lab:
    Lab build ENG-30396: a JDBC export target, STREAMS under node kills, and ENG-30681 (milestone 40) #39 of matrix-systemtest-apprunner-sqlancer (branch job ENG-30396-sqlancer-nightly, a replay with this milestone's Jenkinsfile and run-jenkins-sqlancer-test.sh) passed. It ran fork commit 95a239a, the head of milestone 20, with all seventeen oracles, 45 minutes per run, each beside one node of 16.0.0 (from /releases/released, on /opt/oracle_java21):

    Run Queries Node failures Result
    3 nodes, k=1, a random node killed every 300 s 72,374 8 kills, 8 rejoins PASS
    1 node 110,925 none PASS
    3 nodes, k=2, 2 sites per host 78,527 none PASS

    No failed databases, no FATAL lines in server logs, no transient results skipped (ENG-30602). With GEO on one database in four, the runs made 45%, 9% and 28% more queries than milestone 19's (ENG-30396: the XCONFLICT oracle, XDCR conflicts on purpose, and ENG-30679 (milestone 38) #37), mirror included.

    The replay before it, ENG-30396: the TASK oracle, scheduled tasks, and ENG-30680 (milestone 39) #38 (ebadf01), failed setup in every run: 16.0.0 exits at once on the agent's Java 25 ("java 17 or 21 required"), and the runs waited 300 s for it. Hence --mirror-java-home, and the stop at once when the mirror exits.

@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-m20 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