Re: postmaster.pid - Mailing list pgsql-general

From Tom Lane
Subject Re: postmaster.pid
Date
Msg-id 29250.1043126140@sss.pgh.pa.us
Whole thread Raw
In response to Re: postmaster.pid  (Kevin Brown <kevin@sysexperts.com>)
Responses Re: postmaster.pid
Re: postmaster.pid
List pgsql-general
Kevin Brown <kevin@sysexperts.com> writes:
> Tom Lane wrote:
>> Yeah, if you search the archives you will find previous discussions of
>> how the check for a pre-existing postmaster could be made more resistant
>> to false matches.  It seems to be a hard problem to solve in a way
>> that's both portable and 100% safe (while false positives are annoying,
>> false negatives are completely not acceptable).  AFAIR all the
>> alternative methods that we've heard about have their own downsides.

> I assume one of those alternatives was for the postmaster to open and
> lock a predefined file in $PGDATA (say, postmaster.lock) using fcntl
> or flock style locking?

Yes, that was discussed.  I think the primary objection was that it's
very non-robust if the $PGDATA directory is mounted via NFS.  (Quite
a few of us think that if you run a database over NFS, you deserve to
lose ;-( ... but there seem to be more than a few people out there doing
it anyway.)

Also, the fact that you even had to mention two different ways of doing
it is prima facie evidence that there are portability issues...

            regards, tom lane

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: repost of how to do select in a constraint
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: When to vacuum