perf: Continuwuity does not attempt to automatically squash room extremities #1844
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity#1844
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While investigating some strange state divergence, I realised that the continuwuity community rooms were heavily forked between servers, with some servers having 20+ extremities in some of the rooms. This is particularly bad as this means we have a higher tendency to soft-fail actually valid events as they come in if we're retaining lots of extremities. My own server has thirty five extremities at the time of writing in the offtopic room alone.
Extremity buildup is an expected condition when network partitions are involved, especially in heavily federated rooms like the continuwuity ones, where typically there's 500+ homeservers in the room at any given time, and >50% of the room's population is decentralised (i.e. not on the same server). Synapse has a behaviour to deal with this: dummy events.
A quick database lookup revealed that three privileged Synapse deployments were already occasionally sending dummy events, however since the rest of the room's members aren't allowed to send dummy events, they were not, and were simply aggregating more and more extremities over time, which may never decrease if the server doesn't have an active member sending events.
Conduwuit consciously did not implement any sort of dummy event sending, from memory this was from a misguided belief that they were a crutch for Synapse performance issues, but I've now got evidence to show that they may actually help us in healing some partitioned graphs that end up resulting in an elevated level of erroneous soft-fails.
Theoretically, if we're correctly fetching all missing events after a partition, the number of extremities should naturally reduce back down to near enough one in due time. #1818 helps with this, but is not yet merged nor in a release, and does not appear to resolve the problem completely. As such, I think we should implement some behaviour similar to Synapse's dummy events, to aid in healing partitions and squashing high extremity counts. More investigation is required.
Fixed by #1818