Set lock_timeout for some data deletion transactions
As these can cause deadlocks. This will probably cause errors, so some retrying will need to be added.
This commit is contained in:
parent
3734a85650
commit
47c482bdcc
1 changed files with 4 additions and 0 deletions
|
|
@ -212,6 +212,8 @@ WHERE id IN (
|
||||||
conn
|
conn
|
||||||
'delete-revisions-from-branch)
|
'delete-revisions-from-branch)
|
||||||
|
|
||||||
|
(exec-query conn "SET LOCAL lock_timeout = '5s';")
|
||||||
|
|
||||||
(delete-from-git-commits conn)
|
(delete-from-git-commits conn)
|
||||||
(delete-jobs conn)
|
(delete-jobs conn)
|
||||||
|
|
||||||
|
|
@ -581,6 +583,8 @@ WHERE NOT EXISTS (
|
||||||
"
|
"
|
||||||
SET CONSTRAINTS derivations_by_output_details_set_derivation_id_fkey DEFERRED")
|
SET CONSTRAINTS derivations_by_output_details_set_derivation_id_fkey DEFERRED")
|
||||||
|
|
||||||
|
(exec-query conn "SET LOCAL lock_timeout = '5s';")
|
||||||
|
|
||||||
(maybe-delete-derivation conn
|
(maybe-delete-derivation conn
|
||||||
derivation-id))))))
|
derivation-id))))))
|
||||||
derivations)))))
|
derivations)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue