Skip to content

ENG-30396: the TTL oracle, TTL and MIGRATE TO TARGET (milestone 34) - #33

Closed
jwiebema1 wants to merge 7 commits into
ENG-30396-sqlancer-m33from
ENG-30396-sqlancer-m34
Closed

jwiebema1 wants to merge 7 commits into
ENG-30396-sqlancer-m33from
ENG-30396-sqlancer-m34

Conversation

@jwiebema1

Copy link
Copy Markdown

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

Why

Milestone 30's coverage run found the system procedures that remove rows on VoltDB's own initiative never run: LowImpactDeleteNT (2 of 108 lines), MigrateRowsNT (2 of 109) and TTLManager (25 of 132). Clients cannot call these procedures, so the only way to exercise them is through SQL: USING TTL and MIGRATE TO TARGET.

What it changes

  • The TTL oracle. Each database gets a table XT_ (k, ts, v) USING TTL 2 SECONDS ON COLUMN ts with a random BATCH_SIZE and MAX_FREQUENCY.
    • Each check inserts rows that are already expired, or live for another day.
    • Within 60 s every expired row must be gone, and every live row must still be there.
  • Migration. A table XM_ ... MIGRATE TO TARGET with a shadow table.
    • Each check runs MIGRATE FROM ... WHERE k < x AND NOT MIGRATING.
    • With --loopback-target, the migrated rows come back into XS_LB. The table's rows and XS_LB's rows must together equal the shadow table's, with no row in both.
    • Without that target, the migrated rows must stay in the table, marked MIGRATING.
  • TTL with migration (--ttl-migrate-target; --export adds the loopback target sqlancer_lbt). Half of the TTL checks use a table that migrates its expired rows rather than deleting them. Those rows must reach XS_LBT, and no live row may.
    • Its index on ts is WHERE NOT MIGRATING. A TTL table that migrates finds its expired rows only through such an index; with an ordinary index it never migrates them.
  • Where statements fail. A failed statement (a node failure, as with STREAMS) stops that table's checks for the rest of the run. There are no migration checks in XDCR runs.
  • Runners and README. run-coverage.sh runs TTL, and the README documents the oracle.

Bugs found

None.

Coverage (master bf8602e3, run-coverage.sh's export run, 20 minutes, every oracle)

Class Milestone 30 (seven runs together) This milestone
TTLManager 25 of 132 107 of 132
LowImpactDeleteNT 2 of 108 77 of 108
MigrateRowsNT 2 of 109 72 of 109
MigrateRowsBase 4 of 108 76 of 108

Testing

  • Local trials (macOS, master):
    • 1 node, 5 minutes: 892 TTL checks and 880 migration checks.
    • 3 nodes, k=2, --export: 110 and 105 checks, with the migrations going through the loopback target.
    • With the migrating TTL tables: 294 TTL and 307 migration checks.
  • 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.

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