Skip to content

chore: Set transaction isolation level to be SERIALIZABLE#198

Open
yuechao-qin wants to merge 1 commit intomasterfrom
ycq/chore-backfill-isolation-serialize
Open

chore: Set transaction isolation level to be SERIALIZABLE#198
yuechao-qin wants to merge 1 commit intomasterfrom
ycq/chore-backfill-isolation-serialize

Conversation

@yuechao-qin
Copy link
Copy Markdown
Collaborator

@yuechao-qin yuechao-qin commented Apr 3, 2026

TL;DR

Closes https://github.com/Shopify/oasis-frontend/issues/524

Added SERIALIZABLE transaction isolation level to have a clear error if multiple backfills are happening at the same time.

What changed?

Modified the migrate_db function to set the transaction isolation level to SERIALIZABLE when running annotation backfills. This ensures that if multiple backfill operations attempt to run simultaneously, a transaction error will be thrown to prevent conflicts.

How to test?

  1. Run database migration with annotation backfills enabled
  2. Attempt to run multiple concurrent migrations to verify that transaction errors are properly thrown
  3. Verify that single migration runs complete successfully without issues

Why make this change?

Previously, during a backfill there was a Duplicate KEY error which was ambiguous why this error occurred. Adding this isolation level will give better troubleshooting message what's happening if multiple backfills are happening.

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yuechao-qin yuechao-qin marked this pull request as ready for review April 3, 2026 18:35
@yuechao-qin yuechao-qin requested a review from Ark-kun as a code owner April 3, 2026 18:35
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