This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reduce amount of caches POSITIONS we send #16561
Reduce amount of caches POSITIONS we send #16561
Changes from all commits
166848a
d4a7aa4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_cache_id_gen
is None on SQLiteThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the cache stream special?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at the time we didn't have a good way of doing it on SQLite, or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I think I mean two questions:
self.store._cache_id_gen.get_minimal_local_current_token()
andself.current_token(self.local_instance_name)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the case, by my reading of https://github.com/matrix-org/synapse/pull/16557/files#diff-844ba8f7be8c32eb75cc8092e1c48528797f6a8e1eeada942724ba6f73923a9cR214-R218
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I'd missed that this was inside the CachesStream class, I thought this was base logic for all streams.
I guess the point is that if there's no
_cache_id_gen
then there are no other workers to worry about and so the distinction between minimum and current tokens is moot?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other streams whose
minimal_local_current_token
impl we should sanity check?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
I don't think so. Most of the others can just rely directly on the ID gens (and there's a helper class to do that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean more that e.g. the function bodies here don't call something with the word "minimal" in:
synapse/synapse/replication/tcp/streams/federation.py
Lines 74 to 75 in 8f35f81
synapse/synapse/replication/tcp/streams/_base.py
Lines 389 to 390 in 8f35f81
synapse/synapse/replication/tcp/streams/_base.py
Lines 343 to 344 in 8f35f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so yeah you're right that they're suboptimal implementations, but they are also valid implementations. We mostly care about the difference for caches as a) its high traffic, and b) we have an extra check for it that wants
minimal_local_current_token
to return the actual minimum