diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-03-30 16:40:17 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-03-30 16:40:17 +0100 |
commit | 98c460cecdd10b3958f1a51a5634ee422a77094c (patch) | |
tree | 59f73b0a5926c079908b5108077f7385a83c8e54 /synapse/storage/events.py | |
parent | Merge pull request #674 from matrix-org/markjh/replicate_state (diff) | |
parent | return the state_group for backfill (diff) | |
download | synapse-98c460cecdd10b3958f1a51a5634ee422a77094c.tar.xz |
Merge pull request #675 from matrix-org/markjh/replicate_stateII
Add a replication stream for state groups
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r-- | synapse/storage/events.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 5f675ab09b..e0ef7f46b2 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -1097,10 +1097,12 @@ class EventsStore(SQLBaseStore): new events or as backfilled events""" def get_all_new_events_txn(txn): sql = ( - "SELECT e.stream_ordering, ej.internal_metadata, ej.json" + "SELECT e.stream_ordering, ej.internal_metadata, ej.json, eg.state_group" " FROM events as e" " JOIN event_json as ej" " ON e.event_id = ej.event_id AND e.room_id = ej.room_id" + " LEFT JOIN event_to_state_groups as eg" + " ON e.event_id = eg.event_id" " WHERE ? < e.stream_ordering AND e.stream_ordering <= ?" " ORDER BY e.stream_ordering ASC" " LIMIT ?" @@ -1112,10 +1114,13 @@ class EventsStore(SQLBaseStore): new_forward_events = [] sql = ( - "SELECT -e.stream_ordering, ej.internal_metadata, ej.json" + "SELECT -e.stream_ordering, ej.internal_metadata, ej.json," + " eg.state_group" " FROM events as e" " JOIN event_json as ej" " ON e.event_id = ej.event_id AND e.room_id = ej.room_id" + " LEFT JOIN event_to_state_groups as eg" + " ON e.event_id = eg.event_id" " WHERE ? > e.stream_ordering AND e.stream_ordering >= ?" " ORDER BY e.stream_ordering DESC" " LIMIT ?" |