Skip site navigation (1) Skip section navigation (2)

Re: WAL logging freezing

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: WAL logging freezing
Date: 2006-10-30 16:20:56
Message-ID: 20061030162056.GA26493@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Heikki Linnakangas wrote:
> We just discussed this in detail with Simon, and it looks like we have 
> 5 (!) different but related problems:

Wow, four of them are mine :-(

> 2) vactuple_get_minxid doesn't take into account xmax's of tuples that 
> have HEAP_XMAX_INVALID set. That's a problem:
> 
> transaction 1001 - BEGIN; DELETE FROM foo where key = 1;
> transaction 1001 - ROLLBACK;
> transaction 1002 - VACUUM foo;
> crash
> 
> VACUUM foo will set relminxid to 1002, because HEAP_XMAX_INVALID was set 
> on the tuple (possibly by vacuum itself) that the deletion that rolled 
> back touched. However, that hint-bit update hasn't hit the disk yet, so 
> after recovery, the tuple will have an xmax of 1001 with no hint-bit, 
> and relminxid is 1002.
> 
> The simplest fix for this issue is to ignore the HEAP_XMAX_INVALID hint 
> bit, and take any xmax other than InvalidXid into account when 
> calculating the relminxid.

Ugh.  Is there another solution to this?  Say, sync the buffer so that
the hint bits are written to disk?  The bug (4) below is problematic if
you take this approach; basically it removes all the optimization won by
the relminxid patch.


> Simon volunteered to make the clog changes for 3 because it's a PITR 
> related issue. I can write a patch/patches for the other changes if it 
> helps.

I'm swamped at the moment, so I'd appreciate it.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

pgsql-hackers by date

Next:From: Joshua D. DrakeDate: 2006-10-30 16:27:37
Subject: Index greater than 8k
Previous:From: Teodor SigaevDate: 2006-10-30 15:34:12
Subject: Re: NOTICE: word is too long INSERT 0 3014

pgsql-patches by date

Next:From: Tom LaneDate: 2006-10-30 17:05:19
Subject: Re: WAL logging freezing
Previous:From: Heikki LinnakangasDate: 2006-10-30 14:08:37
Subject: Re: WAL logging freezing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group