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

Commit 3a2a26e

Browse files
committed
Fix get_un_partial_stated_rooms_token to take instance_name
1 parent 50776af commit 3a2a26e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

synapse/replication/tcp/streams/partial_state.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, hs: "HomeServer"):
4343
super().__init__(
4444
hs.get_instance_name(),
4545
# TODO(faster_joins, multiple writers): we need to account for instance names
46-
current_token_without_instance(store.get_un_partial_stated_rooms_token),
46+
store.get_un_partial_stated_rooms_token,
4747
store.get_un_partial_stated_rooms_from_stream,
4848
)
4949

synapse/storage/databases/main/room.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -1277,13 +1277,10 @@ async def get_join_event_id_and_device_lists_stream_id_for_partial_state(
12771277
)
12781278
return result["join_event_id"], result["device_lists_stream_id"]
12791279

1280-
def get_un_partial_stated_rooms_token(self) -> int:
1281-
# TODO(faster_joins, multiple writers): This is inappropriate if there
1282-
# are multiple writers because workers that don't write often will
1283-
# hold all readers up.
1284-
# (See `MultiWriterIdGenerator.get_persisted_upto_position` for an
1285-
# explanation.)
1286-
return self._un_partial_stated_rooms_stream_id_gen.get_current_token()
1280+
def get_un_partial_stated_rooms_token(self, instance_name: str) -> int:
1281+
return self._un_partial_stated_rooms_stream_id_gen.get_current_token(
1282+
instance_name
1283+
)
12871284

12881285
async def get_un_partial_stated_rooms_from_stream(
12891286
self, instance_name: str, last_id: int, current_id: int, limit: int

0 commit comments

Comments
 (0)