Re: file-locking and postmaster.pid - Mailing list pgsql-hackers

From Tom Lane
Subject Re: file-locking and postmaster.pid
Date
Msg-id 14889.1148399677@sss.pgh.pa.us
Whole thread Raw
In response to file-locking and postmaster.pid  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: file-locking and postmaster.pid
List pgsql-hackers
Andreas Joseph Krogh <andreak@officenet.no> writes:
> I've experienced several times that PG has died somehow and the postmaster.pid 
> file still exists 'cause PG hasn't had the ability to delete it upon proper 
> shutdown. Upon start-up, after such an incidence, PG tells me another PG is 
> running and that I either have to shut down the other instance, or delete the 
> postmaster.pid file if there really isn't an instance running. This seems 
> totally unnecessary to me.

The postmaster does check to see whether the PID mentioned in the file
is still alive, so it's not that easy for the above to happen.  If you
can provide details of a scenario where a failure is likely, we'd like
to know about it.  Also, what PG version are you talking about?

> Why doesn't PG use file-locking to tell if another 
> PG is running or not?

Portability.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gavin Hamill
Date:
Subject: Re: Further reduction of bufmgr lock contention
Next
From: Tom Lane
Date:
Subject: Re: Further reduction of bufmgr lock contention