You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Make outgoing device list tracking work after we partial-join #13891
To fix "/keys/query requests on a remote homeserver must not return stale data.":
Store the current device list stream ID when we start a partial join
When we transition from partial to fully joined, send all device list updates in device_list_changes_in_room since we last joined the room (by referring to the recorded stream ID) for the room to all servers that are either:
are in the room; or
have had a membership change between the state at the initial join and the new current state.
There are complement tests for this on the squah/faster_room_joins_device_list_tracking branch (see the TestPartialStateJoin/Outgoing_device_list_updates/* tests)
work out which servers to send to. For a): standard function get current hosts or similar. For b) get state at the join event ID (which should now exist) and compare to the current state. Want some kind of symmetric diference of dicts.
work out what to send them. Should be a simple select from device_list_changes_in_room with a fixed room_id and where stream_id > ?.
Send out device list updates: add_device_list_outbound_pokes
I should mention that while we have partial state, we always send out device list updates to the servers listed in the servers_in_room/send_join response: #13874
so there may be opportunity for optimization based on that
There are complement tests for this on the squah/faster_room_joins_device_list_tracking branch (see the TestPartialStateJoin/Outgoing_device_list_updates/* tests)
I get:
=== RUN TestPartialStateJoin/Outgoing_device_list_updates/Device_list_updates_reach_incorrectly_absent_servers_once_partial_state_join_completes_even_though_remote_server_left_room
client.go:604: [CSAPI] POST hs1/_matrix/client/v3/register => 400 Bad Request (11.298801ms)
federation_room_join_partial_state_test.go:1508: CSAPI.MustDo POST http://localhost:49249/_matrix/client/v3/register returned HTTP 400 : {"errcode":"M_USER_IN_USE","error":"User ID already taken."}
=== RUN TestPartialStateJoin/Outgoing_device_list_updates/Device_list_updates_reach_incorrectly_absent_servers_once_partial_state_join_completes_even_though_remote_server_left_room
client.go:604: [CSAPI] POST hs1/_matrix/client/v3/register => 400 Bad Request (11.298801ms)
federation_room_join_partial_state_test.go:1508: CSAPI.MustDo POST http://localhost:49249/_matrix/client/v3/register returned HTTP 400 : {"errcode":"M_USER_IN_USE","error":"User ID already taken."}
failure on that branch
My mistake, that branch is ever so slightly out of date. squah/faster_room_joins_device_list_tracking_outgoing_2 is the right one to use and all its tests are passing with #13934.
Activity
squahtx commentedon Sep 23, 2022
There are complement tests for this on the
squah/faster_room_joins_device_list_trackingbranch (see theTestPartialStateJoin/Outgoing_device_list_updates/*tests)DMRobertson commentedon Sep 23, 2022
To do this:
New migration that adds another column to the "paritally joined rooms" table
In/near store_partial_state_room write the device list stream ID to that column
maybe also store the join event ID we get back from the
send_joinresponse?When we transition ->
https://github.com/matrix-org/synapse/blob/e3512a7719e90f49e1056e1480358e9ff9de1d9d/synapse/storage /controllers/persist_events.py#L481:L481
device_list_changes_in_roomwith a fixed room_id and where stream_id > ?.Send out device list updates: add_device_list_outbound_pokes
squahtx commentedon Sep 23, 2022
I should mention that while we have partial state, we always send out device list updates to the servers listed in the
servers_in_room/send_joinresponse: #13874so there may be opportunity for optimization based on that
erikjohnston commentedon Sep 28, 2022
I get:
failure on that branch
squahtx commentedon Sep 28, 2022
My mistake, that branch is ever so slightly out of date.
squah/faster_room_joins_device_list_tracking_outgoing_2is the right one to use and all its tests are passing with #13934.squahtx commentedon Sep 28, 2022