]> granicus.if.org Git - postgresql/commit
Track the current XID wrap limit (or more accurately, the oldest unfrozen
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 31 Aug 2009 02:23:23 +0000 (02:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 31 Aug 2009 02:23:23 +0000 (02:23 +0000)
commit25ec228ef760eb91c094cc3b6dea7257cc22ffb5
tree59d9d82fa2a61c1c27174d9b2f462536a7db39ee
parente1cc64197bd3a8d6fd5e4ca6830d514130f2737f
Track the current XID wrap limit (or more accurately, the oldest unfrozen
XID) in checkpoint records.  This eliminates the need to recompute the value
from scratch during database startup, which is one of the two remaining
reasons for the flatfile code to exist.  It should also simplify life for
hot-standby operation.

To avoid bloating the checkpoint records unreasonably, I switched from
tracking the oldest database by name to tracking it by OID.  This turns
out to save cycles in general (everywhere but the warning-generating
paths, which we hardly care about) and also helps us deal with the case
that the oldest database got dropped instead of being vacuumed.  The prior
coding might go for a long time without updating the wrap limit in that case,
which is bad because it might result in a lot of useless autovacuum activity.
src/backend/access/transam/varsup.c
src/backend/access/transam/xlog.c
src/backend/commands/vacuum.c
src/backend/utils/init/flatfiles.c
src/backend/utils/misc/guc.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/include/access/transam.h
src/include/catalog/pg_control.h