Repository navigation
Forward-port 0.6.15 to main #699
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
05a334d
docs(site): stop naming a stable version that goes stale
hardbyte 1f1ea7e
docs(site): lay out the architecture diagram so labels clear its arrows
hardbyte 4c13ecb
docs(site): keep the page still when the language switch selects tabs
hardbyte 83c31d3
perf(admin): bound unfiltered receipt candidate reads (forward-port #…
hardbyte 24efbb7
ci(release): link a release's notes to the previous release, not its …
hardbyte bc7d37a
test(admin): cover admin reads of claims in installed slots beyond th…
hardbyte 0412bb9
fix(queue-storage): index compact claim batches by job id (v054, forw…
hardbyte 4e3320c
perf(insert): hold a lane lock only for the lane write in batch inser…
hardbyte f54e84f
fix(admin): keep slot-scoped receipt reads off other slots' closure p…
hardbyte 7c289f9
fix(queue-storage): let rescue reach attempts behind a batch of ambig…
hardbyte 2c5533a
fix(worker): give Completed events and follow-ups the completed job a…
hardbyte 32e30b5
test(queue-storage): require the notify holder's own lock to overlap …
hardbyte 5da3ac3
test(soak): fix harness races and over-broad oracle exemptions (forwa…
hardbyte a879b69
fix(worker): hold lifecycle hooks under the finalizer bound and cap m…
hardbyte efe6e6e
docs: describe the finalization bound in configuration and troublesho…
hardbyte 606ab4c
docs(changelog): note the 0.6.15 forward-port
hardbyte 7a9b73e
docs(readme): stop pinning a stable version in the install instructions
hardbyte b20f483
docs(skills): cover insert_many_skip_unique_conflicts and hook backpr…
hardbyte e80ceb1
docs(changelog): say the batch insert's lane lock lasts until the tra…
hardbyte 2d79135
test(release): cover later final tags and earlier-patch prereleases i…
hardbyte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| -- v054: Index compact claim batches by job id. | ||
| -- Tracking: https://github.com/hardbyte/awa/pull/684 | ||
| -- Point lookups of compact receipt claims by job id (heartbeat and progress | ||
| -- flush, completion fallbacks, receipt close, cancellation, rescue and | ||
| -- load_job) filter lease_claim_batches with job_ids && / @>, which a GIN index | ||
| -- on job_ids serves. The installer now installs | ||
| -- <schema>.ensure_claim_batch_job_index(slot) through | ||
| -- awa.refresh_claim_batch_job_index_helper and builds the index on each empty | ||
| -- claim partition; claim prune calls the function right after it truncates a | ||
| -- slot, so every partition gains the index within one claim-ring cycle. | ||
| -- | ||
| -- This file only installs the function in each queue-storage schema; it | ||
| -- builds no index. `awa migrate` and `awa migrate --sql --from 53 --to 54` run | ||
| -- V23_UP first, which defines the helper. | ||
| -- | ||
| -- A 0.6.15 database already carries the function from the 0.6 | ||
| -- claim_batch_job_index schema patch; replacing it is idempotent. | ||
| -- | ||
| -- N-1 binaries never call the function, and their by-job lookups return the | ||
| -- same rows with or without the index. Binaries that carry the indexed | ||
| -- lookups stay correct on an unindexed partition; they scan the claim batches. | ||
| -- | ||
| -- Live load: function replacement only. It takes no lock on any awa or | ||
| -- queue-storage table. Run it as the owner of the queue-storage tables, or as | ||
| -- a migrator that can SET ROLE to it, so the function is owned by the table | ||
| -- owner and can create the index. | ||
|
|
||
| DO $$ | ||
| DECLARE | ||
| v_schema TEXT; | ||
| BEGIN | ||
| FOR v_schema IN | ||
| SELECT discovered.schema_name FROM awa.queue_storage_schemas() AS discovered | ||
| LOOP | ||
| IF NOT EXISTS ( | ||
| SELECT 1 FROM pg_class AS batches | ||
| WHERE batches.oid = to_regclass(format('%I.lease_claim_batches', v_schema)) | ||
| AND batches.relkind = 'p' | ||
| ) THEN | ||
| CONTINUE; | ||
| END IF; | ||
|
|
||
| -- Serialize with a concurrent prepare_schema() of the same schema. This | ||
| -- is an advisory lock, not a table lock: claims and completions do not | ||
| -- take it. | ||
| PERFORM pg_advisory_xact_lock( | ||
| hashtextextended(format('awa.queue_storage.install:%I', v_schema), 0) | ||
| ); | ||
| PERFORM awa.refresh_claim_batch_job_index_helper(v_schema); | ||
| END LOOP; | ||
| END; | ||
| $$; | ||
|
|
||
| INSERT INTO awa.schema_version (version, description) | ||
| VALUES (54, 'Index compact claim batches by job id') | ||
| ON CONFLICT (version) DO NOTHING; |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.