spurious wrap-around shutdown

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: spurious wrap-around shutdown
Date: 2013-06-16 18:54:24
Message-ID: CAMkU=1y2KTWbn23Rdk+4O83qx3Ao2QoCVffDUDBfjSuLPaYudg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In 9.3 HEAD I am getting what seems to be spurious wrap-around shutdowns.

postgres=# SELECT datname, datfrozenxid, age(datfrozenxid) FROM pg_database;

datname | datfrozenxid | age
-----------+--------------+-----------
template1 | 2621759843 | 0
template0 | 2621759843 | 0
postgres | 2571759843 | 50000000
jjanes | 2437230921 | 184528922

postgres=# select txid_current();
ERROR: database is not accepting commands to avoid wraparound data loss in
database "jjanes"
HINT: Stop the postmaster and use a standalone backend to vacuum that
database.
You might also need to commit or roll back old prepared transactions.

184,528,922 is well short of 2 billion, so what is going on?

I thought maybe the ShmemVariableCache were not getting updated when vacuum
finished, but if I restart the server (forcing shared memory to get rebuilt
from disk) the condition continues.

I tried setting a breakpoint on SetTransactionIdLimit, but that seems to
get executed on startup before the -W flag takes effect, so I can't find it.

Any tips on how to debug this? I figure the next step is running git
bisect, but that is sure to be tedious.

I'm using a variant of the below to reach wraparound quicker, perhaps that
is introducing a bug?

http://www.postgresql.org/message-id/20130207203216.GE5172@alvh.no-ip.org

Cheers,

Jeff

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2013-06-16 19:02:06 Re: Fix pgstattuple/pgstatindex to use regclass-type as the argument
Previous Message Josh Berkus 2013-06-16 18:13:14 [9.4 CF 1] Commit Fest has started