Re: Re: SPGiST versus hot standby - question about conflict resolution rules - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: SPGiST versus hot standby - question about conflict resolution rules
Date
Msg-id 29837.1344016955@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: SPGiST versus hot standby - question about conflict resolution rules  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Noah Misch <noah@leadboat.com> writes:
>> We achieve that division of labor for XLOG_BTREE_DELETE by examining the old
>> contents before RestoreBkpBlocks().  This is safe, I think, because we only
>> examine the page when the system has running hot standby backends, and we only
>> allow hot standby connections when recovery has proceeded far enough to fix
>> all torn and ahead-of-EndRecPtr pages.

> Egad.  That's seriously underdocumented as well.

And buggy, now that I look at it.  Suppose a new backend starts
immediately after CountDBBackends runs?  That's okay, because it can't
possibly have seen any page links that we would need to conflict for
... but because the code is lazy and returns InvalidTransactionId,
we'll throw a conflict on it anyway.

The case where the loop doesn't find any live tuples seems problematic
as well.  There's a comment asserting that this will happen "very
rarely", which is neither comforting nor backed up by any evidence or
argument.  ISTM that a page that VACUUM has removed tuples from might
very well have a preimage consisting only of dead tuples.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: CreateLockFile() race condition
Next
From: Andrew Dunstan
Date:
Subject: Re: WIP pgindent replacement