diff options
author | Christopher Baines <mail@cbaines.net> | 2021-11-07 19:29:44 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-11-07 19:29:44 +0000 |
commit | d4a262db292a8ac311ef72760c63701f7b632be4 (patch) | |
tree | 9c69e931ec6e270b5fee1e0e1b00dd796a106309 /sqitch/pg | |
parent | a4d0ec6bc564bbe98d3e6c03be41de16edbda928 (diff) | |
download | build-coordinator-d4a262db292a8ac311ef72760c63701f7b632be4.tar build-coordinator-d4a262db292a8ac311ef72760c63701f7b632be4.tar.gz |
Refactor how unprocessed builds are tracked
Previously, the allocator worked out the derived priorities for each
build. Unfortunately this is quite a complex query, and took lots of time. As
a result of this, I think the WAL could grow excessively while this long query
was running.
To try and mitigate this, add a new table to keep track of the derived
priorities for unprocessed builds. This requires some maintenance to keep up
to date, which in turn will make things like submitting builds slower, but I
think this might help keep transaction length and WAL size down overall.
Diffstat (limited to 'sqitch/pg')
3 files changed, 21 insertions, 0 deletions
diff --git a/sqitch/pg/deploy/create_unprocessed_builds_with_derived_priorities.sql b/sqitch/pg/deploy/create_unprocessed_builds_with_derived_priorities.sql new file mode 100644 index 0000000..adfda14 --- /dev/null +++ b/sqitch/pg/deploy/create_unprocessed_builds_with_derived_priorities.sql @@ -0,0 +1,7 @@ +-- Deploy guix-build-coordinator:create_unprocessed_builds_with_derived_priorities to pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/pg/revert/create_unprocessed_builds_with_derived_priorities.sql b/sqitch/pg/revert/create_unprocessed_builds_with_derived_priorities.sql new file mode 100644 index 0000000..e16cdf5 --- /dev/null +++ b/sqitch/pg/revert/create_unprocessed_builds_with_derived_priorities.sql @@ -0,0 +1,7 @@ +-- Revert guix-build-coordinator:create_unprocessed_builds_with_derived_priorities from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/pg/verify/create_unprocessed_builds_with_derived_priorities.sql b/sqitch/pg/verify/create_unprocessed_builds_with_derived_priorities.sql new file mode 100644 index 0000000..a8a5251 --- /dev/null +++ b/sqitch/pg/verify/create_unprocessed_builds_with_derived_priorities.sql @@ -0,0 +1,7 @@ +-- Verify guix-build-coordinator:create_unprocessed_builds_with_derived_priorities on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; |