Skip to content

Add transaction-scoped locking for pooled migrations - #315

Merged
aRustyDev merged 1 commit into
mainfrom
codex/preview-migration-worker
Nov 18, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
codex/preview-migration-worker

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

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/

@aRustyDev
aRustyDev temporarily deployed to preview-control-plane November 18, 2026 18:49 — with GitHub Actions Inactive
@aRustyDev
aRustyDev merged commit 92718d3 into main Nov 18, 2026
42 checks passed
@aRustyDev
aRustyDev deleted the codex/preview-migration-worker branch November 18, 2026 19:10
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

1 inactive deployment
preview-control-plane — a8f3c528 Deployed Nov 18, 2026 by aRustyDev via reconcile #158
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