1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

pg_upgrade: fix shutdown check for standby servers

Commit 244142d32a only tested for the
pg_controldata output for primary servers, but standby servers have
different "Database cluster state" output, so check for that too.

Diagnosed-by: Michael Paquier

Discussion: https://postgr.es/m/20180810164240.GM13638@paquier.xyz

Backpatch-through: 9.3
This commit is contained in:
Bruce Momjian
2018-08-14 17:19:02 -04:00
parent 57b0e0c0bb
commit 235eab04ec

View File

@ -148,7 +148,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
/* remove leading spaces */
while (*p == ' ')
p++;
if (strcmp(p, "shut down\n") != 0)
if (strcmp(p, "shut down\n") != 0 &&
strcmp(p, "shut down in recovery\n") != 0)
{
if (cluster == &old_cluster)
pg_log(PG_FATAL, "The source cluster was not shut down cleanly.\n");