From 943f1029d66155cfa0f00964c52bd380bdce7124 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 17 May 2018 11:39:55 +0100 Subject: Begin adding implementing room chunks This commit adds the necessary tables and columns, as well as an implementation of an online topological sorting algorithm to maintain an absolute ordering of the room chunks. --- synapse/storage/events.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'synapse/storage/events.py') diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 05cde96afc..70b9041eee 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -232,6 +232,15 @@ class EventsStore(EventsWorkerStore): psql_only=True, ) + self.register_background_index_update( + "events_chunk_index", + index_name="events_chunk_index", + table="events", + columns=["room_id", "chunk_id", "topological_ordering", "stream_ordering"], + unique=True, + psql_only=True, + ) + self._event_persist_queue = _EventPeristenceQueue() self._state_resolution_handler = hs.get_state_resolution_handler() -- cgit 1.5.1