Re: Yet another failure mode in pg_upgrade - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Yet another failure mode in pg_upgrade
Date
Msg-id 20120904022258.GI24132@momjian.us
Whole thread Raw
In response to Re: Yet another failure mode in pg_upgrade  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Mon, Sep  3, 2012 at 09:52:22AM -0400, Bruce Momjian wrote:
> On Sun, Sep  2, 2012 at 11:47:06PM -0400, Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > Updated patch attached.
> >
> > [ looks at that for a bit... ]  Now I see why you were on about that:
> > the method you used here requires both clusters to have the same socket
> > directory.  Which is silly and unnecessary.  Revised patch attached.
>
> I was trying to avoid setting the host for every client database
> application, so I set PGHOST, but your use of get_db_conn() has
> simplified that, which I had not considered.  Also, you will need to
> update the comment above cluster_conn_opts() to match your new function
> name.
>
> I am working on an additional enhancement that also pulls the live
> cluster's port number from the postmaster.pid file.  I am attaching the
> part of my patch that was modified to add that feature.  This allows
> live checks without requiring any port numbers to be specified.  Let me
> know if you would like me to email you that merged into your patch, if
> you want it for 9.2.
>
> Also, I don't see my doc addition on your patch;  was that intentional?

I have applied a modified version of the above patch, attached, to head
and 9.2.  One additional change in this patch is that the current
directory is not used for pre-9.1 servers, in live check and non-live
check mode, because pre-9.1 pg_ctl -w can't handle sockets in
non-default locations;  the info isn't in postmaster.pid for it to use.
I found this in testing the patch and using a script that tests all
possible major version combinations.

I am concerned this will hamper Tom's attempt to allow for changes to
the compiled-in socket location for pre-9.1 servers, but I don't see a
solution.  FYI, all the binaries will be from the new server, and will
have the new compiled-in socket location.  I suggest using -o to pass in
the socket location.  The new server will use the current directory just
fine.  Tom's patch allowing the old and new servers to use different
socket directories helps in this regard.

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

  + It's impossible for everything to be true. +

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Is this non-volatile pointer access OK?
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade del/rmdir path fix