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

Store state groups separately from events #2784

Merged
merged 15 commits into from
Feb 6, 2018
Merged
4 changes: 2 additions & 2 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def _persist_events_txn(self, txn, events_and_contexts, backfilled,

# Insert into the state_groups, state_groups_state, and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is misleading now

# event_to_state_groups tables.
self._store_mult_state_groups_txn(txn, events_and_contexts)
self._store_event_state_mappings_txn(txn, events_and_contexts)

# _store_rejected_events_txn filters out any events which were
# rejected, and returns the filtered list.
Expand Down Expand Up @@ -982,7 +982,7 @@ def _update_outliers_txn(self, txn, events_and_contexts):
# insert into the state_group, state_groups_state and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

# event_to_state_groups tables.
try:
self._store_mult_state_groups_txn(txn, ((event, context),))
self._store_event_state_mappings_txn(txn, ((event, context),))
except Exception:
logger.exception("")
raise
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def _have_persisted_state_group_txn(self, txn, state_group):
row = txn.fetchone()
return row and row[0]

def _store_mult_state_groups_txn(self, txn, events_and_contexts):
def _store_event_state_mappings_txn(self, txn, events_and_contexts):
state_groups = {}
for event, context in events_and_contexts:
if event.internal_metadata.is_outlier():
Expand Down