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

Commit 2ac6c3b

Browse files
Don't always lock "user_ips" table when performing non-native upsert (#15788)
1 parent 0618bf9 commit 2ac6c3b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/15788.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

synapse/storage/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ def simple_upsert_many_txn_emulated(
15291529
# Lock the table just once, to prevent it being done once per row.
15301530
# Note that, according to Postgres' documentation, once obtained,
15311531
# the lock is held for the remainder of the current transaction.
1532-
self.engine.lock_table(txn, "user_ips")
1532+
self.engine.lock_table(txn, table)
15331533

15341534
for keyv, valv in zip(key_values, value_values):
15351535
_keys = dict(zip(key_names, keyv))

0 commit comments

Comments
 (0)