Re: Freezing without write I/O - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Freezing without write I/O
Date
Msg-id 51B082FF.2040100@vmware.com
Whole thread Raw
In response to Re: Freezing without write I/O  (Greg Stark <stark@mit.edu>)
Responses Re: Freezing without write I/O
List pgsql-hackers
On 06.06.2013 15:16, Greg Stark wrote:
> On Fri, May 31, 2013 at 3:04 AM, Robert Haas<robertmhaas@gmail.com>  wrote:
>> Even at a more modest 10,000 tps, with default
>> settings, you'll do anti-wraparound vacuums of the entire cluster
>> about every 8 hours.  That's not fun.
>
> I've forgotten now. What happens if you have a long-lived transaction
> still alive from>  2B xid ago?

That will keep OldestXmin from advancing. Which will keep vacuum from 
advancing relfrozenxid/datfrozenxid. Which will first trigger the 
warnings about wrap-around, then stops new XIDs from being generated, 
and finally a forced shutdown.

The forced shutdown will actually happen some time before going beyond 2 
billion XIDs. So it is not possible to have a long-lived transaction, 
older than 2 B XIDs, still live in the system. But let's imagine that 
you somehow bypass the safety mechanism:

After wraparound, old tuples will look like being in the future, and 
will become invisible to new transactions. That happens even if there 
are no old transactions around. I'm not sure what exactly will happen if 
there is still a transaction alive with an XID and/or snapshots older 
than 2^31 XIDs. New tuples that are not supposed to be visible to the 
old snapshot would suddenly become visible, I guess.

- Heikki



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Redesigning checkpoint_segments
Next
From: Heikki Linnakangas
Date:
Subject: Re: Redesigning checkpoint_segments