Skip to content

Commit b94f7b5

Browse files
committed
pg_upgrade: issue helpful error message for use on standbys
Commit 777e6dd checked for a shut down message from a standby and allowed it to continue. This patch reports a helpful error message in these cases, suggesting to use rsync as documented. Diagnosed-by: Martín Marqués Discussion: https://postgr.es/m/CAPdiE1xYCow-reLjrhJ9DqrMu-ppNq0ChUUEvVdxhdjGRD5_eA@mail.gmail.com Backpatch-through: 9.3
1 parent ee80124 commit b94f7b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bin/pg_upgrade/controldata.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,14 @@ get_control_data(ClusterInfo *cluster, bool live_check)
150150
/* remove leading spaces */
151151
while (*p == ' ')
152152
p++;
153-
if (strcmp(p, "shut down\n") != 0 &&
154-
strcmp(p, "shut down in recovery\n") != 0)
153+
if (strcmp(p, "shut down in recovery\n") == 0)
154+
{
155+
if (cluster == &old_cluster)
156+
pg_fatal("The source cluster was shut down while in recovery mode. To upgrade, use \"rsync\" as documented or shut it down as a primary.\n");
157+
else
158+
pg_fatal("The target cluster was shut down while in recovery mode. To upgrade, use \"rsync\" as documented or shut it down as a primary.\n");
159+
}
160+
else if (strcmp(p, "shut down\n") != 0)
155161
{
156162
if (cluster == &old_cluster)
157163
pg_fatal("The source cluster was not shut down cleanly.\n");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy