From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Madsen <tm@softcom.dk>
Cc: pgsql-admin@postgresql.org
Subject: Re: Vacuum full - disk space eaten by WAL logfiles
Date: Tue, 28 Sep 2004 10:45:31 -0400
Message-ID: <14629.1096382731@sss.pgh.pa.us> (raw)
In-Reply-To: <64F70386AE9AB64D8F36DD6FC355555E8FE2C0@hal9000.softcom.local>
References: <64F70386AE9AB64D8F36DD6FC355555E8FE2C0@hal9000.softcom.local>
"Thomas Madsen" <tm@softcom.dk> writes:
> I raised it to 3,000,000 and tried a "VACUUM FULL" on the table. Out
> popped an error when it reached the toast table index: "Number of tuples
> (xxx) not same at number in heap (XXX), recreate index". The numbers
> (XXX) differed by just 2. It then started recreating the index, but
> stopped short when another error popped up: "insertion of duplicate
> keys"-failure.
VACUUM FULL will not try to "recreate the index", so you misinterpreted
what you were seeing.
> I have subsequently attempted to reindex the tables/indexes, but it
> didn't help a bit. I still got the: "Number of tuples (xxx) not same at
> number in heap (XXX), recreate index"- error.
I have some vague memory that it's difficult to get the system to accept
a REINDEX on a toast table or toast index in older versions. REINDEXing
the base table will *not* fix it, you need to specify the toast object
by name. Does it let you do that?
> The last lines keep coming until no more diskspace is left. I searched
> this forum and got some hints to this problem.
> I raised the "checkpoint" default values in postgres.conf to these
> values, which should have decreased the need for diskspace:
It's checkpoints that are responsible for recycling WAL files.
It sounds to me like checkpoints just aren't happening at all, which
seems odd. Does a checkpoint subprocess appear while this is going on?
It might well be that your best bet is to dump and reload that
particular table. You don't necessarily have to use pg_dump, you
could do something like
CREATE TABLE dup AS SELECT * from badtable;
TRUNCATE badtable;
INSERT INTO badtable SELECT * FROM dup;
DROP TABLE dup;
(7.2 had TRUNCATE didn't it? I forget.)
In any case I would *strongly* recommend an update to 7.2.5, which you
can do in-place without a dump/reload. We do not make bugfix releases
on a whim --- there are some pretty serious bugs fixed between 7.2.1 and
7.2.5.
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, tm@softcom.dk
Subject: Re: Vacuum full - disk space eaten by WAL logfiles
In-Reply-To: <14629.1096382731@sss.pgh.pa.us>
References: <64F70386AE9AB64D8F36DD6FC355555E8FE2C0@hal9000.softcom.local> <14629.1096382731@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