This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
synapse/replication/tcp/streams Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ Fix a long-standing, exceedingly rare edge case where the first event persisted by a new event persister worker might not be sent down `/sync`.
Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ async def get_updates(self) -> StreamUpdateResult:
161161 and `limited` is whether there are more updates to fetch.
162162 """
163163 current_token = self .current_token (self .local_instance_name )
164+
165+ # If the minimum current token for the local instance is less than or
166+ # equal to the last thing we published, we know that there are no
167+ # updates.
168+ if self .last_token >= self .minimal_local_current_token ():
169+ self .last_token = current_token
170+ return [], current_token , False
171+
164172 updates , current_token , limited = await self .get_updates_since (
165173 self .local_instance_name , self .last_token , current_token
166174 )
@@ -489,6 +497,8 @@ def current_token(self, instance_name: str) -> Token:
489497 return self .store .get_cache_stream_token_for_writer (instance_name )
490498
491499 def minimal_local_current_token (self ) -> Token :
500+ if self .store ._cache_id_gen :
501+ return self .store ._cache_id_gen .get_minimal_local_current_token ()
492502 return self .current_token (self .local_instance_name )
493503
494504
You can’t perform that action at this time.
0 commit comments