Skip to content

ENG-30396: VoltDB provider, milestone 2: NoREC oracle - #2

Closed
jwiebema1 wants to merge 3 commits into
ENG-30396-sqlancer-m1from
ENG-30396-sqlancer-m2
Closed

jwiebema1 wants to merge 3 commits into
ENG-30396-sqlancer-m1from
ENG-30396-sqlancer-m2

Conversation

@jwiebema1

Copy link
Copy Markdown

Milestone 2 of ENG-30396: the VoltDB provider runs SQLancer's NoREC logic-bug oracle, with an expected-errors list tuned so that false positives are rare. Stacked on #1 (milestone 1); review that first.

What it adds

  • Expression generator (gen/VoltDBExpressionGenerator) and AST nodes (ast/). It builds predicates from columns and constants with AND, OR, NOT, the comparisons, BETWEEN, IN, LIKE, IS [NOT] NULL, + - * /, || and ABS. Joins follow partitioning: partitioned tables join the first partitioned table on their partitioning columns, and replicated tables are in the FROM list or joined explicitly.
  • --oracle NOREC, now the default.
  • Expected errors (VoltDBErrors), each with the reason it cannot be avoided: arithmetic overflow and division by zero (at run time and in folded constants), and join filters that fold to constants.
  • --avoid-known-bugs (default true) keeps the generator away from each VoltDB bug listed below, so a failure is something new. Set it to false to check a fix.
  • The README covers NoREC, the generator's rules and the known-bugs table. There is also a NoREC JUnit test.

Bugs found

All are filed in ENG, linked to ENG-30396, and have a minimal reproduction in the ticket.

Wrong results:

  • ENG-30497: an outer join is turned into an inner join.
  • ENG-30507: an outer join with WHERE IN on an indexed column.
  • ENG-30509: a multi-column index range on VARCHAR(n) compares only the first n characters of a longer key.
  • ENG-30510: a RIGHT JOIN uses its ON condition as the preserved table's index range.
  • ENG-30511: an out-of-range join key on a narrower integer index matches every row.
  • ENG-30512: INDEX COUNT returns a negative count for an empty range.
  • ENG-30513: FLOAT compared with a DECIMAL of magnitude 2^63 or more.
  • ENG-30514: a NULL in a primary key column, which the planner treats as NOT NULL.
  • ENG-30515: INDEX COUNT misses the type's maximum.
  • ENG-30516: c IS NULL AND c = 5 drops the IS NULL.
  • ENG-30493, ENG-30494, ENG-30500, ENG-30502, ENG-30503: BOOLEAN ordering, BOOLEAN literals, NULL handling in IN, unary minus on NULL.

Errors and crashes: ENG-30495, ENG-30496, ENG-30499, ENG-30504, ENG-30505, ENG-30506, ENG-30508.

Re-found: ENG-12656, still open (a VARBINARY index key longer than the column; comments added).

Testing

  • mvn verify -DskipTests passes: formatter, checkstyle, PMD, SpotBugs.
  • 30-minute NoREC run against a local single-node 16.1.0-SNAPSHOT server (8 sites per host), 4 threads, seed 20261102: exit 0, no failures, 112,694 checks.
  • TestVoltDB (SMOKE and NOREC) compiles but was not run here. It targets localhost:21212, which was in use by another server.

Not in this PR

TLP WHERE (milestone 3), and running on the lab.

Adds a typed expression generator, the VoltDB AST and NoREC oracle wiring.
Joins between partitioned tables are on their partitioning columns.
--avoid-known-bugs (default true) keeps the generator away from VoltDB
bugs filed so far: ENG-30493, ENG-30494, ENG-30495, ENG-30496,
ENG-30497, ENG-30499, ENG-30500, ENG-30502, ENG-30503, ENG-30504.
…unds

Steers the expression generator away from the VoltDB bugs NoREC found, so
that a failure is something new (--avoid-known-bugs, default true):

- ENG-30504: NOT is never applied directly to OR
- ENG-30505, ENG-30509: string constants and LIKE literal prefixes are at
  most one character; strings are not compared with <, >, <=, >= or BETWEEN
- ENG-12656: VARBINARY constants are one byte, VARBINARY comparisons have a
  constant on one side and are never ordered
- ENG-30497: IS NULL operands are leaves with an outer join, on every path
- ENG-30506: function calls are printed in parentheses
- ENG-30507: no IN predicates with an outer join
- ENG-30508: the planner's internal error for a constant DECIMAL IN join
  filter is an expected error
- ENG-30510: no RIGHT JOIN

Partition joins use only the partitioning-column equality, which VoltDB
needs to see to plan them. DECIMAL overflow in folded constants is an
expected error. Adds a NoREC JUnit test and the milestone 2 README.
Workarounds for the bugs the 30-minute NoREC runs found, all under
--avoid-known-bugs:

- ENG-30511, ENG-30515: ordered numeric comparisons and BETWEEN compare
  with constants between -126 and 126
- ENG-30512: BETWEEN bounds are constants in ascending order
- ENG-30513: a numeric comparison, BETWEEN or IN uses only FLOAT or only
  exact operands
- ENG-30514: primary key columns are NOT NULL
- ENG-30516: IS NULL is written NOT (x IS NOT NULL)
- ENG-12656: VARBINARY partitioning columns are joined only when their
  sizes match

Also expects "data exception: division by zero" from folded constants.
A 30-minute NoREC run (4 threads, seed 20261102) is clean: 112,694
checks, no failures.
@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-m2 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