-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add background job to clear unreferenced state groups #18154
Conversation
I still need to add tests, but otherwise this is currently working. |
Co-authored-by: Erik Johnston <[email protected]>
Co-authored-by: Erik Johnston <[email protected]>
Co-authored-by: Erik Johnston <[email protected]>
Co-authored-by: Erik Johnston <[email protected]>
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.
Just a couple of minor tweaks, otherwise I think the approach is good
Co-authored-by: Erik Johnston <[email protected]>
Should be good to go now! |
Woop, thanks! Sorry for it going round in circles a bit |
Co-authored-by: Erik Johnston <[email protected]>
…s introduced in v1.126.0rc1), due to a suspected issue that causes increased disk usage. (#18222) Revert "Add background job to clear unreferenced state groups (#18154)" This mechanism is suspected of inserting large numbers of rows into `state_groups_state`, thus unreasonably increasing disk usage. See: #18217 This reverts commit 5121f92 (#18154). --------- Signed-off-by: Olivier 'reivilibre <[email protected]>
So, now that this has been reverted because of #18217, is there a plan to rewrite this feature? Smaller instances like ours desperately need this to continue operating. Maybe it is just a matter of doing it in batches of limited size? |
This feature will be fixed to avoid the issue with increasing state group state rows. |
New PR: #18254 |
This PR fixes #18154 to avoid de-deltaing state groups which resulted in DB size temporarily increasing until the DB was `VACUUM`'ed. As a result, less state groups will get deleted now. It also attempts to improve performance by not duplicating work when processing state groups it has already processed in previous iterations. ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Erik Johnston <[email protected]>
Fixes #18150
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)