Skip to content

ENG-30396: the JAVAPROC oracle, Java stored procedures (milestone 50) - #49

Closed
jwiebema1 wants to merge 5 commits into
ENG-30396-sqlancer-m49from
ENG-30396-sqlancer-m50
Closed

jwiebema1 wants to merge 5 commits into
ENG-30396-sqlancer-m49from
ENG-30396-sqlancer-m50

Conversation

@jwiebema1

Copy link
Copy Markdown

Why

Every procedure the other oracles create is one SQL statement in DDL. So milestone 49's coverage found the rest of VoltDB's procedure support never run:

  • compound procedures: CompoundProcedureRunner 0 of 183 lines, VoltCompoundProcedure 0 of 35;
  • @UpdateClasses and its checks: UpdateClassesAcceptancePolicy 2 of 23;
  • the procedure compiler's class paths: ProcedureCompiler 108 of 477, CreateProcedureFromClass 5 of 39;
  • the multi-batch, abort and expectation paths of ProcedureRunnerImpl.

What it changes

  • A JAVAPROC oracle (VoltDBJavaProcedureOracle). Each check writes the Java source of a single-partition, a multi-partition, a compound and a non-transactional procedure class, compiles them in SQLancer's JVM against the kit's jars, loads them with @UpdateClasses and creates the procedures FROM CLASS. Then:
    • calls with every key new, so the rows a call must leave are known. A successful call returns its class's version and leaves all its rows. One that aborts, throws, fails an expectation or violates the primary key ends with its status and leaves none: its transaction rolled back whole, across partitions for the multi-partition one;
    • compound procedures checked per call they make, through every way a compound procedure ends: completes with a number or a table, aborts, throws, never completes, calls itself, queues too many calls, or completes with a call still queued, which must never be sent;
    • a call a node failure interrupts must have committed whole or not at all;
    • then the classes replaced by a new version, or a change VoltDB must refuse: removing the class of a procedure in use, a class whose static initializer throws, a procedure made from the wrong kind of class, a bad partition parameter. In the end the procedures are dropped, and the classes are removed and no longer listed.
  • --procedure-classpath, which run-sqlancer.sh sets to the kit's procedure API, server and client jars. The classes also go to the mirror and the XDCR peer, where the provider repeats the DDL.
  • run-coverage.sh runs JAVAPROC in every run, and the summary has a JAVAPROC line.
  • Reproductions: repros/ENG-30710.sh (with repros/users/RemovedUserRepro.java) and repros/ENG-30711.sh.
  • README: a JAVAPROC section, ENG-30708, ENG-30710 and ENG-30711 among the known bugs, and the status now says milestone 50.

