Discourse update doesn't wait for Postgress DB to shut down

It’s not shutting down, it’s not starting up properly because the redo log is damaged. If you have a backup you should consider recovering it on a blank instance.