Re: postmaster.pid [Viruschecked]

From: "Patric Bechtel" <bechtel(at)ipcon(dot)de>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postmaster.pid [Viruschecked]
Date: 2003-01-03 16:11:31
Message-ID: 20030103161150.43E8A47655D@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 3 Jan 2003 19:38:49 +0200, am(at)fx(dot)ro wrote:

Hello,

just my 2 cents:

I discovered many cases in which the .pid file was still there, but
postgres wasn't running anymore. Normally it's save to delete the
pid if the process noted in there is not postgres anymore.
The main cause for the pid file is that NEVER EVER two different
copies of the postmaster start upon the same database cluster.
Anyway, if the aforementioned postmaster isn't running anymore,
the first step is to start postmaster. It will recover from the
former fault will be ready within seconds.
I work for the last 24 months with Postgres, I killed it (kill -9),
I made very crude things with it (taking the harddisks away and such),
but I never had problems it did not recover from. One of our
customers even installed it on notebooks (30pcs), and the users
tend to switch them off, or the batteries are empty, or the
notebooks just go down in doze and never wake up again (Bios prob).
Postgres did a good job on that being a very hard "taker" on that
side, so I think you won't get probs, either.
I once tried SAP-DB, which I torn in pieces within minutes this
way... :-)

<blink><red>no panic</red></blink>

Patric

>> > i think that somewhere in the docs the administators
>> > should be advised to delete postmaster.pid automatically at boot
>> > time ( for example at the same time when the files in /tmp are
>> > deleted ).
>> > This way, in case of an unexpected shutdown, postgresql would be
>> > able to restart without any manual intervention.
>
>> Well, this is a *BAD IDEA*. Suppose, for example, your data is corrupt in
>> some special way, an due to your removal of the pid file, postmaster tries to
>> recover the database automatically and probably destroys all or data part of
>> the data. You would like to have been able to do a filseystem level backup
>> first...
>
>Ooopss... it seems like i am too optimistic about such situations.
>
>Just wondering: if the database is so heavily damaged that the
>postmaster would not be able to recover, are there any chances to
>restore anything from a filesystem backup, manually ?
>
>.........
>
>Background:
> - our team is working on a project for a small company.
> - there will be one server and 3-4 clients
> - It is the first time we use PostgreSQL.
> - Little space.
> - Many people around.
> - No UPS (yet).
> - unpredictable,untrained,desperate,'crazy' users
>
>Possible problems:
> - the users will need time to learn how to use the program
> ( until then they could do many mistakes, such as turning off the
> server before leaving the office - without issueing the proper
> shutdown command, but simply pushing the power switch. )
> - someone might stumble over the cable and unplug the server by mistake.
>
>Questions:
> How resistent is PostgreSQL to such shocks?
>
> Are there alternative solutions to handling unexpected shutdowns
> automatically? (except deleting postmaster.pid at boot time)
>
>
>
>Best wishes,
>
>Adrian Maier
>(am(at)fx(dot)ro)
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2003-01-03 16:18:24 Re: postmaster.pid [Viruschecked]
Previous Message S Dawalt 2003-01-03 14:57:09 Re: Error message documentation ?