summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-07-29 13:55:01 -0400
committerGitHub <noreply@github.com>2020-07-29 13:55:01 -0400
commitd90087cffa362cef13f6823df29d2c121a2f9bfb (patch)
tree611643b09d4eaf23595464bb452a9b2f75c67ca2
parentAdd additional logging for SAML sessions. (#7971) (diff)
downloadsynapse-d90087cffa362cef13f6823df29d2c121a2f9bfb.tar.xz
Remove from the event_relations table when purging historical events. (#7978)
-rw-r--r--changelog.d/7978.bugfix1
-rw-r--r--synapse/storage/data_stores/main/purge_events.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/changelog.d/7978.bugfix b/changelog.d/7978.bugfix
new file mode 100644
index 0000000000..247b18db20
--- /dev/null
+++ b/changelog.d/7978.bugfix
@@ -0,0 +1 @@
+Fix a long standing bug: 'Duplicate key value violates unique constraint "event_relations_id"' when message retention is configured.
diff --git a/synapse/storage/data_stores/main/purge_events.py b/synapse/storage/data_stores/main/purge_events.py
index 6546569139..b53fe35c33 100644
--- a/synapse/storage/data_stores/main/purge_events.py
+++ b/synapse/storage/data_stores/main/purge_events.py
@@ -62,6 +62,7 @@ class PurgeEventsStore(StateGroupWorkerStore, SQLBaseStore):
         #     event_json
         #     event_push_actions
         #     event_reference_hashes
+        #     event_relations
         #     event_search
         #     event_to_state_groups
         #     events
@@ -209,6 +210,7 @@ class PurgeEventsStore(StateGroupWorkerStore, SQLBaseStore):
             "event_edges",
             "event_forward_extremities",
             "event_reference_hashes",
+            "event_relations",
             "event_search",
             "rejections",
         ):