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

Fix HTTP repl response to use minimum token #16578

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16578.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +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`.
2 changes: 1 addition & 1 deletion synapse/replication/http/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ async def _check_auth_and_handle(

if self.WAIT_FOR_STREAMS:
response[_STREAM_POSITION_KEY] = {
stream.NAME: stream.current_token(self._instance_name)
stream.NAME: stream.minimal_local_current_token()
Comment on lines 435 to +436
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me: why does the requester submit this information again? When submitted, should the requester submit the minimum or maximum current token?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This data is used so that the other side can "wait" until all the streams have advanced to the position included, i.e. when the instance starts processing the request/response it knows that e.g. all cache invalidations have correctly happened.

The difference between request/response here is fairly immaterial.

for stream in self._streams
}

Expand Down
Loading