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

Commit

Permalink
Log warning when fetching events stream ahead of change cache
Browse files Browse the repository at this point in the history
If this is ever triggered there is potential to miss events that have
just been persisted because the change cache is not up to date.
  • Loading branch information
Fizzadar committed Oct 9, 2022
1 parent 5297155 commit 62497db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions synapse/storage/databases/main/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,15 @@ async def get_room_events_stream_for_rooms(
- list of recent events in the room
- stream ordering key for the start of the chunk of events returned.
"""

if to_key.stream > self._events_stream_cache.max_stream_pos:
logger.warning(
"Selecting from room events stream using position %s ahead of "
"the stream cache position %s",
to_key.stream,
self._events_stream_cache.max_stream_pos,
)

room_ids = self._events_stream_cache.get_entities_changed(
room_ids, from_key.stream
)
Expand Down

0 comments on commit 62497db

Please sign in to comment.