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

pgsql: Track the current XID wrap limit (or more accurately, the oldest

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Track the current XID wrap limit (or more accurately, the oldest
Date: 2009-08-31 02:23:23
Message-ID: 20090831022323.2F43875331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        varsup.c (r1.84 -> r1.85)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/varsup.c?r1=1.84&r2=1.85)
        xlog.c (r1.349 -> r1.350)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.349&r2=1.350)
    pgsql/src/backend/commands:
        vacuum.c (r1.390 -> r1.391)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c?r1=1.390&r2=1.391)
    pgsql/src/backend/utils/init:
        flatfiles.c (r1.38 -> r1.39)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/init/flatfiles.c?r1=1.38&r2=1.39)
    pgsql/src/backend/utils/misc:
        guc.c (r1.512 -> r1.513)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c?r1=1.512&r2=1.513)
    pgsql/src/bin/pg_controldata:
        pg_controldata.c (r1.43 -> r1.44)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_controldata/pg_controldata.c?r1=1.43&r2=1.44)
    pgsql/src/bin/pg_resetxlog:
        pg_resetxlog.c (r1.74 -> r1.75)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c?r1=1.74&r2=1.75)
    pgsql/src/include/access:
        transam.h (r1.68 -> r1.69)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/transam.h?r1=1.68&r2=1.69)
    pgsql/src/include/catalog:
        pg_control.h (r1.43 -> r1.44)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_control.h?r1=1.43&r2=1.44)

Responses

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2009-08-31 06:48:34
Subject: Re: pgsql: Track the current XID wrap limit (or more accurately, the oldest
Previous:From: Tom LaneDate: 2009-08-30 17:18:52
Subject: pgsql: Remove some useless assignments of the result of fread().

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