summary refs log tree commit diff
path: root/synapse/storage/controllers
diff options
context:
space:
mode:
authorSean Quah <8349537+squahtx@users.noreply.github.com>2023-02-03 15:39:59 +0000
committerGitHub <noreply@github.com>2023-02-03 15:39:59 +0000
commit0a686d1d13c497af84f62ca192a401fdc18387ab (patch)
tree957f546554b6a193e3e01fbd530349abb259d636 /synapse/storage/controllers
parentReload the pyo3-log config when the Python logging config changes. (#14976) (diff)
downloadsynapse-0a686d1d13c497af84f62ca192a401fdc18387ab.tar.xz
Faster joins: Refactor handling of servers in room (#14954)
Ensure that the list of servers in a partial state room always contains
the server we joined off.

Also refactor `get_partial_state_servers_at_join` to return `None` when
the given room is no longer partial stated, to explicitly indicate when
the room has partial state. Otherwise it's not clear whether an empty
list means that the room has full state, or the room is partial stated,
but the server we joined off told us that there are no servers in the
room.

Signed-off-by: Sean Quah <seanq@matrix.org>
Diffstat (limited to 'synapse/storage/controllers')
-rw-r--r--synapse/storage/controllers/state.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/controllers/state.py b/synapse/storage/controllers/state.py
index 2045169b9a..52efd4a171 100644
--- a/synapse/storage/controllers/state.py
+++ b/synapse/storage/controllers/state.py
@@ -569,10 +569,11 @@ class StateStorageController:
         is arbitrary for rooms with partial state.
         """
         # We have to read this list first to mitigate races with un-partial stating.
-        # This will be empty for rooms with full state.
         hosts_at_join = await self.stores.main.get_partial_state_servers_at_join(
             room_id
         )
+        if hosts_at_join is None:
+            hosts_at_join = frozenset()
 
         hosts_from_state = await self.stores.main.get_current_hosts_in_room(room_id)