Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix order of partial state tables when purging #15068

Merged
merged 5 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15068.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse 1.76.0 where partially-joined rooms could not be deleted using the [purge room API](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#delete-room-api).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was (presumably) present in earlier Synapse versions too, if you had the experiemental faster joins feature turned on. But I didn't want to mention that here.

6 changes: 4 additions & 2 deletions synapse/storage/databases/main/purge_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,14 @@ def _purge_room_txn(self, txn: LoggingTransaction, room_id: str) -> List[int]:
"event_push_actions",
"event_search",
"event_failed_pull_attempts",
# Note: the partial state tables have foreign keys admist each other, and to
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
# `events` and `rooms`. We need to be delete from them in the right order.
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
"partial_state_events",
"partial_state_rooms_servers",
"partial_state_rooms",
"events",
"federation_inbound_events_staging",
"local_current_membership",
"partial_state_rooms_servers",
"partial_state_rooms",
"receipts_graph",
"receipts_linearized",
"room_aliases",
Expand Down