This repository has been 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
Scratch changes to fix have_seen_event
not being invalidated
#13861
Closed
MadLittleMods
wants to merge
3
commits into
madlittlemods/13356-messages-investigation-scratch-v1
from
madlittlemods/13856-scratch-have-seen-event-monolith-invalidation
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ def __init__( | |
db_conn: LoggingDatabaseConnection, | ||
hs: "HomeServer", | ||
): | ||
logger.info("CacheInvalidationWorkerStore constructor") | ||
super().__init__(database, db_conn, hs) | ||
|
||
self._instance_name = hs.get_instance_name() | ||
|
@@ -222,8 +223,13 @@ def _invalidate_caches_for_event( | |
# This invalidates any local in-memory cached event objects, the original | ||
# process triggering the invalidation is responsible for clearing any external | ||
# cached objects. | ||
logger.info( | ||
"CacheInvalidationWorkerStore _invalidate_caches_for_event room_id=%s event_id=%s", | ||
room_id, | ||
event_id, | ||
) | ||
self._invalidate_local_get_event_cache(event_id) | ||
self.have_seen_event.invalidate((room_id, event_id)) | ||
self.have_seen_event.invalidate(((room_id, event_id),)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This key lookup was wrong and we were never invalidating the Yes, the cache key literally a ex.
We should probably check all other instances of this for the same problem. And ideally fix the cache so it uses the expected |
||
|
||
self.get_latest_event_ids_in_room.invalidate((room_id,)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split out the fixes to #13863