Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 83BD31B397F9 for ; Sun, 13 Nov 2011 18:15:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 40620-03 for ; Sun, 13 Nov 2011 22:15:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id DC6AE1B397F8 for ; Sun, 13 Nov 2011 18:15:42 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id pADMFgje080388 for ; Sun, 13 Nov 2011 22:15:42 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id pADMFgvH080387; Sun, 13 Nov 2011 22:15:42 GMT (envelope-from www) Date: Sun, 13 Nov 2011 22:15:42 GMT Message-Id: <201111132215.pADMFgvH080387@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6291: Xid epoch is not updated properly From: "Daniel Farina" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201111/96 X-Sequence-Number: 31691 The following bug has been logged online: Bug reference: 6291 Logged by: Daniel Farina Email address: daniel@heroku.com PostgreSQL version: 9.0.5 Operating system: Ubuntu 10.04 Description: Xid epoch is not updated properly Details: We have on hand a database that makes heavy use of the txid_snapshot family of functions, and recently it just passed its 4^32 transaction mark. Unfortunately, upon wraparound the xid epoch appears to not have been incremented, remaining at 0. However, pg_controldata does properly report a > 4^32 number, and so far it appears the database otherwise functions normally. Here's a snippet: Latest checkpoint's NextXID: 0/2131670 Latest checkpoint's NextOID: 1416740 Latest checkpoint's NextMultiXactId: 1119 Latest checkpoint's NextMultiOffset: 3115 Latest checkpoint's oldestXID: 4131117606 Latest checkpoint's oldestXID's DB: 16385 Latest checkpoint's oldestActiveXID: 0 The result is the following documentation at "http://www.postgresql.org/docs/9.0/static/functions-info.html" is dangerously misleading: "The internal transaction ID type (xid) is 32 bits wide and wraps around every 4 billion transactions. However, these functions export a 64-bit format that is extended with an "epoch" counter so it will not wrap around during the life of an installation. The data type used by these functions, txid_snapshot, stores information about transaction ID visibility at a particular moment in time. Its components are described in Table 9-53."