Repository navigation
Add transaction-scoped locking for pooled migrations - #315
Merged
Merged
Conversation
aRustyDev
temporarily deployed
to
preview-control-plane
November 18, 2026 18:49 — with
GitHub Actions
Inactive
Merged
aRustyDev
added a commit
that referenced
this pull request
Nov 18, 2026
Main moved once more while the previous merge was being tested: #315 (transaction-scoped migration locking) changed crates/adapters/postgres/src/lib.rs and the ledger test of the selfhosted adapter. It merges without a conflict: this branch's change to those files is the twentieth entry of the migration list and nothing in the locking code. The Postgres-affecting checks and the Worker build are re-run on this merge commit before it is pushed (see the pull request). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hyperdrive transaction pooling does not support session advisory locks: a lock may remain on a pooled connection. Add a migration mode that takes a transaction-scoped advisory lock and applies the invocation atomically, while preserving the native runner’s existing per-file transactions. Add real-Postgres tests for rollback at every file position, concurrent baselines, contract refusal and lock release.
This API accepts trusted SQL only; a future PR migration endpoint must prevent transaction-control statements or otherwise establish trust before using it. Validation: 165 hermetic Postgres tests, native clippy, format, provisioner wasm check; the new real-Postgres tests compile and are awaiting the Docker-backed CI job. Cloudflare reference: https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/