diff options
author | Erik Johnston <erikj@jki.re> | 2017-06-08 12:56:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-08 12:56:18 +0100 |
commit | 98bdb4468b261222c1205f438b0b0ca61533cc19 (patch) | |
tree | aef7c462c7c5c49859e6b88607b6a40b9692f615 /synapse/state.py | |
parent | Merge pull request #2259 from matrix-org/erikj/fix_state_woes (diff) | |
parent | Ensure we don't use unpersisted state group as prev group (diff) | |
download | synapse-98bdb4468b261222c1205f438b0b0ca61533cc19.tar.xz |
Merge pull request #2263 from matrix-org/erikj/fix_state_woes
Ensure we don't use unpersisted state group as prev group
Diffstat (limited to 'synapse/state.py')
-rw-r--r-- | synapse/state.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/synapse/state.py b/synapse/state.py index a98145598f..576eb6b788 100644 --- a/synapse/state.py +++ b/synapse/state.py @@ -273,7 +273,8 @@ class StateHandler(object): } elif entry.prev_group: context.prev_group = entry.prev_group - context.delta_ids = entry.delta_ids + context.delta_ids = dict(entry.delta_ids) + context.delta_ids[key] = event.event_id else: if entry.state_group is None: entry.state_group = self.store.get_next_state_group() @@ -364,12 +365,10 @@ class StateHandler(object): if new_state_event_ids == frozenset(e_id for e_id in events): state_group = sg break - if state_group is None: - # Worker instances don't have access to this method, but we want - # to set the state_group on the main instance to increase cache - # hits. - if hasattr(self.store, "get_next_state_group"): - state_group = self.store.get_next_state_group() + + # TODO: We want to create a state group for this set of events, to + # increase cache hits, but we need to make sure that it doesn't + # end up as a prev_group without being added to the database prev_group = None delta_ids = None |