Make synapse_port_db correctly create indexes#6102
Conversation
This is so it doesn't need a homeserver object to run
This reverts commit dac8eb0.
This way we don't have to rely on devs thinking about updating the script each time a new store starts using background updates.
|
ftr I'm looking at adding CI to the |
|
Manually tested on a homeserver with a few users and everything seemed to work ok \o/ |
richvdh
left a comment
There was a problem hiding this comment.
So this looks like a good plan, but I have some architectural concerns...
The StatsStore class hasn't been split because it's tied to a lot of code, including code outside of its own file (such as get_event()), and doesn't register any looping call, so it should be fine to leave it as is.
…db_background_updates
87d1de3 to
1eb0600
Compare
|
As requested by @richvdh, the commits about factoring out the background updates from the database code have been moved to a dedicated PR: #6178 - this means that the reviewer can ignore any change to the The commits shown here are the ones pulled by merging that PR's branch into the current branch, since the current PR (#6102) now depends on it. |
richvdh
left a comment
There was a problem hiding this comment.
a few more suggestions for cleanups
richvdh
left a comment
There was a problem hiding this comment.
lgtm otherwise. feel free to fix up and merge.
* commit 'c97ed64db': Make synapse_port_db correctly create indexes (#6102)
Make
synapse_port_dbcorrectly create indexes in the PostgreSQL database, by having it run the background updates on the database before migrating the data.To ensure we're migrating the right data, also block the port if the SQLite3 database still has pending or ongoing background updates.
Fixes #4877