Commit graph

357 commits

Author SHA1 Message Date
6ada1cb845 Guard against divide by 0 in update-derivation-outputs-statistics 2022-11-28 13:17:20 +00:00
1a0c5599eb Do derivation inputs and outputs housekeeping at the end of each job
This should help with query performance, as the recursive queries using
derivation_inputs and derivation_outputs are particularly sensitive to the
n_distinct values for these tables.
2022-11-28 11:36:12 +00:00
2cf187f10b Fix calling insert-blocked-builds 2022-11-20 15:44:30 +00:00
c46ee47632 Make backfilling blocked_builds a bit smarter
And drop the chunk size.
2022-11-12 11:53:14 +00:00
ed114265cd Handle deleting from blocked_builds when builds are scheduled
As scheduling a build might unblock others.
2022-11-12 11:42:26 +00:00
b9305d81a4 View scheduled builds like succeeded builds in terms of blocking
This means that an output is viewed to not be blocking if it has a scheduled
build, just as if it has a succeeded build. Also, scheduling builds will
unblock blocked builds.

This is helpful as it means that it reduces noise for blocking builds.
2022-11-12 11:33:37 +00:00
7731c6f340 Tweak backfilling the blocked builds 2022-11-12 10:57:53 +00:00
8e9ab68d14 Use latest_build_status rather than build_status
In various places in the blocked-builds module.
2022-11-12 10:57:26 +00:00
48d8ee885a Have insert-blocked-builds cache when the partitions exist
To make it more efficient.
2022-11-11 11:29:45 +00:00
0f22e3ab40 Rework insert-blocked-builds to make it more efficient
This also fixes a typo in the partition name.
2022-11-11 11:29:37 +00:00
4101c6b897 Stop using exception handling when inserting blocked_builds entries
As it doesn't work in a transaction.
2022-11-11 10:51:12 +00:00
989916b740 Add a blocking builds page 2022-11-11 10:35:09 +00:00
1fb291be40 Add support for incrementally tracking blocked builds
This will hopefully provide a less expensive way of finding out if a scheduled
build is probably blocked by other builds failing or being canceled.

By working this out when the build events are recieved, it should be more
feasible to include information about whether builds are likely blocked or not
in various places (e.g. revision comparisons).
2022-11-11 10:35:09 +00:00
78a5abee21 Improve chunking when inserting derivation inputs
Chunk the values inserted in the query, rather than the derivations involved,
as this is more consistent.
2022-09-17 08:53:23 +02:00
7050ea749f Reduce some chunk sizes 2022-09-17 00:40:51 +02:00
8ef896b103 Further reduce some chunk sizes 2022-09-15 16:25:31 +02:00
37e8af60fb Chunk the data for some queries in insert-missing-data-and-return-all-ids
This helps to avoid queries getting logged as slow just because of the amount
of data.
2022-09-15 09:18:19 +01:00
d791c2bd8a Format some queries generated in insert-missing-data-and-return-all-ids 2022-09-14 15:42:16 +01:00
f41bfcf8b6 Reduce some chunk sizes
As these queries are still slow enough to be logged.
2022-09-14 15:42:00 +01:00
e3062abf33 Speed up finding the locales for a revision 2022-09-14 10:26:03 +01:00
12af30c039 Reduce chunk size for inserting dervation inputs
As this query can take some time.
2022-09-14 09:48:59 +01:00
77c4e1cb63 Reduce the chunk size for querying related derivation ids
And include the chunk size in the log message.
2022-09-13 21:00:04 +01:00
ad39492cf0 Support per repository configuration for fetching substitutes
This is so that data.qa.guix.gnu.org can be configured only to query the
branches from the main repository.
2022-09-09 12:39:38 +01:00
788571f53f Set builds derivation output details set id if information available
The build event information can now contain the derivation outputs, as well as
the name of the derivation. This allows the Guix Data Service to join builds
up with derivations, even if it doesn't know about the derivation being built.
2022-07-08 13:48:08 +01:00
6da5e8e67b Sort derivation output details ids
To ensure that direct array comparison can be used in the query.
2022-07-08 13:47:52 +01:00
db37d9f6a8 Split out inserting derivation output details sets
So that this can be used when inserting builds.
2022-07-08 13:47:52 +01:00
811256a920 Split out inserting into derivation_output_details
So that this can be done when inserting builds.
2022-07-08 13:47:52 +01:00
5b82be803c Fix the select-guix-revision-for-branch-and-datetime query
I think it was broken with the git_branches/git_commits switch.
2022-05-30 23:29:42 +01:00
786a5fa041 Improve the package derivation by guix revision range insert queries 2022-05-26 00:23:56 +01:00
e0f5ad3f51 Add missing comma in query 2022-05-24 13:56:48 +01:00
b73cfa5d49 Fix delete-guix-revision-package-derivation-entries
For the table schema change.
2022-05-24 12:22:52 +01:00
512b43ec73 Fix expected exec-query value when no branch exists 2022-05-24 08:43:32 +01:00
d4bb0ffaaa Fix more issues with the git_commits introduction 2022-05-23 22:49:51 +01:00
6d403cbc8d Allow filtering package derivations based on build server builds
This means you can query for derivations where builds exist or don't exist on
a given build server.

