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

Commit

Permalink
Restore stream change cache changees in _invalidate_caches_for_event
Browse files Browse the repository at this point in the history
This means during replication the changes will be flagged twice, but this
isn't a problem aside from pointless work. To avoid this requires bringing
the function out of the `CacheInvalidationWorkerStore` which is much more
involved due to class dependencies.
  • Loading branch information
Fizzadar committed Dec 9, 2022
1 parent 9f325ba commit 3dea38b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/storage/databases/main/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ def _invalidate_caches_for_event(
# case where we look up an event *before* persisting it.
self._attempt_to_invalidate_cache("_get_membership_from_event_id", (event_id,))

if not backfilled:
self._events_stream_cache.entity_has_changed(room_id, stream_ordering)

if redacts:
self._invalidate_local_get_event_cache(redacts)
# Caches which might leak edits must be invalidated for the event being
Expand All @@ -245,6 +248,7 @@ def _invalidate_caches_for_event(
self._attempt_to_invalidate_cache("get_thread_id_for_receipts", (redacts,))

if etype == EventTypes.Member:
self._membership_stream_cache.entity_has_changed(state_key, stream_ordering)
self._attempt_to_invalidate_cache(
"get_invited_rooms_for_local_user", (state_key,)
)
Expand Down

0 comments on commit 3dea38b

Please sign in to comment.