Commit graph

302 commits

Author SHA1 Message Date
c886685e92 Update Guile Knots 2025-01-14 13:49:28 +00:00
cdffef2397 Report on the GC when processing revisions 2024-12-29 12:22:38 +00:00
50127de12a Parallelise inserting derivation counts 2024-12-29 12:22:38 +00:00
93eac06fd6 Update Guile Knots 2024-12-29 11:05:07 +00:00
8b49884816 Use knots
A library of extracted Guile Fibers patterns and utilities.
2024-12-15 20:17:10 +00:00
a33e32275e Add a comment 2024-12-09 10:53:06 +00:00
d7c7f74ff1 Log differently when using the load-new-guix-revision-inserts lock 2024-12-09 10:53:06 +00:00
859b0093f8 Avoid getting the load-new-guix-revision-inserts lock twice 2024-12-09 10:53:06 +00:00
ba97dfc1fe Fix wrong number of values from channel-derivations-by-system->guix-store-item 2024-12-09 10:53:06 +00:00
5ed98343d7 Rework loading revision data
These changes were motivated by switching to a mechanism of loading data that
isn't dependent on the big advisory lock that prevents more than one revision
from being processed at a time.

Since INSERT ... RETURNING id; is used, this can block if another transaction
inserts the same data, and then cause an error when that transaction
commits. The solution is to use ON CONFLICT DO NOTHING, but you have to handle
the case when the INSERT doesn't return an id since the other transaction has
inserted it.

This commit rewrites insert-missing-data-and-return-all-ids to do as described
above, as well as being more efficient in how existing data is detected and to
use more vectors. Other utilities for inserting data are added as well.
2024-12-09 10:53:06 +00:00
221394eafb Add in call-with-worker-thread to try to avoid sort problems 2024-11-29 13:49:38 +00:00
cb1bc060c8 Move log message 2024-11-29 10:37:56 +00:00
e14fd88d8f Don't lookup #f in the hash table 2024-11-29 10:09:41 +00:00
64aeeffd8e Insert guix_revision_package_derivation_distribution_counts later
As this should speed up processing revisions.
2024-11-26 14:12:17 +00:00
620ac16e26 Don't crash when linters crash
This is currently happening because some linters try to evaluate parts of
packages for cross-building to aarch64-linux-gnu, but not all packages support
that and some crash in this case.

I'm not quite sure what the correct behaviour should be, but maybe the data
service needs to try and handle these crashes rather than not processing the
entire revision.
2024-11-26 09:27:50 +00:00
112bc95a13 Restore calling update-derivation-ids-hash-table!
In derivation-file-names->derivation-ids. This is important for performance
since it avoids reading derivations with an entry already in the database.
2024-11-25 10:56:01 +00:00
bda4269b56 Change to logging the filtered derivations
As that's what's relevant here.
2024-11-25 10:55:45 +00:00
e7ada1bada Allow using the heap profiler in the inferior 2024-11-08 22:34:28 +00:00
ebeb4212ff More efficiently create some vectors
And instrument the inferior memory after creating the gds-inferior-packages
vector.
2024-11-08 22:34:28 +00:00
0c1e9ad4e4 Do more when cleaning inferiors
Not sure if this actually helps, but it might do.
2024-11-08 12:59:08 +00:00
7ffe82dfe3 Add log-tag when inserting channel instance derivations 2024-11-08 12:54:14 +00:00
6bf1747f55 Always assume that resource pool waiters will stick around
As I think this is a more efficient design.
2024-11-05 09:41:30 +00:00
d310632f26 Move the inferior cleanup to the end of each system+target 2024-11-04 08:40:45 +00:00
cee8868bfd Refactor 2024-11-03 21:24:24 +00:00
ed6a4b1577 Use a separate db connection in channel-derivations-by-system-promise
As this can run in parallel with something else using conn.
2024-11-02 09:35:23 +00:00
e67edf54bc Finish chasing the call-with-resource-pool bug
This took a while to find as process-job would just get stuck, and this wasn't
directly related to any particular change, just that more fibers increased the
chance of hitting it.

This commit includes lots of the things I changed while debugging.
2024-10-31 20:04:16 +00:00
1782a33a18 Add a comment 2024-10-27 14:39:52 +00:00
c650fc6e7a Rework inserting derivations
To add more parallelism.
2024-10-27 14:39:52 +00:00
1e0407e9b6 Use a common derivation-ids-hash-table
To allow for calling derivation-file-names->derivation-ids in parallel across
multiple fibers, using the PostgreSQL connection fiber to perform atomic
operations.
2024-10-27 14:39:52 +00:00
ff32aa899e Include the package version in the "error when computing" messages
As this helps when there are lots of packages with the same name.
2024-10-27 14:39:52 +00:00
052cf7580c Ensure the guix derivations are stored prior to attempting to substitute 2024-10-27 14:39:52 +00:00
d53b91dd91 Fix extract-information-from message 2024-10-27 14:39:52 +00:00
b6551842d1 Increase parallelism when loading revisions 2024-10-27 14:39:50 +00:00
f1071cbd4d Use a dedicated fiber for heap size monitoring 2024-10-27 14:38:50 +00:00
46b86761f5 Fix free-disk-space call
As the WAL file might not exist.
2024-10-13 19:12:09 +01:00
c04ea067c2 Make the WAL threshold more flexible
So that the WAL can grow more when there's sufficient space. When the
inferiors are closed it takes time to restart them, so doing this less should
speed up processing revisions.
2024-10-10 18:26:35 +01:00
fd7b0a341d Add retrying around inserting channel instance derivations 2024-08-29 09:38:44 +01:00
4ab59f46b4 Stop using profiles for channel instances
Just use the store item instead. This should avoid issues where the profile
gets GC'd.
2024-08-27 16:19:03 +01:00
c486db61f0 Further reduce the chunk size 2024-08-20 12:00:14 +01:00
122b63e131 Increase the WAL threshold 2024-08-20 10:31:20 +01:00
6de908d0f4 Increase the inferior idle seconds 2024-08-18 12:53:12 +01:00
3887435a7d Improve logging around use of inferiors 2024-08-17 18:31:32 +01:00
210e9a4775 Log the number of inferiors when reporting WAL issues
And reduce the threshold.
2024-08-16 21:18:23 +01:00
0592fba35b Check the WAL size more frequently when using inferiors
Since getting an inferior from the pool can take some time, it's not
sufficient to just check prior to attempting to fetch an inferior from the
pool. Instead set a timeout and check periodically.
2024-08-16 11:56:17 +01:00
c335775ed4 Check the WAL size before computing lint warnings
As even though this might not use the store, the inferior still holds a store
connection open.
2024-08-16 11:18:40 +01:00
eeda1bf33b Use system-ids for inserting distribution counts 2024-08-12 09:14:36 +01:00
b79c7e83be Reduce chunk size
To try and respond quicker when the WAL is growing.
2024-08-12 09:14:36 +01:00
97b76000ec Check the WAL size for each chunk
Rather than for each system and target, as this should mean the
response (pausing and allowing inferiors and store connections to be closed)
is quicker.
2024-08-12 09:14:36 +01:00
371d76456f Start trying to handle GC happening while processing revisions 2024-08-12 09:14:36 +01:00
7869082816 Parallelise inserting package derivation distribution counts 2024-08-10 18:28:53 +01:00