pg_upgrade: check for clean server shutdowns

Bruce Momjian <bruce@momjian.us>

Commit: 260fe9f2b02b67de1e5ff29faf123e4220586c43
Author: Bruce Momjian <bruce@momjian.us>
Date: 2018-07-28T19:01:55Z
Releases: 9.5.14
pg_upgrade:  check for clean server shutdowns

Previously pg_upgrade checked for the pid file and started/stopped the
server to force a clean shutdown.  However, "pg_ctl -m immediate"
removes the pid file but doesn't do a clean shutdown, so check
pg_controldata for a clean shutdown too.

Diagnosed-by: Vimalraj A

Discussion: https://postgr.es/m/CAFKBAK5e4Q-oTUuPPJ56EU_d2Rzodq6GWKS3ncAk3xo7hAsOZg@mail.gmail.com

Backpatch-through: 9.3

Files

PathChange+/−
src/bin/pg_upgrade/controldata.c modified +59 −0
src/bin/pg_upgrade/pg_upgrade.c modified +2 −1