473,385 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

pg_clog and pg_xlog empty, postgresql refuses to start

First things first: Postgresql 8.4.2 on Fedora Core 2 X86.

Something seems to have happened to my pg_xlog and pg_clog directories after
(I believe) a power outage. In the course of trying to figure out why the
server wouldn't start, I cleaned out pg_clog and pg_xlog, in an obviously
vain attempt to reset things. I was under the impression that the server
could start without those files. Now I seem to be stuck.

So now what?

Here is what postmaster has to say on the subject:

LOG: database system was shut down at 2004-08-16 15:52:01 PDT
LOG: could not open file
"/usr/local/var/lib/pgsql32-broken/pg_xlog/0000000F000000F3" (log file 15,
segment 243): No such file or directory
LOG: invalid primary checkpoint record
LOG: could not open file
"/usr/local/var/lib/pgsql32-broken/pg_xlog/0000000F000000F3" (log file 15,
segment 243): No such file or directory
LOG: invalid secondary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 9920) was terminated by signal 6
LOG: aborting startup due to startup process failure

Thx
Glen Parker
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
3 8957
"Glen Parker" <gl******@nwlink.com> writes:
First things first: Postgresql 8.4.2 on Fedora Core 2 X86.
I take it this message fell through a time warp ;-)
Something seems to have happened to my pg_xlog and pg_clog directories after
(I believe) a power outage. In the course of trying to figure out why the
server wouldn't start, I cleaned out pg_clog and pg_xlog, in an obviously
vain attempt to reset things. I was under the impression that the server
could start without those files. Now I seem to be stuck.


That was probably not your best first move...

I'd put back the clog files if at all possible. If not you can
substitute zero-filled 256K files for each clog file the server
complains about not finding, but realize that you *will* be losing
transactions in whole or in part.

As for pg_xlog, you can cons up dummy xlog contents with pg_resetxlog,
but again you'd be better off with the real thing. The dummy files will
not be capable of replaying whatever happened since your last checkpoint.

What failures were you getting *before* you decided to try this?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
> > First things first: Postgresql 8.4.2 on Fedora Core 2 X86.

I take it this message fell through a time warp ;-)
Yep :-)
7.4.2.
...I cleaned out pg_clog and pg_xlog...


That was probably not your best first move...


This is actually a development copy of our real database, so worst-case
scenario is a dump/restore. No big deal.
I'd put back the clog files if at all possible. If not you can
substitute zero-filled 256K files for each clog file the server
complains about not finding, but realize that you *will* be losing
transactions in whole or in part.

As for pg_xlog, you can cons up dummy xlog contents with pg_resetxlog,
but again you'd be better off with the real thing. The dummy files will
not be capable of replaying whatever happened since your last checkpoint.
OK, all the files I deleted, I really deleted... See? I'm on a roll today.

pg_resetxlog did the trick, mostly; the server starts again and I seem to be
back to where I started...
What failures were you getting *before* you decided to try this?


I started out, and am now once again, getting this error when issuing a
delete query in psql:

ERROR: could not access status of transaction 655360
DETAIL: could not read from file "/usr/local/var/lib/pgsql32/pg_clog/0000"
at offset 163840: Success

I am now also getting this error when vacuuming a different table:
ERROR: catalog is missing 2 attribute(s) for relid 25297932
Hmm, whatever happened over the weekend that caused this machine to be *off*
this morning must have been a bit nasty... Dump/restore may be my only
option.

Thx again,
Glen Parker
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
"Glen Parker" <gl******@nwlink.com> writes:
I am now also getting this error when vacuuming a different table:
ERROR: catalog is missing 2 attribute(s) for relid 25297932


Yeah, this is what I warned you about: partial committal of transactions.
Given that it's only a devel server, it's probably best to initdb ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Adam Haberlach | last post by:
We had one of our databases suddenly try to reference a pg_clog file that didn't exist whenever we attempted to select from a certain table. Anyone know of a way to recover from this? Is there a...
59
by: Jeff Bowden | last post by:
For ease of configuration and other reasons, I would like for my single-user GUI app to be able to use postgresql in-process as a library accessing a database created in the users home directory. ...
0
by: Thapliyal, Deepak | last post by:
Hi Guys, Do you know any companies in the San Diego Area(or nearby) who can give consulting expertise. This is for getting us up and running with postGresql I would appreciate if I can get...
2
by: tech tech | last post by:
Hello All, I installed postgresql 7.3.4 on HPUX PA in /usr/local/pgsql and put the libraries in /usr/local/pgsql/lib/LIB_new. During the initialization( initdb), it loads libraries (language)...
17
by: Jeffrey W. Baker | last post by:
Greetings, I have a 23GB data table upon which I am building a primary key of three columns. The data is mounted in a 137GB device and pg_xlog is mounted on a separate 3.5GB device. I have...
0
by: zhicheng wang | last post by:
can any one tell me about the meaning of pg_xlog/0000000000000F1 pg_xlog/0000000000000F2 pg_xlog/0000000000000F3 pg_xlog/0000000000000F4 ... pg_xlog/0000000000000F8 is the...
2
by: Dennis Breithaupt | last post by:
Hy all, I request your support for the following problem. (with "postmaster (PostgreSQL) 7.4.1") On a development-system I lost the pg_xlog-directory due to a system crash, where the physical...
6
by: Jean-Guillaume LALANNE | last post by:
Hi, I am pretty new to the postgresql community. My question may seem a little bit strange but I'd like to know if it is possible to run 2 postgresql processes with 2 separate databases on the...
1
by: Steve Wolfe | last post by:
On Saturday, our database machine locked up hard on us due to some faulty hardware. Since then, we have been getting messages like this: ERROR: could not access status of transaction 143934068...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.