fix: Keep one account data entry per type when updates race #2505
No reviewers
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Compliance
Continuwuity/Web Interface
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
bob the builder
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity!2505
Loading…
Reference in a new issue
No description provided.
Delete branch "eleboucher/continuwuity:fix/account-data-stale-versions"
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?
This pull request stops concurrent account data updates from leaving old entries behind, and removes the ones already stored.
Two updates of the same type running at once both read the same previous entry and both remove it, so one of the two new entries is never removed. An initial sync then returns every leftover entry, which MSC4548 forbids (one entry per
type). On my account this reached 14,772 entries of one type and about 200 MB per initial sync.account_data::updatenow takes a per-user lock.Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.