From 8902b3031d1437b6a8779cc4831e3f17d732a6a6 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Mon, 9 Oct 2023 14:41:17 +0000 Subject: Disable statement timeout whilst purging rooms (#16455) * Disable statement timeout whilst purging rooms * Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) * Note the introduction version --------- Signed-off-by: Olivier Wilkinson (reivilibre) --- synapse/storage/databases/main/purge_events.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'synapse/storage/databases') diff --git a/synapse/storage/databases/main/purge_events.py b/synapse/storage/databases/main/purge_events.py index dea0e0458c..1e11bf2706 100644 --- a/synapse/storage/databases/main/purge_events.py +++ b/synapse/storage/databases/main/purge_events.py @@ -89,6 +89,11 @@ class PurgeEventsStore(StateGroupWorkerStore, CacheInvalidationWorkerStore): # furthermore, we might already have the table from a previous (failed) # purge attempt, so let's drop the table first. + if isinstance(self.database_engine, PostgresEngine): + # Disable statement timeouts for this transaction; purging rooms can + # take a while! + txn.execute("SET LOCAL statement_timeout = 0") + txn.execute("DROP TABLE IF EXISTS events_to_purge") txn.execute( -- cgit 1.5.1