Properly purge state groups tables when purging a room (#18024)
Currently purging a complex room can lead to a lot of orphaned rows left behind in the state groups tables. It seems it is because we are loosing track of state groups sometimes. This change uses the `room_id` indexed column of `state_groups` table to decide what to delete instead of doing an indirection through `event_to_state_groups`. Related to https://github.com/element-hq/synapse/issues/3364. ### Pull Request Checklist * [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). * [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 <erikj@jki.re>
Showing
- changelog.d/18024.bugfix 1 addition, 0 deletionschangelog.d/18024.bugfix
- synapse/storage/controllers/purge_events.py 2 additions, 2 deletionssynapse/storage/controllers/purge_events.py
- synapse/storage/databases/main/purge_events.py 9 additions, 27 deletionssynapse/storage/databases/main/purge_events.py
- synapse/storage/databases/state/store.py 21 additions, 39 deletionssynapse/storage/databases/state/store.py
- tests/rest/admin/test_room.py 1 addition, 1 deletiontests/rest/admin/test_room.py
Loading
Please register or sign in to comment