diff options
author | Erik Johnston <erikj@jki.re> | 2017-05-03 10:54:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 10:54:11 +0100 |
commit | cdbf38728dfa96b5cbe947659ebdb01142032a64 (patch) | |
tree | f4dea67145bb82353008c81c4d0697304cfd14c3 /synapse/storage/state.py | |
parent | Merge pull request #2170 from matrix-org/erikj/fed_hole_state (diff) | |
parent | Update comment (diff) | |
download | synapse-cdbf38728dfa96b5cbe947659ebdb01142032a64.tar.xz |
Merge pull request #2175 from matrix-org/erikj/prefill_state
Prefill state caches
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r-- | synapse/storage/state.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py index a16afa8df5..03981f5d2b 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -227,6 +227,18 @@ class StateStore(SQLBaseStore): ], ) + # Prefill the state group cache with this group. + # It's fine to use the sequence like this as the state group map + # is immutable. (If the map wasn't immutable then this prefill could + # race with another update) + txn.call_after( + self._state_group_cache.update, + self._state_group_cache.sequence, + key=context.state_group, + value=context.current_state_ids, + full=True, + ) + self._simple_insert_many_txn( txn, table="event_to_state_groups", |