Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLmBv-000eXh-OL for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 15:00:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qLmAv-00AA4a-SH for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 14:59:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLmAv-00AA4R-J9 for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 14:59:41 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLmAo-0009vI-6G for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 14:59:40 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id C078B2F9C739 for ; Tue, 18 Jul 2023 16:59:33 +0200 (CEST) Received: from s934.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id B19F52E2ABF1 for ; Tue, 18 Jul 2023 16:59:33 +0200 (CEST) Received: from s472.loopia.se (unknown [172.22.191.6]) by s934.loopia.se (Postfix) with ESMTP id B03C17CEA79 for ; Tue, 18 Jul 2023 16:59:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s934.loopia.se ([172.22.191.5]) by s472.loopia.se (s472.loopia.se [172.22.190.12]) (amavisd-new, port 10024) with LMTP id 5MhtJrUMpsNO for ; Tue, 18 Jul 2023 16:59:33 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s934.loopia.se (Postfix) with ESMTPSA id 3D56A7CEA5C for ; Tue, 18 Jul 2023 16:59:33 +0200 (CEST) From: Daniel Gustafsson Content-Type: multipart/mixed; boundary="Apple-Mail=_50AB9A62-D52D-4653-A30B-7EAE7294FCDD" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Giving more detail in pg_upgrade errormessage Message-Id: Date: Tue, 18 Jul 2023 16:59:32 +0200 To: PostgreSQL Hackers X-Mailer: Apple Mail (2.3696.120.41.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_50AB9A62-D52D-4653-A30B-7EAE7294FCDD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Looking at the upgrade question in [0] made me realize that we discard potentially useful information for troubleshooting. When we check if = the cluster is properly shut down we might as well include the status from pg_controldata in the errormessage as per the trivial (but yet untested) proposed diff. Is there a reason not to be verbose here as users might copy/paste this = output when asking for help? -- Daniel Gustafsson [0] CACoPQdbQTysF=3DEKckyFNGTdpOdXXMEsf_2ACno+bcNqQCB5raA@mail.gmail.com --Apple-Mail=_50AB9A62-D52D-4653-A30B-7EAE7294FCDD Content-Disposition: attachment; filename=pg_upgrade_controldata.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="pg_upgrade_controldata.diff" Content-Transfer-Encoding: 7bit diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c index 9071a6fd45..29f1153340 100644 --- a/src/bin/pg_upgrade/controldata.c +++ b/src/bin/pg_upgrade/controldata.c @@ -162,9 +162,9 @@ get_control_data(ClusterInfo *cluster, bool live_check) else if (strcmp(p, "shut down\n") != 0) { if (cluster == &old_cluster) - pg_fatal("The source cluster was not shut down cleanly."); + pg_fatal("The source cluster was not shut down cleanly, state reported as: \"%s\"", p); else - pg_fatal("The target cluster was not shut down cleanly."); + pg_fatal("The target cluster was not shut down cleanly, state reported as: \"%s\"", p); } got_cluster_state = true; } --Apple-Mail=_50AB9A62-D52D-4653-A30B-7EAE7294FCDD--