Repository navigation
fix(storage): keep claim tombstone checks correlated (v060) - #738
Conversation
main now has its own v056 to v059, so the correlated claim tombstone migration becomes v060.
Take each schema's install advisory lock before rewriting its claim functions, as v056 and the 0.6 schema patch do, and visit functions in a stable order. The header now states the N-1 contract, live-load cost and what external runners apply. Add the upgrade guide section and expand the changelog entry.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65128db9b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Find claim_ready_runtime and each claim_ready_slot_<n> for the installed queue slots by their exact signatures, so another function that shares one of those names is left alone. The plan test plants such functions and checks that the migration does not change them.
|
@coderabbitai review Generated by Claude Code |
Action performed
|
…im-tombstones # Conflicts: # CHANGELOG.md
This carries #713 by @Wallace99 onto current
main, keeping both of their commits and authorship. 0.6 already has the same fix as #715, released in 0.6.17 through thecorrelated_claim_tombstonesschema patch.A claim marks each candidate row with an
EXISTSoverready_tombstones. For a small batch PostgreSQL can plan that check as a hashed subplan that reads the slot's whole tombstone partition on every claim, although the lookup index exists.OFFSET 0in the subquery keeps it correlated: one index probe per candidate row. The installer (v023) writes the fenced check into new substrates.The migration rewrites the claim functions already installed, from their own definitions, so signatures, owners, privileges and settings are unchanged and a function that already has the fence is left alone. On
mainthat meansclaim_ready_runtimeand every per-slotclaim_ready_slot_<n>from v051 in the default and every trusted custom queue-storage schema found byawa.queue_storage_schemas(); 0.6 has no per-slot functions and its own discovery. Each function is found by its exact signature, and slot functions only for the schema's installed queue slots, so another function that shares one of those names is not touched. Each schema's rewrite takes the schema's install advisory lock, as v056 and the 0.6 patch do. It takes no table locks and binaries before it claim unchanged.Renumbering:
maingained its own v056 to v059 since #713 was opened, so its migration becomesv060_correlated_claim_tombstones.sql(header,schema_versionrow,MIGRATIONSentry,CURRENT_VERSION = 60, and the test'smigration_sql_range(59, 60)). The merge frommaindoes the renumbering; the commits after it add the install lock, the signature filter, the header contract, the v060 upgrade guide section and a fuller CHANGELOG entry.Evidence, PostgreSQL 18.6: with the rewrite disabled,
claim_tombstone_plan_testfails because a 32-row claim scans 10,000 tombstone rows (claim_legacy: force_custom_plan must not scan tombstone partitions, left 10000, right 0). With it, the test passes for legacy and receipt modes under custom and generic plans, replay leaves the bodies unchanged, and three planted same-named functions (two overloads and a slot beyond the installed count) stay untouched.Also passing locally:
cargo fmt, workspace clippy with-D warnings, workspace build, the 16 migration unit tests,test_every_migration_is_individually_re_runnable,schema_discovery_owner_test, and 33 tombstone and claim prune tests inqueue_storage_runtime_test.Summary by CodeRabbit