Re: Inadequate thought about buffer locking during hot standby replay

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inadequate thought about buffer locking during hot standby replay
Date: 2012-11-13 08:49:47
Message-ID: 50A209AB.8080804@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12.11.2012 22:53, Tom Lane wrote:
> Here's an updated patch that fixes the GIST replay functions as well as
> the other minor issues that were mentioned. Barring objections, I'll
> set about back-patching this as far as 9.0.

Ok. It won't help all that much on 9.0, though.

> One thing that could use verification is my fix for
> gistRedoPageSplitRecord. AFAICS, the first page listed in the WAL
> record is always the "original" page, and the ones following it are
> pages that were split off from it, and can (as yet) only be reached by
> following right-links from the "original" page. As such, it should be
> okay to release locks on the non-first pages as soon as we've written
> them. We have to hold lock on the original page though to avoid letting
> readers follow dangling right-links. Also, the update of
> NSN/FOLLOW_RIGHT on the child page (if any) has to be done atomically
> with all this, so that has to be done before releasing the original-page
> lock as well. Does that sound right?

Yep.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-11-13 08:57:41 Re: Re: [HACKERS] Patch für MAP_HUGETLB for mmap() shared memory
Previous Message Andres Freund 2012-11-13 08:39:35 Re: Proof of concept: standalone backend with full FE/BE protocol