Thread: latestCompletedXid

latestCompletedXid

From
Simon Riggs
Date:
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.comPostgreSQL Training, Services and Support



Re: latestCompletedXid

From
Tom Lane
Date:
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