Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
disable global statement timeout when creating index
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Aug 8, 2023
1 parent 4581809 commit 5d51db6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions synapse/storage/background_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,11 @@ def create_index_psql(conn: Connection) -> None:
logger.debug("[SQL] %s", sql)
c.execute(sql)

# override the global statement timeout to avoid accidentally squashing
# a long-running index creation process
timeout_sql = "SET LOCAL statement timeout = 0"
c.execute(timeout_sql)

sql = (
"CREATE %(unique)s INDEX CONCURRENTLY %(name)s"
" ON %(table)s"
Expand Down

0 comments on commit 5d51db6

Please sign in to comment.