summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-03-30 16:18:46 +0100
committerMark Haines <mark.haines@matrix.org>2016-03-30 16:18:46 +0100
commit61407986b40e28b590961d364f5618bbe7d44e94 (patch)
treec7c5988b9f87bb0970f5d26c9409db3b52ab449f /synapse
parentAdd a replication stream for state groups (diff)
downloadsynapse-61407986b40e28b590961d364f5618bbe7d44e94.tar.xz
Add a entry to current_state_resets table when the current state is reset
Diffstat (limited to '')
-rw-r--r--synapse/storage/events.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index a4b8995496..bd4d503b6d 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -205,6 +205,15 @@ class EventsStore(SQLBaseStore):
             txn.call_after(self.get_joined_hosts_for_room.invalidate, (event.room_id,))
             txn.call_after(self.get_room_name_and_aliases, event.room_id)
 
+            # Add an entry to the current_state_resets table to record the point
+            # where we clobbered the current state
+            stream_order = event.internal_metadata.stream_ordering
+            self._simple_insert_txn(
+                txn,
+                table="current_state_resets",
+                values={"event_stream_ordering": stream_order}
+            )
+
             self._simple_delete_txn(
                 txn,
                 table="current_state_events",