From 35af5422f640e74029a167d106604da35ae64c5f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 21 Aug 2006 16:16:31 +0000 Subject: Make the server track an 'XID epoch', that is, maintain higher-order bits of the transaction ID counter. Nothing is done with the epoch except to store it in checkpoint records, but this provides a foundation with which add-on code can pretend that XIDs never wrap around. This is a severely trimmed and rewritten version of the xxid patch submitted by Marko Kreen. Per discussion, the epoch counter seems the only part of xxid that really needs to be in the core server. --- doc/src/sgml/ref/pg_resetxlog.sgml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_resetxlog.sgml b/doc/src/sgml/ref/pg_resetxlog.sgml index acdf0c7aed4..24504621694 100644 --- a/doc/src/sgml/ref/pg_resetxlog.sgml +++ b/doc/src/sgml/ref/pg_resetxlog.sgml @@ -1,5 +1,5 @@ @@ -22,6 +22,7 @@ PostgreSQL documentation -n -ooid -x xid + -e xid_epoch -m mxid -O mxoff -l timelineid,fileid,seg @@ -61,9 +62,9 @@ PostgreSQL documentation by specifying the -f (force) switch. In this case plausible values will be substituted for the missing data. Most of the fields can be expected to match, but manual assistance may be needed for the next OID, - next transaction ID, next multitransaction ID and offset, + next transaction ID and epoch, next multitransaction ID and offset, WAL starting address, and database locale fields. - The first five of these can be set using the switches discussed below. + The first six of these can be set using the switches discussed below. pg_resetxlog's own environment is the source for its guess at the locale fields; take care that LANG and so forth match the environment that initdb was run in. @@ -76,11 +77,12 @@ PostgreSQL documentation - The -o, -x, -m, -O, + The -o, -x, -e, + -m, -O, and -l - switches allow the next OID, next transaction ID, next multitransaction - ID, next multitransaction offset, and WAL starting address values to - be set manually. These are only needed when + switches allow the next OID, next transaction ID, next transaction ID's + epoch, next multitransaction ID, next multitransaction offset, and WAL + starting address values to be set manually. These are only needed when pg_resetxlog is unable to determine appropriate values by reading pg_control. Safe values may be determined as follows: @@ -146,6 +148,18 @@ PostgreSQL documentation get the next-OID setting right. + + + + The transaction ID epoch is not actually stored anywhere in the database + except in the field that is set by pg_resetxlog, + so any value will work so far as the database itself is concerned. + You might need to adjust this value to ensure that replication + systems such as Slony-I work correctly — + if so, an appropriate value should be obtainable from the state of + the downstream replicated database. + + -- cgit v1.2.3