Postgres running but no postmaster.pid

Started by simon.marshallover 14 years ago6 messagesbugs
Jump to latest
#1simon.marshall
simon.marshall@metaswitch.com

Hi guys,

When I came to stop my postgres instance (in particular, a replication
database using postgres version 9.0.3 running on port 5442) today it failed
to stop because the postmaster.pid instance wasn't present, despite the
process still running (seen by running ps -eaf | grep post and noting that
the data directory was the same). There's nothing in /var/adm/messages to
suggest any catastrophic disk problems and there's plenty of space on the
drive.

Any help would be greatly appreciated, as I'm stumped!

Thanks,
Simon

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-running-but-no-postmaster-pid-tp4662510p4662510.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: simon.marshall (#1)
Re: Postgres running but no postmaster.pid

"simon.marshall" <simon.marshall@metaswitch.com> writes:

When I came to stop my postgres instance (in particular, a replication
database using postgres version 9.0.3 running on port 5442) today it failed
to stop because the postmaster.pid instance wasn't present, despite the
process still running (seen by running ps -eaf | grep post and noting that
the data directory was the same). There's nothing in /var/adm/messages to
suggest any catastrophic disk problems and there's plenty of space on the
drive.

Any help would be greatly appreciated, as I'm stumped!

If I had to bet on the basis of that much information, I'd bet on
accidental invocation of a postmaster startup script that thinks it
should remove the postmaster.pid file before trying to launch a new
postmaster. I've seen a lot of those, and every one of them is
dangerously broken.

regards, tom lane

#3simon.marshall
simon.marshall@metaswitch.com
In reply to: Tom Lane (#2)
Re: Postgres running but no postmaster.pid

Thanks for your speedy response Tom. Seems like that is indeed what happens
elsewhere in the convoluted mess that are our backup scripts. Am
disappointed I didn't think of grepping for that myself! Too high a view of
my colleagues, now going downhill ;-)

Thanks,
Simon

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-running-but-no-postmaster-pid-tp4662510p4662703.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

#4simon.marshall
simon.marshall@metaswitch.com
In reply to: simon.marshall (#3)
Re: Postgres running but no postmaster.pid

In fact, looking at it further, we stop the database (only continuing if this
succeeds), copy our backup data over, remove the copied over postmaster.pid,
make some config. changes and then (again, only if all this succeeds), start
the database again, which should surely recreate postmaster.pid?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-running-but-no-postmaster-pid-tp4662510p4662719.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

#5Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: simon.marshall (#4)
Re: Postgres running but no postmaster.pid

Excerpts from simon.marshall's message of mié ago 03 11:56:55 -0400 2011:

In fact, looking at it further, we stop the database (only continuing if this
succeeds), copy our backup data over, remove the copied over postmaster.pid,
make some config. changes and then (again, only if all this succeeds), start
the database again, which should surely recreate postmaster.pid?

Why would you remove the copied postmaster.pid? Surely if the database
is stopped, it shouldn't be there in the first place.

... oh, are you copying a database that's running elsewhere?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#6simon.marshall
simon.marshall@metaswitch.com
In reply to: Alvaro Herrera (#5)
Re: Postgres running but no postmaster.pid

Exactly so :-) (Seems simpler and I wouldn't have thought it would be a
problem to just remove the one, very small, file after the copy)

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-running-but-no-postmaster-pid-tp4662510p4662780.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.