Re: Error on vacuum: xmin before relfrozenxid

From: Andres Freund <andres(at)anarazel(dot)de>
To: Paolo Crosato <paolo(dot)crosato(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error on vacuum: xmin before relfrozenxid
Date: 2018-05-22 21:19:37
Message-ID: 20180522211937.bfotr476fkn3rav6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

On 2018-05-22 21:43:01 +0200, Paolo Crosato wrote:
> > Could you report the result of
> > select ctid, xmin, xmax from pg_authid ;
> >
>
> This is the result:
>
> postgres=# select ctid, xmin, xmax from pg_authid ;

> (0,16) | 3031994631 | 0
> 16 | 6496 | 1 | 144 | 3031994631 | 0 | 0 | (0,16)
> | 32779 | 10507 | 32 | 1111111111000000 | 675851 |
> \x6e6167696f73000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000ffffffff496d64356333633236616163636439616665346437383061396239613464663634653639

> postgres=# select relfrozenxid from pg_class where relname='pg_authid';
> relfrozenxid
> --------------
> 400011439

That tuple looks, to me, like it indeed shouldn't exist, given the
relfrozenxid. Decoding infomask (10507 / 0x290B), if I did it right,
shows:

HEAP_HASNULL
HEAP_HASVARWIDTH
HEAP_HASOID
HEAP_XMIN_COMMITTED
HEAP_XMAX_INVALID
HEAP_UPDATED

so it's not frozen. That suggests there's either a bug, or you had
corruption in your cluster.

Could you give a bit of "history" about that postgres instance? What
version of postgres was it run on earliest? Was it ever pg_upgraded?
Were there any OS crashes? Other hardware issues? Was the cluster ever
used with fsync=off or full_page_writes=off?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paolo Crosato 2018-05-22 22:04:26 Re: Error on vacuum: xmin before relfrozenxid
Previous Message Stuart McGraw 2018-05-22 20:28:09 Re: source of connection fails at pg startup?

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-05-22 21:26:58 Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples
Previous Message Vik Fearing 2018-05-22 21:16:43 Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples