Re: HOT WIP Patch - version 1 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: HOT WIP Patch - version 1
Date
Msg-id 45D43ABB.7020509@enterprisedb.com
Whole thread Raw
In response to Re: HOT WIP Patch - version 1  ("Zeugswetter Andreas ADI SD" <ZeugswetterA@spardat.at>)
Responses Re: HOT WIP Patch - version 1  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Re: HOT WIP Patch - version 1  (Hannu Krosing <hannu@skype.net>)
Re: HOT WIP Patch - version 1  ("Simon Riggs" <simon@2ndquadrant.com>)
List 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


pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas ADI SD"
Date:
Subject: Re: HOT WIP Patch - version 1
Next
From: "Pavan Deolasee"
Date:
Subject: Re: HOT WIP Patch - version 1