I think this will come in useful when submitting builds from a Guix Data
Service instance.
2022-05-23 22:39:32 +01:00
40035bcf9a Fix more of rebuilding one of the tables 2022-05-23 21:18:59 +01:00
3596eceed5 Add missing git_branches query part to insert query 2022-05-23 20:22:54 +01:00
64be52844e Partition the package_derivations_by_guix_revision_range table
And create a proper git_branches table in the process.

I'm hoping this will help with slow deletions from the
package_derivations_by_guix_revision_range table in the case where there are
lots of branches, since it'll separate the data for one branch from another.

These migrations will remove the existing data, so
rebuild-package-derivations-table will currently need manually running to
regenerate it.
2022-05-23 19:10:25 +01:00
9607bcedfe Move the builds.derivation_output_details_set_id update
To the end of the main revision processing transaction.

Currently, I think there are issues when this query does update some builds,
as those rows in the build table remain locked until the end of the
transaction. This then causes build event submission to hang. Moving this part
of the revision loading process to the end of the transaction should help to
mitigate this.
2022-04-16 18:47:54 +01:00
097e22ab5e Close the load revision inferior prior to inserting data
This means that the lock can be acquired after closing the inferior, freeing
the large amount of memory that the inferior process is probably using.
2022-03-11 13:27:55 +00:00
df4e0a7a61 Add to the hardcoded list of valid targets
Since the hardcoded list in the load-new-guix-revision code has been updated.
2022-03-11 11:50:10 +00:00
Maxime Devos
8ab72e633a Include the nl_NL.UTF-8 locale when processing revisions
It's 100% translated according to
<https://translate.fedoraproject.org/projecs/guix/guix/nl/>.

* guix-data-service/model/package-metadata.scm
  (locales): Add nl_NL.utf-8

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-03-02 21:05:30 +00:00
f86657915e Try to further speed up inserting missing derivation source files
Switch from using a recursive query to doing a breath first search through the
graph of derivations, as I think PostgreSQL wasn't doing a great job of
planning the recursive queries (it would overestimate the rows involved, and
prefer sequential scans for the derivation_outputs table).
2022-03-02 18:00:36 +00:00
c5b504e94a Speed up the finding of missing sources
Use larger batches and more efficient duplicate deletion.
2022-03-01 20:57:26 +00:00
f1418c4e88 Support querying package derivation outputs without the nars
Since this speeds up the response if you don't need the nar information.
2022-01-31 20:24:27 +00:00
11ec8a8064 Make the revision derivation counts numbers 2022-01-22 18:47:38 +00:00
a7c9daab6a Process derivations in chunks
Which should reduce the peak memory usage.
2022-01-14 15:25:53 +00:00
5ae8b796a7 Rename chunk-map! to chunk-for-each!
As that better reflects what it does.
2022-01-14 15:25:13 +00:00
21cb33a859 Re-write insert-derivation-inputs in a more memory efficient manor
Previously it would compute a long list of strings, potentially more than
100,000 elements long, then split this string up and insert it in chunks. Only
then could memory be freed.

This new approach builds the strings in batches for the insertion query, then
moves on to the next batch. This should mean that more memory can be freed and
reused along the way.
2022-01-12 18:18:15 +00:00
ba9bcbf735 Use a bigger start size for the hash table
This might help when there's lots of derivations to insert.
2021-10-03 15:28:40 +01:00
b28d338de7 Insert derivations in chunks
To avoid making a very large query when inserting lots of derivations.
2021-10-03 14:54:43 +01:00