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

Drop unused table public_room_list_stream. #11795

Merged
merged 3 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all 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/11795.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop unused table `public_room_list_stream`.
1 change: 0 additions & 1 deletion synapse/storage/databases/main/purge_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ def _purge_room_txn(self, txn, room_id: str) -> List[int]:
"event_search",
"events",
"group_rooms",
"public_room_list_stream",
Copy link
Member Author

@richvdh richvdh Jan 20, 2022

Choose a reason for hiding this comment

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

the fact this was here means that if you:

  • roll forward to a version including this PR
  • then roll back again
  • then do a "delete room" via the admin API

... then it won't work, and you'll get a 500 error.

I feel like that's a sufficiently unlikely combo that it's not worth worrying about, but if it is of concern then we could do another round of removing references (together with a TRUNCATE TABLE) and do the actual DROP TABLE in the future.

"receipts_graph",
"receipts_linearized",
"room_aliases",
Expand Down
4 changes: 3 additions & 1 deletion synapse/storage/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@


SCHEMA_COMPAT_VERSION = (
61 # 61: Remove unused tables `user_stats_historical` and `room_stats_historical`
# we have removed the public_room_list_stream table, so are now incompatible with
# synapses wth SCHEMA_VERSION < 63.
63
)
"""Limit on how far the synapse codebase can be rolled back without breaking db compat

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright 2022 The Matrix.org Foundation C.I.C
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

-- this table is unused as of Synapse 1.41
DROP TABLE public_room_list_stream;

1 change: 0 additions & 1 deletion tests/rest/admin/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,6 @@ def _block_room(self, room_id: str) -> None:
"event_search",
"events",
"group_rooms",
"public_room_list_stream",
"receipts_graph",
"receipts_linearized",
"room_aliases",
Expand Down