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]>
erikjohnston
left a comment
There was a problem hiding this comment.
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
EventStoretoEventWorkerStore.".code blocks.(run the linters)