Re: Access to transaction status

From: "Christian Plattner" <postgresql(at)sioux(dot)ch>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Access to transaction status
Date: 2003-06-20 12:32:26
Message-ID: 019f01c33728$01f663d0$6e828481@ethz.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> How much later? clog is not kept forever.

I took a deeper look into the source. Forget my last posting.

As far as I understand your code there is only one chance that information
in clog gets lost:
If XIDs are reused then ExtendCLOG will overwrite existing entries.
Also, it seems to me that VACCUM has not effect on the clog.

Now let's assume that there is a GET_XID_STATUS(xid) function.

If at the time "GET_XID_STATUS(xid)" gets executed 'xid' has not been reused
(which only should occur after about 4 billion transactions following xid),
then the mechanism should work.

If one uses "TransactionIdPrecedes" to check if xid is in the past (as in my
sample code), then the window is restricted to 2 billion transactions, which
seems enough for me. I implemented this check so that the clog lookup code
does not try to fetch pages that do not yet exist (which crashes the
backend) if one supplies a wrong xid.

What do you think?

Thanks, Christian

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christian Plattner 2003-06-20 12:41:29 Re: Access to transaction status
Previous Message Jeroen T. Vermeulen 2003-06-20 12:30:42 Re: Access to transaction status