Obtain a lock when inserting the data for a new revision
This is working towards running the jobs in parallel. Each job looks at the records in the database, and adds missing ones. If other jobs, running in different transactions insert the same missing records at the same time, this could cause an error. Therefore, to just avoid this problem, lock before inserting the data. This will allow the jobs to be processed in parallel, and it shouldn't have too much of an effect on performance, as the slow bit is outside of the transaction.
This commit is contained in:
parent
05c8287965
commit
a6bd46b829
1 changed files with 5 additions and 0 deletions
|
|
@ -553,6 +553,11 @@
|
|||
(lambda ()
|
||||
(all-inferior-package-derivations store inf packages)))))
|
||||
|
||||
;; Wait until this is the only transaction inserting data, to
|
||||
;; avoid any concurrency issues
|
||||
(obtain-advisory-transaction-lock conn
|
||||
'load-new-guix-revision-inserts)
|
||||
|
||||
(let* ((package-derivation-ids
|
||||
(packages-and-inferior-data->package-derivation-ids
|
||||
conn inf packages inferior-data-4-tuples))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue