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

Don't always lock "user_ips" table when performing non-native upsert #15788

Merged
merged 2 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading