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

Sync ignored table names in synapse_port_db to current database schema #7717

Merged
merged 5 commits into from
Jun 23, 2020
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/7717.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sync the list of tables ignored by `synapose_port_db` with the current database schema.
clokep marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 12 additions & 5 deletions scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,19 @@ APPEND_ONLY_TABLES = [


IGNORED_TABLES = {
# We don't port these tables, as they're a faff and we can regenerate
# them anyway.
"user_directory",
"user_directory_search",
"users_who_share_rooms",
"users_in_pubic_room",
"user_directory_search_content",
clokep marked this conversation as resolved.
Show resolved Hide resolved
"user_directory_search_docsize",
"user_directory_search_segdir",
"user_directory_search_segments",
"user_directory_search_stat",
"user_directory_search_pos",
Comment on lines +135 to +140
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if all of these are regenerated or not...I might be totally off base here.

Copy link
Member

Choose a reason for hiding this comment

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

I think a bunch of these are actually sqlite specific stuff anyway (to support full text search)

Copy link
Member Author

Choose a reason for hiding this comment

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

That means we should include them, correct?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed

"users_who_share_private_rooms",
"users_in_public_room",
Comment on lines +141 to +142
Copy link
Member Author

Choose a reason for hiding this comment

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

These two tables were renamed at some point, I believe.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like they were. They're regenerated because somewhere later in the port code we explicitly reset the entry in the user_directory_stream_pos table

# UI auth sessions have foreign keys so additional care needs to be taken,
# the sessions are transient anyway, so ignore them.
"ui_auth_sessions",
"ui_auth_sessions_credentials",
}
Expand Down Expand Up @@ -300,8 +309,6 @@ class Porter(object):
return

if table in IGNORED_TABLES:
# We don't port these tables, as they're a faff and we can regenerate
# them anyway.
self.progress.update(table, table_size) # Mark table as done
return

Expand Down