Re: Access to transaction status - Mailing list pgsql-hackers

From Christian Plattner
Subject Re: Access to transaction status
Date
Msg-id 019f01c33728$01f663d0$6e828481@ethz.ch
Whole thread Raw
In response to Access to transaction status  ("Christian Plattner" <plattner@inf.ethz.ch>)
Responses Re: Access to transaction status  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
----- Original Message ----- 
From: "Tom Lane" <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: Access to transaction status
Next
From: "Christian Plattner"
Date:
Subject: Re: Access to transaction status