postmaster.pid [Viruschecked] 
Author Message
 postmaster.pid [Viruschecked]

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

Quote:
>> > 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

>---------------------------(end of broadcast)---------------------------


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


Wed, 22 Jun 2005 00:12:45 GMT
 postmaster.pid [Viruschecked]


Quote:
> 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.

That is brutal and {*filter*}. If I ever release my own software, I would not
like to hear such stories even if it works..;-)

 Shridhar

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Wed, 22 Jun 2005 00:18:25 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. 335 times faster (!) [Viruschecked] [Viruschecked]

2. postmaster pid and ps

3. auto removing stale pid for postmaster NT service

4. postmaster.pid

5. auto removing stale pid for postmaster NT service

6. pgsql/src/backend/postmaster postmaster.c

7. pgsql-server/src backend/postmaster/postmaster ...

8. pgsql-server/src/backend postmaster/postmaster ...

9. pgsql-server/src backend/postmaster/postmaster ...

10. pgsql/src/backend/postmaster postmaster.c

11. pgsql/src backend/postmaster/postmaster.c bin/ ...


 
Powered by phpBB® Forum Software