On the job side (VoltDB/pro#7150, VoltDB/internal#6474), JAVAPROC joins the default oracles, and the Jenkinsfile pins this branch's head.

Bugs found

Ticket Priority Bug Workaround
ENG-30710 Critical A user removed by @SetYamlConfiguration still logs in when an @UpdateClasses runs at the same time. @GetYamlConfiguration no longer lists the user, but the update applies with the catalog unchanged (securityChange=false). Found by LOGIN beside JAVAPROC in lab build sqlancer#64's security run. 16.0.0 too. repros/ENG-30710.sh reproduces it at the first user, and not without the @UpdateClasses loop. While avoiding known bugs, JAVAPROC's @UpdateClasses calls hold the lock LOGIN and CONFIG share.
ENG-30711 Major @UpdateClasses restarts a task that ON ERROR STOP stopped: it shows RUNNING and runs its procedure again. An ordinary DDL change does not. Found by TASK beside JAVAPROC in lab build sqlancer#65's security run. 16.0.0 too. repros/ENG-30711.sh. While avoiding known bugs, TASK's checks and JAVAPROC's @UpdateClasses calls exclude each other (a read-write lock).
ENG-30708 Blocker During an elastic join, the join's own index snapshot failed on some partitions, and the join stayed at "Building index for data migration". The next command-log truncation snapshot was refused ("COW context activation is not allowed while elastic indexing is in progress"), and every original node crashed ("Failed to activate snapshot stream"). Found by run-coverage.sh's resize run; not reduced. None.

The resize rerun under coverage also turned up a restore that, right after a shrink, left out rows that collide with nothing. It is not reproduced alone yet and not filed.

Coverage (run-coverage.sh's 10-minute kill run, against the best of milestones 44 to 49)

Class Before Milestone 50
CompoundProcedureRunner 0 of 183 143 of 183
VoltCompoundProcedure 0 of 35 31 of 35
ProcedureCompiler 108 of 477 296 of 477
UpdateApplicationBase 193 of 378 249 of 378
NTProcedureService 137 of 236 187 of 236
ClassMatcher 7 of 84 32 of 84
CreateProcedureFromClass 5 of 39 27 of 39
UpdateClassesAcceptancePolicy 2 of 23 16 of 23
InMemoryJarfile 146 of 269 173 of 269

In all, 813 lines more in 38 classes.

Testing

  • Local trials, each passed:
    • JAVAPROC alone on 1 node: 48 to 51 checks per 90 s;
    • with TASK and STATS on 3 nodes, k=1, a kill every 60 s for 5 minutes: 49 checks, 191 calls, 2 kills and 2 graceful stops;
    • beside XDCR: 74 checks, 309 calls;
    • beside DIFF with a 16.0.0 mirror: 78 checks, 290 calls.
  • Coverage run: the kill run passed.
  • mvn verify -DskipTests passes.
  • Lab: branch job ENG-30396-sqlancer-nightly of matrix-systemtest-apprunner-sqlancer, replays against 16.1.0-SNAPSHOT (master kit 400), all thirty-three oracles:
    • Build Integrate TiDB into the Travis CI gate sqlancer/sqlancer#64, fork ac02df9 (this branch's first commit), 30 minutes per run:
      • kill run (3:1:300): passed, 213 JAVAPROC checks and 833 calls (362 single-partition, 240 multi-partition, 231 compound), 346 failures checked;
      • upgrade run (3:1:u, from 16.0.0 in service, 3 of 3 nodes upgraded): passed, 243 checks and 970 calls;
      • security run (1:0:sec): failed, three removed users logged in. That is ENG-30710, now avoided.
    • Build Integrate CockroachDB into the Travis CI gate sqlancer/sqlancer#65, fork 2ec6142, the security run alone, 45 minutes: LOGIN passed 218 checks, but TASK failed twice, a stopped task showing RUNNING. That is ENG-30711, now avoided.
    • Build Also test with JDK13 sqlancer/sqlancer#66, fork 31bf749, this branch's head, the security run alone, 45 minutes: passed. 191 JAVAPROC checks and 779 calls; 191 LOGIN checks with 383 logins accepted and 654 refused; 127 TASK checks, 65 of them on stopped tasks; no failed database, no FATAL line.
  • Local controls: TASK beside JAVAPROC for 5 minutes fails twice with --avoid-known-bugs false and passes without it. LOGIN beside JAVAPROC for 5 minutes, with the same seed, failed 3 databases before the ENG-30710 workaround and passed after it.

Each check compiles single-partition, multi-partition and compound procedure
classes in SQLancer's JVM against the kit's jars (--procedure-classpath, which
run-sqlancer.sh sets), loads them with @UpdateClasses and creates the
procedures FROM CLASS. Calls must return and leave exactly their rows, roll
back whole when they fail (abort, exception, expectation, constraint), and a
call a node failure interrupts must have committed whole or not at all.
Compound procedures are checked per JPS call, for every completion path,
abort, failure, nested call, too many calls and dropped calls. Then classes
are replaced, or VoltDB must refuse removing a class in use, a class whose
initializer throws, the wrong kind of class, or a bad partition parameter.
The classes also go to the mirror and the XDCR peer. run-coverage.sh runs it.
… known bugs

JAVAPROC's local trials, lab build sqlancer#64's kill run and run-coverage.sh's kill
run. ENG-30708: a resize run's elastic join whose index snapshot failed, after
which a truncation snapshot crashed every node; not reduced, no workaround.
The project's formatter, the import grouping checkstyle wants, and the names
PMD wants (singlePartition, multiPartition; no reassigned parameter). No change
in behavior.
…e 50)

Lab build sqlancer#64's security run failed: a user LOGIN removed with
@SetYamlConfiguration still logged in. A user change that races an
@UpdateClasses reaches the deployment but not the catalog (ENG-30710, 16.0.0
too). repros/ENG-30710.sh reproduces it at the first user, and not without the
@UpdateClasses loop (CONTROL=1). While avoiding known bugs, JAVAPROC's
@UpdateClasses calls hold the lock LOGIN and CONFIG share.
…e 50)

Lab build sqlancer#65's security run failed in TASK: a task ON ERROR STOP stopped
showed RUNNING again. @UpdateClasses restarts every task, the stopped one
included, which runs its procedure again (ENG-30711, 16.0.0 too); an ordinary
DDL change does not. repros/ENG-30711.sh reproduces it. While avoiding known
bugs, TASK's checks hold a read lock and JAVAPROC's @UpdateClasses calls the
write lock. Locally, TASK beside JAVAPROC fails twice in 5 minutes without the
lock and passes with it.
@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-m50 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