Stop sharing the derivation-ids-hash-table

Since the derivations are independent between systems, and this is just a
cache of the database ids.
This commit is contained in:
Christopher Baines 2025-07-08 07:23:32 +01:00
parent 0184f10942
commit 4d04a7f47b

View file

@ -2406,7 +2406,6 @@ WHERE builder != 'builtin:download'
guix-derivation guix-derivation
call-with-utility-thread call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table
#:key skip-system-tests? #:key skip-system-tests?
extra-inferior-environment-variables extra-inferior-environment-variables
parallelism parallelism
@ -2647,7 +2646,7 @@ WHERE builder != 'builtin:download'
postgresql-connection-pool postgresql-connection-pool
call-with-utility-thread call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table (make-hash-table)
derivations-vector derivations-vector
#:log-tag (simple-format #f "~A:~A" system target))))) #:log-tag (simple-format #f "~A:~A" system target)))))
(guix-revision-id (guix-revision-id
@ -2748,7 +2747,7 @@ WHERE builder != 'builtin:download'
postgresql-connection-pool postgresql-connection-pool
call-with-utility-thread call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table (make-hash-table)
(list->vector (list->vector
(map cdr derivation-file-names-by-system)) (map cdr derivation-file-names-by-system))
#:log-tag "channel-instances")))) #:log-tag "channel-instances"))))
@ -2781,7 +2780,6 @@ WHERE builder != 'builtin:download'
(define (load-channel-instances call-with-utility-thread (define (load-channel-instances call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table
git-repository-id commit git-repository-id commit
channel-derivations-by-system) channel-derivations-by-system)
;; Load the channel instances in a different transaction, so that this can ;; Load the channel instances in a different transaction, so that this can
@ -2824,19 +2822,24 @@ WHERE builder != 'builtin:download'
(lambda (drv) (lambda (drv)
(cons system drv))))) (cons system drv)))))
channel-derivations-by-system)) channel-derivations-by-system))
(derivation-ids (derivation-ids-by-system
(derivation-file-names->derivation-ids (fibers-map
postgresql-connection-pool (match-lambda
call-with-utility-thread ((system . drv)
read-derivations/serialised (cons system
derivation-ids-hash-table (vector-ref
(list->vector (map cdr derivations-by-system))))) (derivation-file-names->derivation-ids
postgresql-connection-pool
call-with-utility-thread
read-derivations/serialised
(make-hash-table)
(vector drv))
0))))
derivations-by-system)))
(insert-channel-instances channel-instances-conn (insert-channel-instances channel-instances-conn
guix-revision-id guix-revision-id
(map cons derivation-ids-by-system))
(map car derivations-by-system)
(vector->list derivation-ids))))
(simple-format (simple-format
(current-error-port) (current-error-port)
"guix-data-service: saved the channel instance derivations to the database\n")) "guix-data-service: saved the channel instance derivations to the database\n"))
@ -2881,9 +2884,6 @@ WHERE builder != 'builtin:download'
read-derivations/parallelism-limiter read-derivations/parallelism-limiter
(apply read-derivations args))) (apply read-derivations args)))
(define derivation-ids-hash-table
(make-hash-table))
(let* ((git-repository-fields (let* ((git-repository-fields
(select-git-repository conn git-repository-id)) (select-git-repository conn git-repository-id))
(git-repository-url (git-repository-url
@ -2920,7 +2920,6 @@ WHERE builder != 'builtin:download'
(fibers-force channel-derivations-by-system-promise))) (fibers-force channel-derivations-by-system-promise)))
(load-channel-instances call-with-utility-thread (load-channel-instances call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table
git-repository-id commit git-repository-id commit
channel-derivations-by-system))) channel-derivations-by-system)))
#:on-exception #:on-exception
@ -2947,7 +2946,6 @@ WHERE builder != 'builtin:download'
guix-derivation guix-derivation
call-with-utility-thread call-with-utility-thread
read-derivations/serialised read-derivations/serialised
derivation-ids-hash-table
#:skip-system-tests? #:skip-system-tests?
skip-system-tests? skip-system-tests?
#:extra-inferior-environment-variables #:extra-inferior-environment-variables