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

Convert _insert_graph_receipts_txn to simple_upsert #16299

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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/16299.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use a stricter isolation level on `receipts_graph` Postgres transactions to stop error messages.
3 changes: 3 additions & 0 deletions synapse/storage/databases/main/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,9 @@ async def insert_receipt(
event_ids,
thread_id,
data,
# Use READ_COMMITTED to avoid 'could not serialize access due to concurrent
# update' Postgres errors which lead to rollbacks and re-dos.
isolation_level=IsolationLevel.READ_COMMITTED,
)

max_persisted_id = self._receipts_id_gen.get_current_token()
Expand Down
Loading