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

Commit

Permalink
Use initial list of servers if we don't have the full state yet
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
  • Loading branch information
Mathieu Velten committed Nov 10, 2022
1 parent d10a85e commit 8cc46ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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.
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):
# 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
# 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

0 comments on commit 8cc46ad

Please sign in to comment.