Re: HOT WIP Patch - version 1

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Zeugswetter Andreas ADI SD <ZeugswetterA(at)spardat(dot)at>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Subject: Re: HOT WIP Patch - version 1
Date: 2007-02-15 10:49:31
Message-ID: 45D43ABB.7020509@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zeugswetter Andreas ADI SD wrote:
> I am still wondering about the "easily" here. Basically this
> needs some kind of wal entry to be crash safe.
>
> Else some later tx might reuse the slot:
> - some update on page produces page image in wal
> - slot removed
> - slot reused and comitted
> - page not written
> - crash
> - wal fullpage restores the page to the version before slot
> removed
> (- would need a wal replay for slot removed from hot chain here)
> - wal restores slot reuse, but the slot is now part of a wrong
> hot chain
> and the chain is broken (unless we have the above step)
>
> Do we have this wal entry ?

We already log tuple removals by normal vacuums. We can't use that wal
entry as it is: if a dead tuple is in the middle of an update chain, it
needs to be unlinked from the chain. But I don't see any particular
problem with that, it just needs to be wal logged like every other data
changing operation.

Do we actually ever want to remove dead tuples from the middle of the
chain? If a tuple in the middle of the chain is dead, surely every tuple
before it in the chain is dead as well, and we want to remove them as
well. I'm thinking, removing tuples from the middle of the chain can be
problematic, because we'd need to fiddle with the xmin/xmax of the other
tuples to make them match. Or change the tuple-following logic to not do
the xmin=xmax check, but it's a nice robustness feature.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2007-02-15 11:19:46 Re: HOT WIP Patch - version 1
Previous Message Zeugswetter Andreas ADI SD 2007-02-15 10:23:10 Re: HOT WIP Patch - version 1