From: Stephane Charette <stephanecharette@telus.net>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Vacuum return codes (vacuum as db integrity check?)
Date: Fri, 08 Nov 2002 13:43:31 -0800
Message-ID: <20021108214330.EBEC3475D20@postgresql.org> (raw)
In-Reply-To: <29560.1036707146@sss.pgh.pa.us>
>> Now I've made a change and I find myself using the command "vacuumdb
>> -f foo" to perform a full vacuum. However, I've noticed that vacuum
>> full seems to return non-zero return values much more often.
>
>This is not a very useful statement. What would be useful is to see the
>error messages you are getting. (Look in the postmaster log, if your
>script is discarding stderr.)
Ok -- I redirected stdout/stderr for postmaster and vacuumdb, and the
problem finally re-occurred a few minutes ago.
This is what happens:
- database is started using "postmaster -D /foo >/tmp/dblog 2>&1 &"
- pg_dumpall is run which results in a return code of zero (Tom Lane
mentionned a few days ago that pg_dumpall might be a better "database
integrity check" than running vacuumdb)
- vacuumdb is started using "vacuumdb -f log >/tmp/vacuumdblog 2>&1"
- vacuumdb results in a return code of 1! (I'm testing how valid our
previous attempts at "integrity checks" might be)
The error received when we run "vacuumdb" is:
-> ERROR: Cannot insert a duplicate key into unique index
pg_class_oid_index
-> vacuumdb: vacuum log failed
The error logged by postmaster is exactly the same:
-> ERROR: Cannot insert a duplicate key into unique index
pg_class_oid_index
Now in the past, when vacuumdb returns non-zero return codes, we've
considered the databasebase to be hosed, and thus, would blow it away
and rebuild it. Many days of data would sometimes be lost. However,
pg_dumpall shows that we seem to still have access to the data.
Looking up "vacuum cannot insert a duplicate key into unique index" on
usenet returns quite a few postings, but no many suggestions or
solutions.
In our case, we are using 7.2 on a linux 2.2.14 kernel. Binaries were
downloaded via RPM directly from RedHat.
My questions now would be:
1) How serious is the vacuumdb error?
2) How do we fix it?
3) Is the database hosed?
Thanks in advance,
Stephane Charette
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: stephanecharette@telus.net
Subject: Re: Vacuum return codes (vacuum as db integrity check?)
In-Reply-To: <20021108214330.EBEC3475D20@postgresql.org>
References: <29560.1036707146@sss.pgh.pa.us> <20021108214330.EBEC3475D20@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