From f6a41901af8467bb1d3672e9d41022c0deb4c3b1 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 8 Jun 2021 17:24:52 +0200 Subject: [PATCH] feeder: set deadlock_timeout to 10 seconds (#54658) It makes wcs-olap always win in a deadlock with another client. --- wcs_olap/feeder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wcs_olap/feeder.py b/wcs_olap/feeder.py index ab29bd5..fd5a517 100644 --- a/wcs_olap/feeder.py +++ b/wcs_olap/feeder.py @@ -354,6 +354,7 @@ class WcsOlapFeeder(object): Drop tables one by one in order to avoid reaching max_locks_per_transaction """ # drop foreign key constraints first + self.ex("SET deadlock_timeout = '10s'") self.ex("SELECT table_name, constraint_name FROM " "information_schema.key_column_usage " "WHERE table_schema = %s AND constraint_name LIKE '%%_fkey'", vars=[schema]) -- 2.32.0.rc0