From: tarvip@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6710: txid_current() provides incorrect txid after server startup
Date: Wed, 27 Jun 2012 07:08:21 +0000
Message-ID: <E1SjmMP-0002E5-0N@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6710
Logged by: Tarvi Pillessaar
Email address: tarvip@gmail.com
PostgreSQL version: 9.1.4
Operating system: linux
Description:
This happens when epoch is greater than 0.
After a checkpoint it starts providing correct txid.
It seems that this regression is caused by following commit:
20d98ab6e4110087d1816cd105a40fcc8ce0a307 Correct epoch of txid_current()
when executed on a Hot Standby server.
When reverting this commit, txid_current() works as expected.
==
postgres@sbox ~ $ /usr/local/pgsql/bin/pg_resetxlog -n
/usr/local/pgsql/data
pg_control values:
First log file ID after reset: 0
First log file segment after reset: 3
pg_control version number: 903
Catalog version number: 201105231
Database system identifier: 5758410178624748543
Latest checkpoint's TimeLineID: 1
Latest checkpoint's NextXID: 10/733
Latest checkpoint's NextOID: 16385
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 710
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 131072
WAL block size: 8192
Bytes per WAL segment: 16777216
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
postgres@sbox ~ $ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
>/tmp/logfile 2>&1 &
[1] 2435
postgres@sbox ~ $ /usr/local/pgsql/bin/psql
psql (9.1.4)
Type "help" for help.
postgres=# select now(),txid_current();
now | txid_current
-------------------------------+--------------
2012-06-27 09:58:56.298494+03 | 733
(1 row)
postgres=# select now(),txid_current();
now | txid_current
-------------------------------+--------------
2012-06-27 10:01:15.960031+03 | 734
(1 row)
postgres=# checkpoint;
CHECKPOINT
postgres=# select now(),txid_current();
now | txid_current
-------------------------------+--------------
2012-06-27 10:01:21.180357+03 | 42949673695
(1 row)
postgres=#
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tarvip@gmail.com
Subject: Re: BUG #6710: txid_current() provides incorrect txid after server startup
In-Reply-To: <E1SjmMP-0002E5-0N@wrigleys.postgresql.org>
References: <E1SjmMP-0002E5-0N@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox