Re: Bugs in CREATE/DROP INDEX CONCURRENTLY

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Date: 2012-11-29 00:15:18
Message-ID: 20121129001518.GB16316@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2012-11-29 09:10:22 +0900, Michael Paquier wrote:
> On Thu, Nov 29, 2012 at 8:52 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
>
> > On 2012-11-28 18:41:39 -0500, Tom Lane wrote:
> > > Andres Freund <andres(at)anarazel(dot)de> writes:
> > > > On 2012-11-28 17:42:18 -0500, Tom Lane wrote:
> > > >> I agree it's a judgment call, though. Anybody want to argue for the
> > > >> other position?
> > >
> > > > Hm. Seems odd to include indexes that are being dropped concurrently at
> > > > that moment. But then, we can't really detect that situation and as you
> > > > say its consistent with pg_dump...
> > >
> > > [ thinks about that for a bit... ] We could have that, for about the
> > same
> > > cost as the currently proposed patch: instead of defining the added flag
> > > column as "index is live", define it as "drop in progress", and set it
> > > immediately at the start of the DROP CONCURRENTLY sequence. Then the
> > > "dead" condition that RelationGetIndexList must check for is "drop in
> > > progress and not indisvalid and not indisready".
> >
> > You're right.
> >
> > > However, this is more complicated and harder to understand. So unless
> > > somebody is really excited about being able to tell the difference
> > > between create-in-progress and drop-in-progress, I'd rather leave the
> > > patch as-is.
> >
> > The only real argument for doing this that I can see is a potential
> > REINDEX CONCURRENTLY.
> >
> Patch that has been submitted to this commit fest

Yea, I did a first look through it recently... Not really sure where to
start with the necessary infrastructure yet.

> and is going to need a lot of rework as well as more infrastructure
> like a better MVCC-ish SnapshotNow.

Which is a major project in itself. I wonder whether my crazy "follow
updates via t_ctid isn't the actually easier way to get there in the
short term. On the other hand, a more MVCCish catalog access would be
awesome.

Greetings,

Andres Freund

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-11-29 00:23:25 Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Previous Message Tom Lane 2012-11-29 00:11:46 Re: Bugs in CREATE/DROP INDEX CONCURRENTLY