Re: Support for REINDEX CONCURRENTLY

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andres Freund <andres@2ndquadrant.com>, Fujii Masao <masao.fujii@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter_e@gmx.net>, Tom Lane <tgl@sss.pgh.pa.us>, Simon Riggs <simon@2ndquadrant.com>
Date: 2013-10-02T04:16:06Z
Lists: pgsql-hackers

Attachments

On Wed, Oct 2, 2013 at 6:06 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> I have pushed the first half of the first patch for now, revising it
> somewhat: I renamed the functions and put them in lmgr.c instead of
> procarray.c.
Great thanks.

> I think the second half of that first patch (WaitForOldSnapshots) should
> be in index.c, not procarray.c either.  I didn't look at the actual code
> in there.
That's indexcmds.c in this case, not index.c.

> I already shipped Michael fixed versions of the remaining patches
> adjusting them to the changed API.  I expect him to post them here.
And here they are attached, with the following changes:
- in 0002, WaitForOldSnapshots is renamed to WaitForOlderSnapshots.
This sounds better...
- in 0003, it looks that there was an error for the obtention of the
parent table Oid when calling index_concurrent_heap. I believe that
the lock that needs to be taken for RangeVarGetRelid is not NoLock but
ShareUpdateExclusiveLock. So changed it this way. I also added some
more comments at the top of each function for clarity.
- in 0004, patch is updated to reflect the API changes done in 0002 and 0003.

Each patch applied with its parents compiles, has no warnings AFAIK
and passes regression/isolation tests. Working on 0004 by the end of
the CF seems out of the way IMO, so I'd suggest focusing on 0002 and
0003 now, and I can put some time to finalize them for this CF. I
think that we should perhaps split 0003 into 2 pieces, with one patch
for the introduction of index_concurrent_build, and another for
index_concurrent_set_dead. Comments are welcome about that though, and
if people agree on that I'll do it once 0002 is finalized.

Regards,
-- 
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Background worker processes

  2. Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY.

  3. Work around unportable behavior of malloc(0) and realloc(NULL, 0).

  4. Properly set relpersistence for fake relcache entries.