Re: [PG_UPGRADE] 9.6 to 10.5 - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: [PG_UPGRADE] 9.6 to 10.5
Date
Msg-id 20180810172525.GC7815@momjian.us
Whole thread Raw
In response to Re: [PG_UPGRADE] 9.6 to 10.5  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [PG_UPGRADE] 9.6 to 10.5
List pgsql-bugs
On Fri, Aug 10, 2018 at 07:23:29PM +0200, Michael Paquier wrote:
> On Fri, Aug 10, 2018 at 12:53:47PM -0400, Bruce Momjian wrote:
> > Oh, good point. I had not tested that.  I can develop a patch to handle
> > this.  Was that the case in this upgrade report?
> 
> I cannot say if this is the issue reported here for sure, but the OP has
> mentioned "clusters", which may point to the fact that he is trying to
> upgrade standby(s) as well.
> 
> You need visibly a one-liner like that:
> --- a/src/bin/pg_upgrade/controldata.c
> +++ b/src/bin/pg_upgrade/controldata.c
> @@ -150,7 +150,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_fatal("The source cluster was not shut down cleanly.\n");
> 
> I have not tested it though.

I was going to do:

    /* handle "shut down" and "shut down in recovery" (on standbys)
    strncmp(p, "shut down", strlen("shut down"))

but maybe yours is clearer.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PG_UPGRADE] 9.6 to 10.5
Next
From: Michael Paquier
Date:
Subject: Re: [PG_UPGRADE] 9.6 to 10.5