Re: Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Raiskup <praiskup(at)redhat(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, giomac(at)gmail(dot)com, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve
Date: 2013-08-16 15:43:20
Message-ID: 20130816154320.GA8972@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Aug 12, 2013 at 04:44:12PM -0400, Bruce Momjian wrote:
> On Mon, Aug 12, 2013 at 10:08:07PM +0200, Pavel Raiskup wrote:
> > > The patch moves the atexit setting up, as you suggested, but only does
> > > that when pg_ctl succeeds (we know we started the server),
> >
> > Yes, of course!
> >
> > > PG 9.1+ will allow pg_ctl -w start to succeed even if there are
> > > permissions problems; earlier versions will not and will keep the
> > > server running --- the user will have to stop the server after
> > > pg_upgrade says it is running.
> >
> > This makes it a complex, really.. We may not easily make the
> > stop_postmaster resistant to non-running server. Thus your solution must
> > be good enough.
>
> Well, stop_postmaster can run just fine with a stopped server, as we
> allow the atexit() shutdown to ignore errors. The larger question is
> whether we should ever stop a server we are not sure we started.
>
> The existing pg_upgrade logic checks if the servers are running first
> with start_postmaster(throw_error = false), so in our existing code, we
> could probably unconditionally shutdown the server even with a pg_ctl
> error when using throw_error = true, but pg_upgrade is complex so I am
> hesitant to make such a bold change. Does anyone else have an opinion?
>
> > > I am not going to backpatch this beyond 9.3 as it is risky code. I have
> > > improved the comments in this area.
> >
> > Agree, it is OK for me — thanks for your work.
>
> Sure. You gave me something to study today, and highlighted an area of
> the code that was very unclear.

I have applied a patch to shutdown the server on successful pg_ctl
start, but authentication failure. I have also added code that we might
want to be more aggressive someday.

I backpatched this to 9.3, but not further back as this is a risky area
of the code. Does anyone want to advocate further backpatching?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jov 2013-08-17 09:37:50 BUG 5199:ERROR: cannot override frame clause of window xx
Previous Message bricklen 2013-08-16 15:04:11 Re:

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-08-16 17:03:10 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message Magnus Hagander 2013-08-16 14:42:05 Re: LDAP: bugfix and deprecated OpenLDAP API