Re: Bugs in CREATE/DROP INDEX CONCURRENTLY - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Date
Msg-id CAB7nPqQ4Z4Q=fskhOfBZUfeeO0ZLA5q-k=TZhGDT7cufR1mnhg@mail.gmail.com
Whole thread Raw
In response to Re: Bugs in CREATE/DROP INDEX CONCURRENTLY  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Bugs in CREATE/DROP INDEX CONCURRENTLY  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers


On Thu, Nov 29, 2012 at 8:52 AM, Andres Freund <andres@2ndquadrant.com> wrote:
On 2012-11-28 18:41:39 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.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, and is going to need a lot of rework as well as more infrastructure like a better MVCC-ish SnapshotNow.
--
Michael Paquier
http://michael.otacoo.com

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Next
From: Merlin Moncure
Date:
Subject: Re: json accessors