Commit 777e6ddf authored by Bruce Momjian's avatar Bruce Momjian

pg_upgrade: fix shutdown check for standby servers

Commit 244142d3 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
parent 6f159195
...@@ -150,7 +150,8 @@ get_control_data(ClusterInfo *cluster, bool live_check) ...@@ -150,7 +150,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
/* remove leading spaces */ /* remove leading spaces */
while (*p == ' ') while (*p == ' ')
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) if (cluster == &old_cluster)
pg_fatal("The source cluster was not shut down cleanly.\n"); pg_fatal("The source cluster was not shut down cleanly.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment