summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason Little <realtyem@gmail.com>2024-10-30 20:15:57 -0500
committerGitHub <noreply@github.com>2024-10-30 20:15:57 -0500
commit2e5fe3f187490c8d593313ce70336f61bb010f25 (patch)
treef405dc98cfcd2253a302727919f0e53fe656882a
parentRemove `Generator` from 4 places in `PersistEventStore` (#17818) (diff)
downloadsynapse-2e5fe3f187490c8d593313ce70336f61bb010f25.tar.xz
Remove `Generator` in `store_search_entries_txn` (#17817)
Context: https://github.com/matrix-org/synapse/issues/15439
(https://github.com/element-hq/synapse/issues/15439)

Also see discussion in https://github.com/element-hq/synapse/pull/17813
-rw-r--r--changelog.d/17817.bugfix1
-rw-r--r--synapse/storage/databases/main/search.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/17817.bugfix b/changelog.d/17817.bugfix
new file mode 100644

index 0000000000..5dd276709b --- /dev/null +++ b/changelog.d/17817.bugfix
@@ -0,0 +1 @@ +Avoid lost data on some database query retries. diff --git a/synapse/storage/databases/main/search.py b/synapse/storage/databases/main/search.py
index b436275f3f..1d5c5e72ff 100644 --- a/synapse/storage/databases/main/search.py +++ b/synapse/storage/databases/main/search.py
@@ -94,7 +94,7 @@ class SearchWorkerStore(SQLBaseStore): VALUES (?,?,?,to_tsvector('english', ?),?,?) """ - args1 = ( + args1 = [ ( entry.event_id, entry.room_id, @@ -104,7 +104,7 @@ class SearchWorkerStore(SQLBaseStore): entry.origin_server_ts, ) for entry in entries - ) + ] txn.execute_batch(sql, args1)