-
Notifications
You must be signed in to change notification settings - Fork 221
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
Properly purge state groups tables when purging a room #18024
base: develop
Are you sure you want to change the base?
Conversation
edf674a
to
81cadd8
Compare
81cadd8
to
7945610
Compare
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.
Thanks!
column="room_id", | ||
values=[room_id], | ||
keyvalues={}, |
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.
column="room_id", | |
values=[room_id], | |
keyvalues={}, | |
keyvalues={"room_id": room_id}, |
logger.info("[purge] removing %s from state_groups", room_id) | ||
|
||
self.db_pool.simple_delete_many_txn( |
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.
self.db_pool.simple_delete_many_txn( | |
self.db_pool.simple_delete_txn( |
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.
Ah, bah I can't edit the PR. Can you commit the simplifications to the delete?
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 ofstate_groups
table to decide what to delete instead of doing an indirection throughevent_to_state_groups
.Related to #3364.
Pull Request Checklist
(run the linters)