summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier 'reivilibre <oliverw@matrix.org>2024-05-18 16:33:57 +0100
committerOlivier 'reivilibre <oliverw@matrix.org>2024-05-18 16:33:57 +0100
commit122d190e40f574d8df76af57559664b843f2a3ed (patch)
tree99dda8e2a51fd69c44eabcee8fcc84e0e48e7e72
parentMerge branch 'erikj/device_list_sync_perf' into matrix-org-hotfixes (diff)
parentOnly check for all rooms if not outbound poke (diff)
downloadsynapse-122d190e40f574d8df76af57559664b843f2a3ed.tar.xz
Merge branch 'erikj/device_list_sync_perf' into matrix-org-hotfixes
-rw-r--r--synapse/replication/tcp/client.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py

index cff88a87ec..2d6d49eed7 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py
@@ -114,11 +114,12 @@ class ReplicationDataHandler: """ all_room_ids: Set[str] = set() if stream_name == DeviceListsStream.NAME: - prev_token = self.store.get_device_stream_token() - all_room_ids = await self.store.get_all_device_list_changes( - prev_token, token - ) - self.store.device_lists_in_rooms_have_changed(all_room_ids, token) + if any(row.entity.startswith("@") and not row.is_signature for row in rows): + prev_token = self.store.get_device_stream_token() + all_room_ids = await self.store.get_all_device_list_changes( + prev_token, token + ) + self.store.device_lists_in_rooms_have_changed(all_room_ids, token) self.store.process_replication_rows(stream_name, instance_name, token, rows) # NOTE: this must be called after process_replication_rows to ensure any