Re: GIN data corruption bug(s) in 9.6devel - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: GIN data corruption bug(s) in 9.6devel
Date
Msg-id 571FA3BB.8000508@sigaev.ru
Whole thread Raw
In response to Re: GIN data corruption bug(s) in 9.6devel  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: GIN data corruption bug(s) in 9.6devel  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
>> Check my reasoning: In version 4 I added a remebering of tail of pending
>> list into blknoFinish variable. And when we read page which was a tail on
>> cleanup start then we sets cleanupFinish variable and after cleaning that
>> page we will stop further cleanup. Any insert caused during cleanup will be
>> placed after blknoFinish (corner case: in that page), so, vacuum should not
>> miss tuples marked as deleted.
>
> Yes, I agree with the correctness of v4.  But I do wonder if we should
> use that early stopping for vacuum and gin_clean_pending_list, rather
Interesting, I've missed this possible option

> than just using it for user backends.  While I think correctness
> allows it to stop early, since these routines are explicitly about
> cleaning things up it seems like they should volunteer to clean the
> whole thing.

I believe that autovacuum should not require guaranteed full clean up, only
vacuum and gin_clean_pending_list() should do that. In all other cases it should
stop early to prevent possible infinite cleanup. Patch attached.


--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Next
From: Teodor Sigaev
Date:
Subject: Re: [PATCH] Phrase search ported to 9.6