Re: Summary and Plan for Hot Standby

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Summary and Plan for Hot Standby
Date: 2009-11-15 20:10:53
Message-ID: 4B00604D.1020702@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Sun, 2009-11-15 at 21:20 +0200, Heikki Linnakangas wrote:
>> Simon Riggs wrote:
>>> On Sun, 2009-11-15 at 20:30 +0200, Heikki Linnakangas wrote:
>>>
>>>> The LSN doesn't help there, because when an itemid is marked as dead,
>>>> the LSN is not updated.
>>> I was thinking we could update the index block LSN without writing WAL
>>> using the LSN of the heap block that leads to the killed tuple.
>> That can be before the cleanup record we write before we start the index
>> vacuum.
>
> Oh well. Strike 1.
>
> But the technique sounds OK, we just need to get the LSN of a HeapInfo
> record from somewhere, say, index metapage. Sounds like we need to do
> something similar with the xid.

I'm thinking that we should address the general issue, not just with
vacuum-related deletion records. For the vacuum-related deletion
records, we can just leave the code as it is. I think we talked about
various approaches about a year ago when we first realized that killed
index tuples are a problem, though I don't think we carved out a full
solution.

We could for example stored the xmax (or xmin if it was inserted by an
aborted transaction) of the killed tuple in the b-tree page header
whenever we mark an index tuple as dead. We could then include that in
the WAL record. The trick is how to make that crash-safe.

(but this whole thing is certainly something we can defer until later)

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-11-15 20:16:34 Re: named parameters in SQL functions
Previous Message Simon Riggs 2009-11-15 20:10:45 Re: Hot standby, race condition between recovery snapshot and commit