You are wondering if you need to do anything to perform the Heroku Postgres maintenance.
There are three different ways for maintenance to occur. The most common way is to do let Heroku perform the maintenance for you. We use your databases maintenance window to determine the best time to run this maintenance automatically.
If you wish to run your maintenance manually you can do so in one of two ways. Via
heroku pg:maintenance --force. This will immediately fail over to your HA follower or the hidden follower if it has been caught up. Your application will immediately restart and be pointed to the new follower.
The other method involves putting your application into maintenance mode before performing the PostgreSQL failover. This can have benefits such as providing a clean landing page for your users, but total downtime can be longer as it is a manual process to enable and disable maintenance mode. We have more detailed information on the maintenance mode page.
There are two ways this maintenance can happen: 1) Automatically by us, or 2) manually by you.
The most common way is to let Heroku perform the maintenance for you. We use your databases maintenance window to determine the best time to run this maintenance automatically. If you want it to happen automatically, you do not need to do anything. Your app restarts as part of the maintenance process, so some users may see errors or delays for a minute or three.
Note: You may see these errors in your logs:
pg is read only, etc. These are artifacts of the changeover process and are safe to ignore as long as everything comes back online.
Manually by you
If you want to have better control over your user experience during the maintenance, you can do it yourself. To perform the maintenance, run the
heroku pg:maintenance:run DATABASE --force -a sushi command at any time before your scheduled maintenance.
You may want to use maintenance mode to turn off the app while the maintenance runs to minimize the errors your users see. That might look something like:
heroku maintenance:on heroku pg:maintenance:run --force heroku pg:wait heroku maintenance:off
If you have built a
database-independent mode into your app, you could use that as well:
# for example heroku config:set READ_ONLY=true heroku pg:maintenance:run --force heroku pg:wait heroku config:set READ_ONLY=false
See Maintenance Types for more information on running the maintenance manually.