When you get an email from Heroku that reads:reads…
Your database xxx standard-0 (xxx on scihist-digicoll-production) must undergo maintenance
…. here’s how to do the maintenance at a time of your choosing:
Schedule 10 minutes of downtime
Put the following in a bash script:Disable our hirefire autoscaling to keep it from starting workers back up again: turn off the switch next to “MANAGER” at https://manager.hirefire.io/managers/2533bb0e-4eda-4f45-b8ef-3235c1e302df
Set worker dyno count to zero at https://dashboard.heroku.com/apps/scihist-digicoll-production/resources
Run the following (best done by running a bash script)
heroku maintenance:on --app scihist-digicoll-production heroku pg:maintenance:run --force --app scihist-digicoll-production heroku pg:wait --app scihist-digicoll-production heroku maintenance:off --app scihist-digicoll-production
Scale down workers to zero at https://dashboard.heroku.com/apps/scihist-digicoll-production/resources
Disable our hirefire autoscaling to keep it from starting workers back up again
At the appointed time, run the script.
Restore hirefire and heroku stateRestore Heroku worker dyno type and count
Turn the Hirefire manager back on.