Re: B-tree parent pointer and checkpoints

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Subject: Re: B-tree parent pointer and checkpoints
Date: 2011-09-06 14:42:03
Message-ID: CA+TgmobShW1q__jUHFbXuKy+kx7b73GGpJWaaU5X-MXzzqoUxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 6, 2011 at 10:03 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Robert Haas wrote:
>> On Tue, Sep 6, 2011 at 9:45 AM, Heikki Linnakangas
>> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> >> Do you really need to hold the page locks for all that time, or could
>> >> you cheat? ?Like... release the locks on the split pages but then go
>> >> back and reacquire them to clear the flag...
>> >
>> > Hmm, there's two issues with that:
>> >
>> > 1. While you're not holding the locks on the child pages, someone can step
>> > onto the page and see that the MISSING_DOWNLINK flag is set, and try to
>> > finish the split for you.
>> >
>> > 2. If you don't hold the page locked while you clear the flag, someone can
>> > start and finish a checkpoint after you've inserted the downlink, and before
>> > you've cleared the flag. You end up in a scenario where the flag is set, but
>> > the page in fact *does* have a downlink in the parent.
>>
>> It seems like both of these could be handled by making the code that
>> repairs the damage insert the downlink into the parent only if it's
>> not already present.
>
> I am sorry to be dumping all these new open issues so late in the 9.1
> cycle --- I only now got time to go back over my emails.  Many are from
> March and later.

Well, I don't think we're likely to do anything about this for 9.1.
For 9.2, possibly, we can improve it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-09-06 15:19:45 Re: Couple document fixes
Previous Message Devrim GÜNDÜZ 2011-09-06 14:25:24 Re: Alpha 1 for 9.2