anonymousland-synapse/synapse/storage
Erik Johnston c72d26c1e1
Refactor EventContext (#12689)
Refactor how the `EventContext` class works, with the intention of reducing the amount of state we fetch from the DB during event processing.

The idea here is to get rid of the cached `current_state_ids` and `prev_state_ids` that live in the `EventContext`, and instead defer straight to the database (and its caching). 

One change that may have a noticeable effect is that we now no longer prefill the `get_current_state_ids` cache on a state change. However, that query is relatively light, since its just a case of reading a table from the DB (unlike fetching state at an event which is more heavyweight). For deployments with workers this cache isn't even used.


Part of #12684
2022-05-10 19:43:13 +00:00
..
databases Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
engines Refuse to start if DB has an unsafe locale (#12262) 2022-03-23 10:23:05 -07:00
schema Stop writing to event_reference_hashes (#12679) 2022-05-10 15:35:08 +01:00
util Await un-partial-stating after a partial-state join (#12399) 2022-04-21 07:42:03 +01:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
_base.py Invalidate the get_users_in_room{_with_profile} caches only when necessary. (#11878) 2022-02-02 12:24:07 -05:00
background_updates.py Add config settings for background update parameters (#11980) 2022-03-11 10:46:45 -08:00
database.py Use ParamSpec in a few places (#12667) 2022-05-09 10:27:39 +00:00
keys.py Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
persist_events.py Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
prepare_database.py Remove unused # type: ignores (#12531) 2022-04-27 14:03:44 +01:00
purge_events.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
push_rule.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
roommember.py Do not include rooms with an unknown room version in a sync response. (#10644) 2021-08-19 11:12:55 -04:00
state.py Await un-partial-stating after a partial-state join (#12399) 2022-04-21 07:42:03 +01:00
types.py Disallow untyped defs in synapse._scripts (#12422) 2022-04-11 12:41:55 +01:00