Re: Restart after poweroutage

From: Jon Lapham <lapham(at)jandr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Restart after poweroutage
Date: 2006-09-24 19:31:05
Message-ID: 4516DCF9.7030202@jandr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Jon Lapham <lapham(at)jandr(dot)org> writes:
>> I recently had another electrical power outage that left my machine
>> unable to restart postgresql. I had previously reported this a while ago:
>
>> http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php
>
>> Anyway, because I have seen this problem before, I knew exactly what the
>> solution to the problem was (delete the postmaster.pid file),
>
> As was pointed out to you in the discussion subsequent to that message,
> this is not a good automatic response, and it should not be necessary at
> all with a post-8.0 postmaster.

Okay, yes, I forgot to mention that I also checked to make sure there
was no postmaster running (via "ps").

>
>> FATAL: pre-existing shared memory block (key 5432001, ID 65536) is
>> still in use
>
> This is extremely odd, because a shared memory block could not possibly
> have survived a reboot. Too bad you have destroyed the evidence,
> because I would like to know what really happened there. Is it possible
> that you have somehow managed to try to start the postmaster twice
> during your system boot cycle? If you do have two postmasters running
> in that data directory right now, you are in deep trouble :-(

Ugh, I should have sent the email before "fixing" the problem. Sorry
about that. If it happens again, I will not be so hasty. Luckily (for
you, not me) we have frequent power outages where this computer resides.
:) Maybe it will happen again.

I do not *think* I am running 2 postmasters.

[root(at)bilbo ~]# service postgresql stop
Stopping postgresql service: [ OK ]
[root(at)bilbo ~]# ps -A | grep -i post
[root(at)bilbo ~]# service postgresql start
Starting postgresql service: [ OK ]
[root(at)bilbo ~]# ps -A | grep -i post
30760 ? 00:00:00 postmaster
30762 ? 00:00:00 postmaster
30764 ? 00:00:00 postmaster
30765 ? 00:00:00 postmaster
30766 ? 00:00:00 postmaster

...is that normal to see 5 of them running?

I'm running just the standard (up to date) Fedora Core 5 version of
postgresql, init scripts and all.

>> I can reproduce this problem in v8.1.4 by these simple steps:
>
> This is not "reproducing the problem", this is merely demonstrating that
> the postmaster will fail to overwrite a root-owned postmaster.pid file.

Okay.

--
-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
Jon Lapham <lapham(at)jandr(dot)org> Rio de Janeiro, Brasil
Personal: http://www.jandr.org/
***-*--*----*-------*------------*--------------------*---------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message MaXX 2006-09-24 20:40:53 Re: Restart after poweroutage
Previous Message Mike Chiarappa 2006-09-24 16:28:35 Re: Sun Java Studio Creator and PostgreSQL