Re: Support for REINDEX CONCURRENTLY - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Support for REINDEX CONCURRENTLY
Date
Msg-id CAHGQGwF6vf4KKv_1ihyVV26n8XeOphvaysN0nR6-ZGuUM3Bmbg@mail.gmail.com
Whole thread Raw
In response to Re: Support for REINDEX CONCURRENTLY  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Support for REINDEX CONCURRENTLY  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Fri, Mar 1, 2013 at 12:57 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Thu, Feb 28, 2013 at 11:26 PM, Fujii Masao <masao.fujii@gmail.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



pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: Enabling Checksums
Next
From: Josh Berkus
Date:
Subject: Re: Commitfest progress