• Tom Lane's avatar
    Add code to prevent transaction ID wraparound by enforcing a safe limit · 60b2444c
    Tom Lane authored
    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.
    60b2444c
vacuum.c 98.8 KB