Skip site navigation (1) Skip section navigation (2)

Re: pg_upgrade problem with invalid indexes

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>,Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade problem with invalid indexes
Date: 2012-12-07 14:32:51
Message-ID: 20121207143251.GB8476@awork2.anarazel.de (view raw or flat)
Thread:
Lists: pgsql-hackers
On 2012-12-07 09:27:39 -0500, Bruce Momjian wrote:
> On Fri, Dec  7, 2012 at 03:24:46PM +0100, Andres Freund wrote:
> > On 2012-12-07 09:21:58 -0500, Bruce Momjian wrote:
> > > On Thu, Dec  6, 2012 at 10:27:21PM -0500, Stephen Frost wrote:
> > > > * Bruce Momjian (bruce(at)momjian(dot)us) wrote:
> > > > > On Thu, Dec  6, 2012 at 09:45:11PM -0500, Stephen Frost wrote:
> > > > > > Or preserve it as-is.  I don't really like the 'make them fix it'
> > > > > > option, as a user could run into that in the middle of a planned upgrade
> > > > > > that had been tested and never had that come up.
> > > > >
> > > > > They would get the warning during pg_upgrade --check, of course.
> > > >
> > > > Sure, if they happened to have a concurrent index creation going when
> > > > they ran the check...  But what if they didn't and it only happened to
> > > > happen during the actual pg_upgrade?  I'm still not thrilled with this
> > > > idea of making the user have to abort in the middle to address something
> > > > that, really, isn't a big deal to just preserve and deal with later...
> > >
> > > If a concurrent index creation was happening during the check,
> > > pg_upgrade --check would fail.  I don't think there is any indication if
> > > the index is failed, or in process.
> >
> > There should be a lock on the table + index if the creation is in
> > progress.
>
> Well, it is a CONCURRENT index creation, so locking would be minimal.

I wouldn't call a ShareUpdateExclusiveLock minimal...

> Do we want pg_upgrade to be groveling over the lock view to look for
> locks?  I don't think so.

ISTM that anybody who does DDL during or after pg_upgrade --check
deserves any pain.

So throwing an error in both seems perfectly fine for me.

Greetings,

Andres Freund

--
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2012-12-07 14:44:18
Subject: Re: pg_upgrade problem with invalid indexes
Previous:From: Bruce MomjianDate: 2012-12-07 14:27:39
Subject: Re: pg_upgrade problem with invalid indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group