postgresql/src/include/storage
Thomas Munro 2fc7af5e96 Add basic infrastructure for 64 bit transaction IDs.
Instead of inferring epoch progress from xids and checkpoints,
introduce a 64 bit FullTransactionId type and use it to track xid
generation.  This fixes an unlikely bug where the epoch is reported
incorrectly if the range of active xids wraps around more than once
between checkpoints.

The only user-visible effect of this commit is to correct the epoch
used by txid_current() and txid_status(), also visible with
pg_controldata, in those rare circumstances.  It also creates some
basic infrastructure so that later patches can use 64 bit
transaction IDs in more places.

The new type is a struct that we pass by value, as a form of strong
typedef.  This prevents the sort of accidental confusion between
TransactionId and FullTransactionId that would be possible if we
were to use a plain old uint64.

Author: Thomas Munro
Reported-by: Amit Kapila
Reviewed-by: Andres Freund, Tom Lane, Heikki Linnakangas
Discussion: https://postgr.es/m/CAA4eK1%2BMv%2Bmb0HFfWM9Srtc6MVe160WFurXV68iAFMcagRZ0dQ%40mail.gmail.com
2019-03-28 18:12:20 +13:00
..
.gitignore When trace_lwlocks is used, identify individual lwlocks by name. 2015-09-11 14:01:39 -04:00
backendid.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
barrier.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
block.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
buf.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
buf_internals.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
buffile.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
bufmgr.h Change snapshot type to be determined by enum rather than callback. 2019-01-21 17:03:15 -08:00
bufpage.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
checksum.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
checksum_impl.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
condition_variable.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
copydir.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
dsm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
dsm_impl.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
fd.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
freespace.h Avoid creation of the free space map for small heap relations, take 2. 2019-02-04 07:49:15 +05:30
fsm_internals.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
indexfsm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
ipc.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
item.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
itemid.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
itemptr.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
large_object.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
latch.h Remove volatile from latch API 2019-03-04 11:30:41 +01:00
lmgr.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
lock.h Reorder LOCALLOCK structure members to compact the size 2019-03-19 14:07:08 +01:00
lockdefs.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
lwlock.h Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
off.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_sema.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_shmem.h Add shared_memory_type GUC. 2019-02-03 12:47:26 +01:00
pmsignal.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
predicate.h Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
predicate_internals.h Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
proc.h Move max_wal_senders out of max_connections for connection slot handling 2019-02-12 10:07:56 +09:00
procarray.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
proclist.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
proclist_types.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
procsignal.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
reinit.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
relfilenode.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
s_lock.h Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
sharedfileset.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shm_mq.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shm_toc.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shmem.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
sinval.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
sinvaladt.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
smgr.h Track unowned relations in doubly-linked list 2019-03-27 02:39:39 +01:00
spin.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
standby.h Add basic infrastructure for 64 bit transaction IDs. 2019-03-28 18:12:20 +13:00
standbydefs.h Add basic infrastructure for 64 bit transaction IDs. 2019-03-28 18:12:20 +13:00