Skip to content

vitess: add vschemas with vindexes#8634

Open
jsha wants to merge 12 commits intomainfrom
vschemas-and-vindexes
Open

vitess: add vschemas with vindexes#8634
jsha wants to merge 12 commits intomainfrom
vschemas-and-vindexes

Conversation

@jsha
Copy link
Contributor

@jsha jsha commented Feb 19, 2026

In order to exercise sharding logic in Vitess, we need our integration test environment to use sharded keyspaces, which means we need to use vindexes. This PR enables vindexes and changes DB initialization in support. It does not yet shard the keyspaces since doing so causes some consistency issues I still need to debug.

DB initialization changes:

  • Stop using sql-migrate inside the boulder container.
  • Make the bmariadb and bvitess containers responsible for applying schemas when they start up.
  • Use different database / keyspace names for different test environments: boulder_sa / boulder_sa_next. This allows the two to coexist, which means we don't need to down --volumes the bmariadb container when running locally and switching from ./tn.sh to ./t.sh.
  • The bmariadb image has support for applying SQL schemas from a directory. Use that. The vttestserver has support for applying SQL schemas and vschemas from a directory.

Foreign keys: we had one foreign key constraint (serials.registrationID -> registrations), but we probably don't actually want this in the Vitess world. It makes things more complicated with no benefit. I removed it from the SQL schemas.

test/db.go: In vttestserver we can't delete more than 10k rows, so I changed deleteEverythingInAllTables to delete in a loop. Incidentally I cleaned up some stuff about foreign keys and 1 = 1 that is no longer needed. Also, I changed deletion calls in sa_test.go to use the shared deletion functions.

Deletion from overrides was failing under this setup with Error 1105 (HY000): VT09015: schema tracking required. I concluded this was because the table had no primary key. I changed its UNIQUE KEY to a PRIMARY KEY.

test/vars/vars.go: calculate DSNs based on the BOULDER_CONFIG_DIR variables, to select between boulder_sa and boulder_sa_next (etc.).

@jsha jsha marked this pull request as ready for review February 27, 2026 04:58
@jsha jsha requested a review from a team as a code owner February 27, 2026 04:58
@jsha jsha requested a review from aarongable February 27, 2026 04:58
@github-actions
Copy link
Contributor

@jsha, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

1 similar comment
@github-actions
Copy link
Contributor

@jsha, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

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