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

Faster joins: use initial list of servers if we don't have the full state yet #14408

Merged
merged 8 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/14408.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faster joins: use initial list of servers if we don't have the full state yet.
MatMaul marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions synapse/federation/sender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ async def handle_event(event: EventBase) -> None:
# If there are no prev event IDs then the state is empty
# and so no remote servers in the room
destinations = set()
elif await self.store.is_partial_state_room(event.room_id):
MatMaul marked this conversation as resolved.
Show resolved Hide resolved
# During partial join we use the set of servers that we got
# when beginning the join. It's still possible that we send
# events to servers that leaved the room in the meantine but
MatMaul marked this conversation as resolved.
Show resolved Hide resolved
# we consider that an acceptable risk since it is only our own
# events that we leak and not other server's ones.
destinations = (
await self.store.get_partial_state_servers_at_join(
event.room_id
)
)
else:
# We check the external cache for the destinations, which is
# stored per state group.
Expand Down