Re: Transaction ID wraparound: problem and proposed solution

From: Nathan Myers <ncm(at)zembu(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transaction ID wraparound: problem and proposed solution
Date: 2000-11-10 20:01:25
Message-ID: 20001110120125.Q8881@store.zembu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 05, 2000 at 03:48:13PM +0200, Hannu Krosing wrote:
> Tom Lane wrote:
> >
> > Philip Warner <pjw(at)rhyme(dot)com(dot)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(at)zembu(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-10 20:26:55 Re: Coping with 'C' vs 'newC' function language names
Previous Message Lamar Owen 2000-11-10 19:46:58 Re: Problems with Perl