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

Commit d90087c

Browse files
authored
Remove from the event_relations table when purging historical events. (#7978)
1 parent 3a00bd1 commit d90087c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog.d/7978.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long standing bug: 'Duplicate key value violates unique constraint "event_relations_id"' when message retention is configured.

synapse/storage/data_stores/main/purge_events.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _purge_history_txn(self, txn, room_id, token_str, delete_local_events):
6262
# event_json
6363
# event_push_actions
6464
# event_reference_hashes
65+
# event_relations
6566
# event_search
6667
# event_to_state_groups
6768
# events
@@ -209,6 +210,7 @@ def _purge_history_txn(self, txn, room_id, token_str, delete_local_events):
209210
"event_edges",
210211
"event_forward_extremities",
211212
"event_reference_hashes",
213+
"event_relations",
212214
"event_search",
213215
"rejections",
214216
):

0 commit comments

Comments
 (0)