-
Notifications
You must be signed in to change notification settings - Fork 247
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 #18150
Comments
While implementing this I noticed that when the deletion task runs, it doesn't clean up the We'll need to address that as well, otherwise that table will grow endlessly. |
Also - should we be cleaning up any |
@erikjohnston thoughts on cleaning up |
Any idea which Synapse release we would be targeting for this? (re https://github.com/element-hq/backend-internal/issues/75#issuecomment-2653987772) |
Err, yes they should be cleaned up too |
State Group table cleanup PR: #18165 |
After fixing #9406 and #17937, we still have a bunch of unreferenced state groups in the DB which point to the full state, causing lots of unnecessary DB usage. We should add a background job to go and delete unreferenced state groups.
Note that we can still have new unreferenced state groups, just that when we purge history we won't de-delta the state group entries and instead delete them.
A one-off background job to delete unreferenced state groups would:
state_groups
table, and check if there are any unreferenced ones. Note that we need to check bothevent_to_state_groups
andstate_group_edges
tables.mark_state_groups_as_pending_deletion
to schedule them for deletionI'm also wondering if instead of having this as a one off job we do this periodically to catch new unreferenced state groups.
The text was updated successfully, but these errors were encountered: