-
Notifications
You must be signed in to change notification settings - Fork 639
Ops: Prepare for postgres upgrade #3480
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
Comments
#3886 (comment) might be a good reason to do this in the near-term future |
we discussed this topic in our weekly team meeting today:
|
So, I created a throwaway follower and performed the upgrade on it, and it took between 7 and 8 minutes for the upgrade to finish. This would allow us to have a 10 minute read-only window, which is not bad. The main worry I have is about the read-only follower used for the more heavy queries: when the database is upgraded the old followers are detached, so they can't be used with the new primary. This would mean we'd need to first upgrade the primary from PostgreSQL 11 to PostgreSQL 13, and then create a new read-only follower. Unfortunately followers can't be created straight away from the upgraded database, as the capability to create a follower database is marked as "temporarily unavailable". According to the Heroku documentation a backup is required before being able to create the follower, and backups are hard-capped at 10MB/s. With the current database size (8.2 GB) this would mean waiting at least 13 minutes before we can start creating the new follower, leaving a window when all the queries must go to the primary database. 13 minutes is not that bad though. |
An advantage of resolving #3479 before the upgrade would be actually shrinking our database: the |
given that we've updated to Postgres 13 a while ago, I guess we can close this issue. |
I see no urgency for this migration, but we should start planning for an eventual upgrade. We are currently on PG11 and PG13 is available on Heroku for production use.
Heroku's
pg:upgrade
serves as a guide. We will want to document our own detailed steps and test them out on staging. In particular, we may want to temporarily setup a real leader/follower configuration on staging. (Currently, both connection pools point to the same database on staging.)We will also need to make sure the new download tracking logic works well in read-only mode (dropping download counts for the duration of the migration).
To minimize the time we operate in read-only mode, we will probably want to land #3479 first.
The text was updated successfully, but these errors were encountered: