Re: pgsql: Improve gist XLOG code to follow the coding

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Subject: Re: pgsql: Improve gist XLOG code to follow the coding
Date: 2006-04-03 16:19:40
Message-ID: 44314B1C.7090308@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tom Lane wrote:
>>> Hmm. That probably needs to be redesigned then.
>
>> Don't understand. Root will be fully regenerated and filled with invalid tuples.
>
> Well, ISTM that if complete replay of the WAL sequence yields an invalid
> index, then you've not got an adequate design for the WAL data. Special
> recovery actions really should only be needed if the WAL log is
> incomplete (ie, it ends in the middle of a page-split sequence).

Hm. The mentioned piece of code executes only for incomplete inserts.
It is a part of gistContinueInsert() called from gist_xlog_cleanup()...

>> I see, there is a problem with gistSplit: it can generate more than 3 pages
>> (three - is a limit of XLogInsert) in a case of bad user's picksplit method...
>
> I think we are OK on that, actually, because the page-split WAL record
> is designed to rewrite all of the pages completely. Only pages that are
> going to be incrementally updated need to be exposed to XLogInsert.
> So the root-page case in page-update is the only one that seems inadequate.

I was reading nbtree code and noticed, that new (just created) page fills "in
place", without START_CRIT_SECTION. As I understand, new page we can easy change
while it hasn't any link from other tree/pages.

gistSplit fills shadow (returned by PageGetTempPage()) of original page, so,
in that case, splitSplit can postpone PageRestoreTempPage() to caller. I can
make changes of gistSplit() on this week.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2006-04-03 16:45:50 pgsql: Fix thinko in gistRedoPageUpdateRecord: if XLR_BKP_BLOCK_1 is
Previous Message Teodor Sigaev 2006-04-03 13:44:33 pgsql: Eliminate ajust scan code.