Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB migration for key rotator #3205

Merged
merged 1 commit into from
Jun 7, 2024
Merged

DB migration for key rotator #3205

merged 1 commit into from
Jun 7, 2024

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Jun 5, 2024

Supports #2147.

It's generally risky to directly add a NOT NULL column with our usual migration workflow, because older versions of Janus missing application code won't know about the new column.

Work around this by using an intermediate -infinity default for the column. This works because global_hpke_keys is not frequently used at the moment, so the window of time where someone can insert or modify rows on the old Janus version is low. Even if they do, the worst case is that the key rotator induces an early rotation of the key.

This migration blocks readers while it's applied. However, readers run in a background task to refresh their cache of this table, so it's not a big deal if they're blocked for longer.

@inahga inahga requested a review from a team as a code owner June 5, 2024 21:14
@inahga inahga force-pushed the inahga/key-rotator-migration branch from 4af144d to fef3ffe Compare June 5, 2024 21:15
@inahga inahga merged commit 461bd1a into main Jun 7, 2024
8 checks passed
@inahga inahga deleted the inahga/key-rotator-migration branch June 7, 2024 19:42
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.

3 participants