Re: WIP: store additional info in GIN index

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: store additional info in GIN index
Date: 2012-12-02 01:02:15
Message-ID: 50BAA897.2040303@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 18.11.2012 22:54, Alexander Korotkov wrote:
> Hackers,
>
> Patch completely changes storage in posting lists and leaf pages of
> posting trees. It uses varbyte encoding for BlockNumber and
> OffsetNumber. BlockNumber are stored incremental in page. Additionally
> one bit of OffsetNumber is reserved for additional information NULL
> flag. To be able to find position in leaf data page quickly patch
> introduces small index in the end of page.

Hi,

I've tried to apply the patch with the current HEAD, but I'm getting
segfaults whenever VACUUM runs (either called directly or from autovac
workers).

The patch applied cleanly against 9b3ac49e and needed a minor fix when
applied on HEAD (because of an assert added to ginRedoCreatePTree), but
that shouldn't be a problem.

The backtrace always looks like this:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004dea3b in processPendingPage (accum=0x7fff15ab8aa0,
ka=0x7fff15ab8a70, page=0x7f88774a7ea0 "", startoff=1) at ginfast.c:785
785 addInfo = index_getattr(itup, 2,
accum->ginstate->tupdesc[curattnum - 1], &addInfoIsNull);
(gdb) bt
#0 0x00000000004dea3b in processPendingPage (accum=0x7fff15ab8aa0,
ka=0x7fff15ab8a70, page=0x7f88774a7ea0 "", startoff=1) at ginfast.c:785
#1 0x00000000004df3c6 in ginInsertCleanup (ginstate=0x7fff15ab97c0,
vac_delay=1 '\001', stats=0xfb0050) at ginfast.c:909
#2 0x00000000004dbe8c in ginbulkdelete (fcinfo=0x7fff15abbfb0) at
ginvacuum.c:747

Reproducing the issue is quite simple:

1) create table messages (id int, txt text, ts tsvector);
2) insert into messages select i, substr(md5(i::text), 0, 4),
to_tsvector('english', substr(md5(i::text), 0, 4))
from generate_series(1,100000) s(i);
3) vacuum messages
4) ... segfault :-(

regards
Tomas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-12-02 02:07:36 Re: ALTER TABLE ... NOREWRITE option
Previous Message Jeff Janes 2012-12-01 22:59:10 Re: PITR potentially broken in 9.2