Re: Bugs in CREATE/DROP INDEX CONCURRENTLY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Date: 2012-11-28 19:09:11
Message-ID: 14579.1354129751@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2012-11-27 23:46:58 -0500, Tom Lane wrote:
>> Attached is a very preliminary draft patch for this. I've not addressed
>> the question of whether we can clear indcheckxmin during transactional
>> updates of pg_index rows, but I think it covers everything else talked
>> about in this thread.

> Looks good on a quick lookthrough. Will play a bit more once the
> indexcheckxmin stuff is sorted out.

> Some comments:
> - INDEX_DROP_CLEAR_READY clears indislive, perhasp INDEX_DROP_SET_DEAD
> or NOT_ALIVE is more appropriate?

I changed it to SET_DEAD. Also, on further reflection, I took your
advice to use macros instead of direct tests of the flag columns where
possible.

> - I noticed while trying my old isolationtester test that
> heap_update_inplace disregards any locks on the tuple. I don't really
> see a scenario where this is problematic right now, seems a bit
> dangerous for the future though.

I think this should be all right --- we have at least
ShareUpdateExclusiveLock on the table and the index before we do
anything, so nobody else should be fooling with its pg_index entry.

Attached is an updated patch for HEAD that I think is about ready to go.
I'll start making a back-patchable version shortly.

regards, tom lane

Attachment Content-Type Size
index-flags-fix-2.patch text/x-patch 66.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2012-11-28 19:14:19 Re: pgsql: Refactor flex and bison make rules
Previous Message Merlin Moncure 2012-11-28 19:08:50 Re: json accessors