BUG #6710: txid_current() provides incorrect txid after server startup

Поиск
Список
Период
Сортировка
От tarvip@gmail.com
Тема BUG #6710: txid_current() provides incorrect txid after server startup
Дата
Msg-id E1SjmMP-0002E5-0N@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #6710: txid_current() provides incorrect txid after server startup
Список pgsql-bugs
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:=20=20=20=20=20=20=20=20

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.


=3D=3D
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=3D# select now(),txid_current();
              now              | txid_current=20
-------------------------------+--------------
 2012-06-27 09:58:56.298494+03 |          733
(1 row)

postgres=3D# select now(),txid_current();
              now              | txid_current=20
-------------------------------+--------------
 2012-06-27 10:01:15.960031+03 |          734
(1 row)

postgres=3D# checkpoint;
CHECKPOINT
postgres=3D# select now(),txid_current();
              now              | txid_current=20
-------------------------------+--------------
 2012-06-27 10:01:21.180357+03 |  42949673695
(1 row)

postgres=3D#=20

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #6705: 32 bit
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #6705: 32 bit