Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Bruce Momjian
On Sun, Sep 2, 2012 at 11:47:06PM -0400, Tom Lane wrote: Bruce Momjian br...@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

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Also, I don't see my doc addition on your patch; was that intentional? It's not necessary, no? The code now gets socket directory right without help. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Bruce Momjian
On Mon, Sep 3, 2012 at 10:07:43AM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Also, I don't see my doc addition on your patch; was that intentional? It's not necessary, no? The code now gets socket directory right without help. Well, the doc comment is: +If

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Mon, Sep 3, 2012 at 10:07:43AM -0400, Tom Lane wrote: It's not necessary, no? The code now gets socket directory right without help. Well, the doc comment is: +If running check on an old pre-9.1 Unix-like running server, and the +old and

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Bruce Momjian
On Mon, Sep 3, 2012 at 10:42:38AM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Mon, Sep 3, 2012 at 10:07:43AM -0400, Tom Lane wrote: It's not necessary, no? The code now gets socket directory right without help. Well, the doc comment is: +If running check

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: 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

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Bruce Momjian
On Mon, Sep 3, 2012 at 12:16:04PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: 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.

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-03 Thread Bruce Momjian
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 br...@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

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-02 Thread Bruce Momjian
On Sun, Sep 2, 2012 at 01:06:28AM -0400, Robert Haas wrote: For live check operation, you are checking a running server, so assuming the socket is in the current directory is not going to work. What the code does is to read the 5th line from the running server's postmaster.pid file, which

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-02 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 02:35:06PM -0400, Bruce Momjian wrote: On Sat, Sep 1, 2012 at 02:23:22PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: + /* + * Report the Unix domain socket directory location to the postmaster. + */

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-02 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Sun, Sep 2, 2012 at 01:06:28AM -0400, Robert Haas wrote: I don't think this is reducing the number of failure modes; it's just changing it from one set of obscure cases to a slightly different set of obscure cases. Tom reported problems with having

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-02 Thread Bruce Momjian
On Sun, Sep 2, 2012 at 01:13:52PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Sun, Sep 2, 2012 at 01:06:28AM -0400, Robert Haas wrote: I don't think this is reducing the number of failure modes; it's just changing it from one set of obscure cases to a slightly

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-02 Thread Tom Lane
Bruce Momjian br...@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.

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Mon, Aug 13, 2012 at 12:46:43PM +0200, Magnus Hagander wrote: On Mon, Aug 13, 2012 at 4:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: I've been experimenting with moving the Unix socket directory to /var/run/postgresql for the Fedora distribution (don't ask :-(). It's mostly working, but I

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 11:45:58AM -0400, Bruce Momjian wrote: So, in summary, this patch moves the socket directory to the current directory all but live check operation, and handles different socket directories for old cluster = 9.1. I have added a documentation mention of how to make this

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Sat, Sep 1, 2012 at 11:45:58AM -0400, Bruce Momjian wrote: So, in summary, this patch moves the socket directory to the current directory all but live check operation, and handles different socket directories for old cluster = 9.1. I have added a

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: + /* + * Report the Unix domain socket directory location to the postmaster. + */ Report seems entirely the wrong verb there. + #define LISTEN_STR -c listen_addresses='' + + /* Have a sockdir to use? */ + if

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 02:23:22PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: + /* +* Report the Unix domain socket directory location to the postmaster. +*/ Report seems entirely the wrong verb there. + #define LISTEN_STR -c

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Well, you only want the unix_socket* if sockdir is defined, but you want LISTEN_STR unconditionally, even if there is no sockdir. Really? What will happen when the installation's default is to not listen on any Unix socket? (unix_socket_directories = ''

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 02:18:59PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Sat, Sep 1, 2012 at 11:45:58AM -0400, Bruce Momjian wrote: So, in summary, this patch moves the socket directory to the current directory all but live check operation, and handles different

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 02:43:35PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Well, you only want the unix_socket* if sockdir is defined, but you want LISTEN_STR unconditionally, even if there is no sockdir. Really? What will happen when the installation's default is to

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: My point is that we are still going to need traditional connections for live checks. Yes, but that's not terribly relevant, IMO. All it means is that we don't want to invent some solution that doesn't go through libpq. If we could find a solution for

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Sat, Sep 1, 2012 at 02:43:35PM -0400, Tom Lane wrote: I'm inclined to think that the no sockdir case is broken and you should get rid of it. If you're starting a postmaster, you can and should tell it a sockdir, period. If you're running a live

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 03:06:57PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Sat, Sep 1, 2012 at 02:43:35PM -0400, Tom Lane wrote: I'm inclined to think that the no sockdir case is broken and you should get rid of it. If you're starting a postmaster, you can and

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Bruce Momjian
On Sat, Sep 1, 2012 at 03:05:01PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: My point is that we are still going to need traditional connections for live checks. Yes, but that's not terribly relevant, IMO. All it means is that we don't want to invent some solution

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-09-01 Thread Robert Haas
On Sat, Sep 1, 2012 at 11:45 AM, Bruce Momjian br...@momjian.us wrote: On Mon, Aug 13, 2012 at 12:46:43PM +0200, Magnus Hagander wrote: On Mon, Aug 13, 2012 at 4:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: I've been experimenting with moving the Unix socket directory to /var/run/postgresql for

Re: [HACKERS] Yet another failure mode in pg_upgrade

2012-08-13 Thread Magnus Hagander
On Mon, Aug 13, 2012 at 4:34 AM, Tom Lane t...@sss.pgh.pa.us wrote: I've been experimenting with moving the Unix socket directory to /var/run/postgresql for the Fedora distribution (don't ask :-(). It's mostly working, but I found out yet another way that pg_upgrade can crash and burn: it

[HACKERS] Yet another failure mode in pg_upgrade

2012-08-12 Thread Tom Lane
I've been experimenting with moving the Unix socket directory to /var/run/postgresql for the Fedora distribution (don't ask :-(). It's mostly working, but I found out yet another way that pg_upgrade can crash and burn: it doesn't consider the possibility that the old or new postmaster is compiled