mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-28 06:50:32 -05:00
Fix https://github.com/matrix-org/synapse/issues/13856 Fix https://github.com/matrix-org/synapse/issues/13865 > Discovered while trying to make Synapse fast enough for [this MSC2716 test for importing many batches](https://github.com/matrix-org/complement/pull/214#discussion_r741678240). As an example, disabling the `have_seen_event` cache saves 10 seconds for each `/messages` request in that MSC2716 Complement test because we're not making as many federation requests for `/state` (speeding up `have_seen_event` itself is related to https://github.com/matrix-org/synapse/issues/13625) > > But this will also make `/messages` faster in general so we can include it in the [faster `/messages` milestone](https://github.com/matrix-org/synapse/milestone/11). > > *-- https://github.com/matrix-org/synapse/issues/13856* ### The problem `_invalidate_caches_for_event` doesn't run in monolith mode which means we never even tried to clear the `have_seen_event` and other caches. And even in worker mode, it only runs on the workers, not the master (AFAICT). Additionally there was bug with the key being wrong so `_invalidate_caches_for_event` never invalidates the `have_seen_event` cache even when it does run. Because we were using the `@cachedList` wrong, it was putting items in the cache under keys like `((room_id, event_id),)` with a `set` in a `set` (ex. `(('!TnCIJPKzdQdUlIyXdQ:test', '$Iu0eqEBN7qcyF1S9B3oNB3I91v2o5YOgRNPwi_78s-k'),)`) and we we're trying to invalidate with just `(room_id, event_id)` which did nothing. |
||
|---|---|---|
| .. | ||
| databases | ||
| util | ||
| __init__.py | ||
| test__base.py | ||
| test_account_data.py | ||
| test_appservice.py | ||
| test_background_update.py | ||
| test_base.py | ||
| test_cleanup_extrems.py | ||
| test_client_ips.py | ||
| test_database.py | ||
| test_devices.py | ||
| test_directory.py | ||
| test_e2e_room_keys.py | ||
| test_end_to_end_keys.py | ||
| test_event_chain.py | ||
| test_event_federation.py | ||
| test_event_metrics.py | ||
| test_event_push_actions.py | ||
| test_events.py | ||
| test_id_generators.py | ||
| test_keys.py | ||
| test_main.py | ||
| test_monthly_active_users.py | ||
| test_profile.py | ||
| test_purge.py | ||
| test_receipts.py | ||
| test_redaction.py | ||
| test_registration.py | ||
| test_rollback_worker.py | ||
| test_room.py | ||
| test_room_search.py | ||
| test_roommember.py | ||
| test_state.py | ||
| test_stream.py | ||
| test_transactions.py | ||
| test_txn_limit.py | ||
| test_unsafe_locale.py | ||
| test_user_directory.py | ||