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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use fully-qualified
PersistedEventPosition
when returningRoomsForUser
#17265Use fully-qualified
PersistedEventPosition
when returningRoomsForUser
#17265Changes from 6 commits
271a196
4155e18
939695d
73c20d9
7b41f41
09638ac
cc35e42
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.
On
matrix.org
, my/sync
token looks likes4983244229_757284974_13038521_2867177461_3105561071_197466693_1334422313_10818115877_0_293162
. I assume we use multiple event persisters onmatrix.org
so I would expect it to see them{min_pos}~{writer1}.{pos1}~{writer2}.{pos2}. ...
variant ofRoomStreamToken
at the front? What's happening there?Relevant docs:
synapse/synapse/types/__init__.py
Lines 585 to 605 in 8a32700
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.
hmm, actually I see both used:
Ex.
m4982500302~37.4982500309~3.4982500309~2.4982500309_757284974_11788273_2866394521_3104790542_197391253_1334263147_10815910062_0_293003
Perhaps, this just depends on whether the
now_token
in sync v2 was updated in-place although I seerooms
data in the response when we get either type of token 🤷This isn't an initial vs incremental sync thing. It changes back-and-forth through the life-time of my sync loop.
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.
Do we need to (should we) be more careful about crafting the
RoomStreamToken
in all of the places here? (do they needinstance_map
?)I know in #17187, we talked about constructing the
RoomStreamToken
using theinstance_map
to be ultra correct.I'm racking my brain on each of these locations. My hunch, is that we should be pay closer attention and add the
instance_map
whereRoomStreamToken(stream=room.event_pos.stream, instance_map={ <max-stream-of-each-instance-in-get_rooms_for_local_user_where_membership_is-results> })
Is this something to push off to a more broad, holistic update to how we craft stream tokens everywhere? It's at least as good as it was before in any case.
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 know there was something recent about changing all of the streams to
MultiWriterIdGenerator
for some guarantee (they don't go backwards, or something) (edit: see #17226). Just want to make sure whether it's ok to defineRoomStreamToken(..., instance_map={...})
even if we're not using multiple event persisters. Any kind of check we need before addinginstance_map
? The closest thing I can find is insynapse/storage/databases/main/stream.py#L565
for example.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.
Moving
ShutdownRoomParams
andShutdownRoomResponse
in this PR is a random change but I wasn't able to run the tests because of the circular import here.