latestCompletedXid

Started by Simon Riggsover 17 years ago2 messages
#1Simon Riggs
simon@2ndQuadrant.com

Currently, we advance latestCompletedXid during
ProcArrayEndTransaction() for both commits and aborts.

If a transaction aborts, its effects are invisible to us just the same
as if the transaction is still running.

ISTM that we need not move latestCompletedXid as a result of an abort.
Only a commit could change what we see as visible.

This must be true, because if a backend had a FATAL error but yet exited
before it ran ProcArrayEndTransaction() we would not move
latestCompletedXid forward either.

Avoiding this will make snapshots smaller in some cases, but it's really
just a correctness thing.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Simon Riggs (#1)
Re: latestCompletedXid

Simon Riggs <simon@2ndQuadrant.com> writes:

ISTM that we need not move latestCompletedXid as a result of an abort.

I see no value in this; it just makes things less consistent without
buying any noticeable performance gain.

regards, tom lane