Re: Transaction ID wraparound: problem and proposed solution - Mailing list pgsql-hackers

From Nathan Myers
Subject Re: Transaction ID wraparound: problem and proposed solution
Date
Msg-id 20001110120125.Q8881@store.zembu.com
Whole thread Raw
In response to Re: Transaction ID wraparound: problem and proposed solution  (Hannu Krosing <hannu@tm.ee>)
List pgsql-hackers
On Sun, Nov 05, 2000 at 03:48:13PM +0200, Hannu Krosing wrote:
> Tom Lane wrote:
> > 
> > Philip Warner <pjw@rhyme.com.au> writes:
> > >> * disk space --- letting pg_log grow without bound isn't a pleasant
> > >> prospect either.
> > 
> > > Maybe this can be achieved by wrapping XID for the log file only.
> > 
> > How's that going to improve matters?  pg_log is ground truth for XIDs;
> > if you can't distinguish two XIDs in pg_log, there's no point in
> > distinguishing them elsewhere.
> 
> One simple way - start a new pg_log file at each wraparound and encode 
> the high 4 bytes in the filename (or in first four bytes of file)

Proposal:

Annotate each log file with the current XID value at the time the file 
is created.  Before comparing any two XIDs, subtract that value from 
each operand, using unsigned arithmetic. 

At a sustained rate of 10,000 transactions/second, any pair of 32-bit 
XIDs less than 2.5 days apart compare properly.

Nathan Myers
ncm@zembu.com



pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Problems with Perl
Next
From: Tom Lane
Date:
Subject: Re: Coping with 'C' vs 'newC' function language names