Skip site navigation (1) Skip section navigation (2)

pgsql: Add code to prevent transaction ID wraparound by enforcing a safe

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add code to prevent transaction ID wraparound by enforcing a safe
Date: 2005-02-20 02:22:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Log Message:
Add code to prevent transaction ID wraparound by enforcing a safe limit
in GetNewTransactionId().  Since the limit value has to be computed
before we run any real transactions, this requires adding code to database
startup to scan pg_database and determine the oldest datfrozenxid.
This can conveniently be combined with the first stage of an attack on
the problem that the 'flat file' copies of pg_shadow and pg_group are
not properly updated during WAL recovery.  The code I've added to
startup resides in a new file src/backend/utils/init/flatfiles.c, and
it is responsible for rewriting the flat files as well as initializing
the XID wraparound limit value.  This will eventually allow us to get
rid of GetRawDatabaseInfo too, but we'll need an initdb so we can add
a trigger to pg_database.

Modified Files:
        maintenance.sgml (r1.40 -> r1.41)
        varsup.c (r1.60 -> r1.61)
        xact.c (r1.195 -> r1.196)
        bootstrap.c (r1.198 -> r1.199)
        dbcommands.c (r1.149 -> r1.150)
        user.c (r1.148 -> r1.149)
        vacuum.c (r1.300 -> r1.301)
        hba.c (r1.137 -> r1.138)
        postmaster.c (r1.443 -> r1.444)
        postgres.c (r1.440 -> r1.441)
        Makefile (r1.17 -> r1.18)
        transam.h (r1.51 -> r1.52)
        user.h (r1.25 -> r1.26)

Added Files:
        flatfiles.c (r1.1)
        flatfiles.h (r1.1)

pgsql-committers by date

Next:From: User T-ishiiDate: 2005-02-20 04:17:38
Subject: pgpool - pgpool: Emit log when pgpool starts up
Previous:From: Tom LaneDate: 2005-02-19 23:16:28
Subject: pgsql: New arrangement to always let the bgwriter do checkpoints broke

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group