Skip to content

ENG-30396: SQLancer VoltDB provider, milestone 9: UPDATE, DELETE and UPSERT - #9

Closed
jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m8from
ENG-30396-sqlancer-m9
Closed

jwiebema1 wants to merge 1 commit into
ENG-30396-sqlancer-m8from
ENG-30396-sqlancer-m9

Conversation

@jwiebema1

@jwiebema1 jwiebema1 commented Nov 6, 2026 •

Copy link
Copy Markdown

Milestone 9 of ENG-30396 (tracked in ENG-30581, epic ENG-30580 "SQL Housekeeping"): databases are built with UPDATE, DELETE and UPSERT as well as INSERT. Stacked on #8 (milestone 8), which is stacked on #7 to #1; review those first.

The nightly job runs this once VoltDB/internal#6349 merges; that PR only moves the pin to this branch's head.

Why

Until now every database was built from INSERTs alone. Rows that were updated, replaced or deleted reach the indexes and the storage by other code paths: index maintenance on changed keys, tuple replacement, and holes left by deletes. None of the oracles saw data shaped that way.

What it adds

  • gen/VoltDBUpdateGenerator: UPDATE t SET c = v [, ...] [WHERE p].
    • It sets one to three columns. Each gets a constant of its type, or an expression of its kind over the table's columns.
    • It never sets the partitioning column, since VoltDB doesn't support updating it.
    • Nine in ten have a WHERE clause, from the same generator as the queries'.
  • gen/VoltDBDeleteGenerator: DELETE FROM t [WHERE p], almost always with a WHERE clause, so a database keeps rows for the oracles.
  • UPSERT: one INSERT in ten, into a table with a primary key, is an UPSERT instead. VoltDB supports UPSERT only there.
  • Schema: VoltDBSchema reads each table's primary key from DatabaseMetaData.getPrimaryKeys.
  • Options: --max-num-updates (default 5) and --max-num-deletes (default 2), per database. The new actions run interleaved with the inserts and CREATE INDEX statements, so indexes are built both before and after rows change.
  • Expected errors for UPDATE (VoltDBErrors.addUpdateErrors):
    • CONSTRAINT VIOLATION: VoltDB checks constraints row by row, so even SET k = k + 1 on a unique k can fail.
    • The ways a new value can fail to fit its column: too wide, overflow, or a constant with a fraction set into an integer column.
  • README: the status line, how the provider maps updates and deletes, the new options, the expected errors, and the milestone 9 bugs.

Bugs found

Both are new forms of earlier bugs, added as comments, and avoided while --avoid-known-bugs is on.

Ticket What Workaround
ENG-30494 (milestone 2, comment) A BOOLEAN literal in UPDATE ... SET takes another assignment's or the WHERE clause's parameter. UPDATE t SET b1 = FALSE, b2 = TRUE WHERE k = 1 fails with "BOOLEAN can't be cast as BIGINT". A second UPDATE of the same shape fails once the first's plan is cached. 2 of 4 failed databases in the first trial. A BOOLEAN column is set to (1 = 1) or (1 = 0).
ENG-30561 (milestone 7, comment) A TIMESTAMP constant set into a DATE column, by UPDATE or INSERT, fails to plan: "has an invalid format for a constant date value", quoting the timestamp's microseconds. A TIMESTAMP column converts correctly. A DATE column is set to a date string.

Testing

  • mvn verify -DskipTests passes: formatter, checkstyle, PMD and SpotBugs.
  • Local trials:
    • SMOKE for 2 to 3 minutes, to find unexpected DML errors. Each failure was one of the two bugs above, or a value that doesn't fit its column, which is now expected. The last run passed with 13,900 statements.
    • All seven oracles, 4 minutes: 30,847 checks, PASS.
    • All seven oracles, 10 minutes, with --use-reducer, at c1537f2: 1 node, 81,289 checks, PASS; 3 nodes with k=1, 53,451 checks, PASS. UPDATE, DELETE and UPSERT statements are among those the databases ran.
  • Lab: matrix-systemtest-apprunner-sqlancer build ENG-30396: SQLancer VoltDB provider, milestone 9: UPDATE, DELETE and UPSERT #9 on jenkins-st:
    • Setup: SQLANCER_REF c1537f2 and all seven oracles given as parameters, which is the same as this branch's defaults.

    • Kit: releases/one-offs/16.1.0-SNAPSHOT-ENG-30396-sqlancer-nightly/2.

    • Agent: an apprunner-lxd6 agent (Ubuntu 22.04), JDK 25.

    • Runs: 45 minutes each, --use-reducer.

      Run Seed Checks Result
      sqlancer-3n-k1 202611061629 230,757 PASS, no FATAL lines, no node down
      sqlancer-1n-k0 202611061630 368,297 PASS, no FATAL lines

…a database

The oracles now check data that rows were updated, replaced and deleted
to reach. UPDATE sets one to three columns, never the partitioning one;
DELETE almost always has a WHERE clause; INSERT is sometimes UPSERT into
a table with a primary key, which the schema now reads from JDBC
metadata. The first trials found ENG-30494 and ENG-30561 again, through
UPDATE SET; both are avoided while --avoid-known-bugs is on.
@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-m9 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