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

Only send catch up events if they're the latest in the room #9621

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9621.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only send catch up events if they're the latest in the room, reducing the number of events a server receives after recovering from downtime.
3 changes: 2 additions & 1 deletion synapse/storage/databases/main/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def _get_catch_up_room_event_ids_txn(
) -> List[str]:
q = """
SELECT event_id FROM destination_rooms
JOIN events USING (stream_ordering)
INNER JOIN events USING (stream_ordering)
INNER JOIN event_forward_extremities USING (event_id)
WHERE destination = ?
AND stream_ordering > ?
ORDER BY stream_ordering
Expand Down