From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bartosz Nowak <grubby@go2.pl>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dumpall problem - duplicated users
Date: Fri, 02 Sep 2005 14:18:14 -0400
Message-ID: <15869.1125685094@sss.pgh.pa.us> (raw)
In-Reply-To: <43188A51.5070204@go2.pl>
References: <431816C0.3050509@go2.pl>
<13804.1125670088@sss.pgh.pa.us>
<43186FF0.5030608@go2.pl>
<14629.1125675324@sss.pgh.pa.us>
<43188A51.5070204@go2.pl>
Bartosz Nowak <grubby@go2.pl> writes:
> By the way: isn't that situation a bug in PG? What about a situation
> when this row was obsoleted just before XID counter wrap around and
> there is no way to do vacuum between those facts? The same situation
> would appear.
No, because XID space is circular: you always have exactly 2 billion
transactions before any newly-created row wraps around. (I strongly
suggest you read the manual page I pointed you to.) The bug is that
PG didn't force you to vacuum the table within that time. 8.1 will have
code that warns increasingly stridently and eventually shuts down the
server before wraparound can occur...
> Why should i note the current trans. counter?
See below. Also, if it's not something a bit past 2 billion then this
whole theory is wrong and you don't want to proceed.
> And shouldn't i set XID counter to the max possible value (2^32 = over 4 billion) to avoid some transactions to be seen as "in the future" ?
No. The VACUUM FREEZE will replace every XID in the "immediate past" 2
billion transactions with FrozenXid, which will make that stuff safe
against backing up the XID counter, and then you want to back up so that
the oldest transactions are seen as "in the past" again. You need to
use a starting XID enough less than 2 billion that you have time to
validate and dump the data before those oldest transactions go out of
range again ... but not more than 2 billion less than where it is when
you shut down, else you will have some unfrozen rows "in the future".
At least that's my theory about how to get out of this. Like I said,
it's untried.
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, grubby@go2.pl
Subject: Re: pg_dumpall problem - duplicated users
In-Reply-To: <15869.1125685094@sss.pgh.pa.us>
References: <431816C0.3050509@go2.pl> <13804.1125670088@sss.pgh.pa.us> <43186FF0.5030608@go2.pl> <14629.1125675324@sss.pgh.pa.us> <43188A51.5070204@go2.pl> <15869.1125685094@sss.pgh.pa.us>
* 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