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

Commit

Permalink
Don't always lock "user_ips" table when performing non-native upsert (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Jun 16, 2023
1 parent 0618bf9 commit 2ac6c3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/15788.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in 1.57.0 where the wrong table would be locked on updating database rows when using SQLite as the database backend.
2 changes: 1 addition & 1 deletion synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ def simple_upsert_many_txn_emulated(
# Lock the table just once, to prevent it being done once per row.
# Note that, according to Postgres' documentation, once obtained,
# the lock is held for the remainder of the current transaction.
self.engine.lock_table(txn, "user_ips")
self.engine.lock_table(txn, table)

for keyv, valv in zip(key_values, value_values):
_keys = dict(zip(key_names, keyv))
Expand Down

0 comments on commit 2ac6c3b

Please sign in to comment.