Skip to content

Sliding sync: various fixes to background update#17636

Merged
erikjohnston merged 7 commits into
developfrom
erikj/ss_fix_bg_update6
Sep 1, 2024
Merged

Sliding sync: various fixes to background update#17636
erikjohnston merged 7 commits into
developfrom
erikj/ss_fix_bg_update6

Conversation

@erikjohnston

Copy link
Copy Markdown
Member

Follows on from #17512, other fixes include: #17633, #17634, #17635

LEFT JOIN rooms AS r ON (c.room_id = r.room_id)
WHERE c.room_id > ?
ORDER BY c.room_id ASC
WHERE (c.room_id, c.user_id) > (?, ?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing this means the background update needed to be restarted to ensure we didn't drop anything along the way before?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or actually, I'm guessing the background update was just stuck on one room because it had more members than the batch size. So it doesn't need to be restarted.

WHERE
room_id = ?
AND m.user_id = ?
AND (m.membership = ? OR m.membership = ?)

@MadLittleMods MadLittleMods Aug 30, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What was the root cause to add this caveat to only check for invite/knock?

Perhaps a double-leave event somewhere although Synapse doesn't seem to allow that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, this was a ban + leave I think

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ahh so ban and unban

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documented in #17654

?, ?, ?, ?, ?,
(SELECT stream_ordering FROM events WHERE event_id = ?),
(SELECT instance_name FROM events WHERE event_id = ?)
(SELECT COALESCE(instance_name, 'master') FROM events WHERE event_id = ?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch. I assume this became obvious after running the background update on matrix.org since this is a NOT NULL column 😵

@erikjohnston erikjohnston merged commit d52c17c into develop Sep 1, 2024
@erikjohnston erikjohnston deleted the erikj/ss_fix_bg_update6 branch September 1, 2024 09:18
MadLittleMods added a commit that referenced this pull request Sep 9, 2024
…ted -> banned -> unbanned (#17654)

Add comment to explain extra case where you can be
invited -> banned -> unbanned and we want to be able
to find the invite event.

Follow-up to #17636 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants