This repository was archived by the owner on Apr 26, 2024. It is now read-only.
  
  
  - 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.1k
caching on have_seen_event is somewhat broken #13865
Copy link
Copy link
Closed
Labels
A-PerformancePerformance, both client-facing and admin-facingPerformance, both client-facing and admin-facingO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-TolerableMinor significance, cosmetic issues, low or no impact to users.Minor significance, cosmetic issues, low or no impact to users.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
As discovered in #13863 (comment) and discussed in #synapse-dev. Part of #13856
The cache on have_seen_event uses a TreeCache, which means the cache is structured as {room_id: {event_id: result}}. However, _have_seen_events_dict tries to use it with @cachedList, which stores entries as {(room_id, event_id): result}. As a result, caching is inefficient, and cache invalidation is unreliable.
Metadata
Metadata
Assignees
Labels
A-PerformancePerformance, both client-facing and admin-facingPerformance, both client-facing and admin-facingO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-TolerableMinor significance, cosmetic issues, low or no impact to users.Minor significance, cosmetic issues, low or no impact to users.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.