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
Faster joins: use initial list of servers if we don't have the full state yet #14408
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8cc46ad
Use initial list of servers if we don't have the full state yet
a9b2184
Update synapse/federation/sender/__init__.py
25cec00
Update changelog.d/14408.misc
bb99729
Avoid race
169b47c
Merge branch 'develop' into mv/partial-join-fed-send
87d1c1d
Fix mypy
fd19046
Revert "Fix mypy"
1820e43
Merge branch 'develop' into mv/partial-join-fed-send
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Faster joins: send events to initial list of servers if we don't have the full state yet. |
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.
I just realised that we won't send events to servers that join after us.
self._storage_controllers.state.get_current_hosts_in_room_or_partial_state_approximation(room_id)
returns a list that does include those servers (apologies for the naming), but it never returns an empty list.We may want to go back to the original structure (
elif await self.store.is_partial_state_room(event.room_id):
) but use that method instead.Sorry for not catching this earlier!
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.
I suppose there's a question here: how much are we happy to trust this approximation? In prior discussions I gathered that we were just going to stick with the original list handed out over
/send_join
— is that no longer the case?I guess the client will see the memberships for the 'extras', even if we end up rejecting them later on, it won't ever send events to servers that the user couldn't see, so maybe it's OK?
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.
I'm missing / have forgotten context from prior discussions. If we've decided to go with only the original list, then please ignore the comment!
It's hard to say what memberships an end user might actually see, given that they'll be doing lazy loading syncs, which only provide memberships when a user sends a message. I think the member list in Element Web might not work until the room is fully synced.
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.
I haven't merged that yet because I am unsure.
To my understanding, the approximation is initial list + updates from membership events that we received after.
There is a possibility that we can't validate those events out of missing state, hence I think we probably want to not use the approximation ?
We also can't be sure of the initial
servers_in_room
but at least we trust only one server there.In the grand scheme of things it's not a big trouble because we potentially only leak our own events.
For now I am leaning towards merging it like that.