Had a problem with pg_clog

Started by Peter Wiersigalmost 21 years ago5 messagesgeneral
Jump to latest
#1Peter Wiersig
peter@friesenpeter.de

Hi List,

I had a database with a 8 Mb pg_dump file with 1.7 Gb in PG_DATA.

I dropped the database and tried to recreate the db with this
step:

psql template1 < data.sql

All tables and all data was restored and to help accessing the db
I tried to vacuum analyze it, yielding this error message:

vacuumdb -z miwabar
PANIC: open of /var/lib/pgsql/data/pg_clog/0000 failed:
Keine Berechtigung
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
connection to server was lost
vacuumdb: vacuum miwabar failed

The panic message with -v gave
PANIC: read of clog file 0, offset 16384 failed: Erfolg

which lead me to the mailing-list archive and the following fix:

dd bs=32k count=1 </dev/zero >/var/lib/pgsql/data/pg_clog/0000
1+0 records in
1+0 records out

afterwards my vacuum works.

Had I done the right thing?

Should I have expected this error?

--
Peter

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Wiersig (#1)
Re: Had a problem with pg_clog

Peter Wiersig <peter@friesenpeter.de> writes:

vacuumdb -z miwabar
PANIC: open of /var/lib/pgsql/data/pg_clog/0000 failed:
Keine Berechtigung
server closed the connection unexpectedly

What PG version is this exactly? We have had some bugs of that
ilk in the past, but AFAIK they are all resolved in latest releases.

regards, tom lane

#3Peter Wiersig
peter@friesenpeter.de
In reply to: Tom Lane (#2)
Re: Had a problem with pg_clog

On Sat, Apr 23, 2005 at 08:19:31PM -0400, Tom Lane wrote:

Peter Wiersig <peter@friesenpeter.de> writes:

vacuumdb -z miwabar
PANIC: open of /var/lib/pgsql/data/pg_clog/0000 failed:
Keine Berechtigung
server closed the connection unexpectedly

What PG version is this exactly?

It's 7.3.9 from SUSE rpms postgresql-7.3.9-3

--
Peter

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Wiersig (#3)
Re: Had a problem with pg_clog

Peter Wiersig <peter@friesenpeter.de> writes:

On Sat, Apr 23, 2005 at 08:19:31PM -0400, Tom Lane wrote:

Peter Wiersig <peter@friesenpeter.de> writes:

vacuumdb -z miwabar
PANIC: open of /var/lib/pgsql/data/pg_clog/0000 failed:
Keine Berechtigung
server closed the connection unexpectedly

What PG version is this exactly?

It's 7.3.9 from SUSE rpms postgresql-7.3.9-3

Hmm. 7.3.9 has all the known patches for hint-bit updates and premature
clog truncation, but maybe you have found a new bug. Can you repeat
this failure from a standing start --- that is, initdb, load your data
dump, vacuumdb, PANIC? If so I would very much appreciate a copy of
your data dump, if that's possible.

regards, tom lane

#5Peter Wiersig
peter@friesenpeter.de
In reply to: Tom Lane (#4)
Re: Had a problem with pg_clog

On Sun, Apr 24, 2005 at 11:52:11AM -0400, Tom Lane wrote:

Peter Wiersig <peter@friesenpeter.de> writes:

On Sat, Apr 23, 2005 at 08:19:31PM -0400, Tom Lane wrote:

Peter Wiersig <peter@friesenpeter.de> writes:

vacuumdb -z miwabar
PANIC: open of /var/lib/pgsql/data/pg_clog/0000 failed:
Keine Berechtigung
server closed the connection unexpectedly

What PG version is this exactly?

It's 7.3.9 from SUSE rpms postgresql-7.3.9-3

Hmm. 7.3.9 has all the known patches for hint-bit updates and
premature clog truncation,

Good.

Can you repeat this failure from a standing start --- that is,
initdb, load your data dump, vacuumdb, PANIC?

No, I couldn't.

But I can with the old cluster.

And only if I create the new database with the sequence "psql
template1 <dump_with_create.sql; vacuumdb test".

Other combinations like "createdb test; psql test
<dump_with_create.sql; vacuumdb test" work.

I never tried to restore from a dump created by "pg_dump -C"
before, but this time I was in a hurry to free up more disk space.

--
Peter