Re: Re: SPGiST versus hot standby - question about conflict resolution rules

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Re: SPGiST versus hot standby - question about conflict resolution rules
Date: 2012-08-03 18:02:35
Message-ID: 29837.1344016955@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Noah Misch <noah(at)leadboat(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-08-03 18:08:34 Re: WIP pgindent replacement
Previous Message Noah Misch 2012-08-03 17:55:56 Re: CreateLockFile() race condition