Track latest completed xid as a FullTransactionId

Enterprise / PostgreSQL - Andres Freund [anarazel.de] - 12 August 2020 00:41 UTC

The reason for doing so is that a subsequent commit will need that to avoid wraparound issues. As the subsequent change is large this was split out for easier review.

The reason this is not a perfect straight-forward change is that we do not want track 64bit xids in the procarray or the WAL. Therefore we need to advance lastestCompletedXid in relation to 32 bit xids. The code for that is now centralized in MaintainLatestCompletedXid*.

Author: Andres Freund

3bd7f9969a Track latest completed xid as a FullTransactionId.
src/backend/access/transam/varsup.c | 50 ++++++++++++++
src/backend/access/transam/xlog.c | 4 +-
src/backend/storage/ipc/procarray.c | 129 +++++++++++++++++++++++++++++-------
src/include/access/transam.h | 37 ++++++++++-
4 files changed, 191 insertions(+), 29 deletions(-)

Upstream: git.postgresql.org


  • Share