-
Notifications
You must be signed in to change notification settings - Fork 217
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
Sliding sync: various fixups to the sliding sync joined room background job #17673
Conversation
This has two advantages: the first is we only read rooms that the server is joined to. The second is that we can end up locked for ages waiting for various delete room jobs that are running (which lock the rooms rows).
We somehow have a room where the only non-outlier event has a negative stream ordering. It is unclear how this happened.
34d201f
to
d60e55b
Compare
assert most_recent_event_stream_ordering > 0, ( | ||
"We should have at-least one event in the room (our own join membership event for example) " | ||
+ "that isn't backfilled (negative `stream_ordering`) if we are joined to the room." | ||
) |
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 guess there is a room where this is possible? We should add a comment in this asserts place that ideally we could assert this but there is actually some case where it happens.
# If we've just joined a remote room, then the last bump event may
# have been backfilled (and so have a negative stream ordering).
# These negative stream orderings can't sensibly be compared, but TODO
We need some value since the event_stream_ordering
is a NOT NULL
column. Negative works but we avoid doing it in other places since it would send the room to the bottom of the list on the client.
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.
SELECT DISTINCT room_id FROM local_current_membership | ||
WHERE membership = 'join' |
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 assume you've tested that this is fast enough?
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.
It's not ideal, but it completes in a few minutes on matrix.org, so should be fast enough everywhere else.
Follow-up to #17652, #17641, #17634, #17631 and #17632 to fix-up #17512