-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(coprocessor): implement a retry mechanism for pbs computations #1245
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
base: main
Are you sure you want to change the base?
Changes from all commits
5af2894
dd07f2f
2876e4b
4a1bdf1
606bb8e
7e7c3a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| -- Add migration script here | ||
| BEGIN; | ||
| -- Lock the table to ensure the backfill of schedule_order is safe | ||
| LOCK TABLE pbs_computations IN ACCESS EXCLUSIVE MODE; | ||
|
|
||
| ALTER TABLE pbs_computations | ||
| ADD COLUMN IF NOT EXISTS error TEXT, | ||
| ADD COLUMN IF NOT EXISTS schedule_order TIMESTAMPTZ DEFAULT NOW(); | ||
|
|
||
| -- Backfill existing rows | ||
| UPDATE pbs_computations | ||
| SET schedule_order = created_at | ||
| WHERE schedule_order IS NULL; | ||
|
|
||
| -- enforce not-null after backfill | ||
| ALTER TABLE pbs_computations | ||
| ALTER COLUMN schedule_order SET NOT NULL; | ||
| COMMIT; | ||
|
|
||
| -- Partial index for unfinished rows ordered/filtered by created_at | ||
| CREATE INDEX IF NOT EXISTS idx_pbs_comp_unfinished_created_at | ||
| ON pbs_computations (schedule_order, created_at) | ||
| WHERE is_completed = FALSE; |
Uh oh!
There was an error while loading. Please reload this page.