Re: Support for REINDEX CONCURRENTLY

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for REINDEX CONCURRENTLY
Date: 2013-03-01 17:43:58
Message-ID: CAHGQGwF6vf4KKv_1ihyVV26n8XeOphvaysN0nR6-ZGuUM3Bmbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 1, 2013 at 12:57 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Thu, Feb 28, 2013 at 11:26 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>> I found one problem in the latest patch. I got the segmentation fault
>> when I executed the following SQLs.
>>
>> CREATE TABLE hoge (i int);
>> CREATE INDEX hogeidx ON hoge(abs(i));
>> INSERT INTO hoge VALUES (generate_series(1,10));
>> REINDEX TABLE CONCURRENTLY hoge;
>>
>> The error messages are:
>>
>> LOG: server process (PID 33641) was terminated by signal 11: Segmentation
>> fault
>> DETAIL: Failed process was running: REINDEX TABLE CONCURRENTLY hoge;
>
> Oops. Index expressions were not correctly extracted when building
> columnNames for index_create in index_concurrent_create.
> Fixed in this new patch. Thanks for catching that.

I found another problem in the latest patch. When I issued the following SQLs,
I got the assertion failure.

CREATE EXTENSION pg_trgm;
CREATE TABLE hoge (col1 text);
CREATE INDEX hogeidx ON hoge USING gin (col1 gin_trgm_ops) WITH
(fastupdate = off);
INSERT INTO hoge SELECT random()::text FROM generate_series(1,100);
REINDEX TABLE CONCURRENTLY hoge;

The error message that I got is:

TRAP: FailedAssertion("!(((array)->elemtype) == 25)", File:
"reloptions.c", Line: 874)
LOG: server process (PID 45353) was terminated by signal 6: Abort trap
DETAIL: Failed process was running: REINDEX TABLE CONCURRENTLY hoge;

ISTM that the patch doesn't handle the gin option "fastupdate = off" correctly.

Anyway, I think you should test whether REINDEX CONCURRENTLY goes well
with every type of indexes, before posting the next patch. Otherwise,
I might find
another problem ;P

@@ -1944,7 +2272,8 @@ index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
bool isprimary,
- bool isreindex)
+ bool isreindex,
+ bool istoastupdate)

istoastupdate seems to be unused.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-03-01 18:36:13 Re: Commitfest progress
Previous Message Daniel Farina 2013-03-01 16:48:31 Re: Enabling Checksums