Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Date
Msg-id 48F61F2C.7030306@dunslane.net
Whole thread Raw
In response to Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers

Alvaro Herrera wrote:
> Andrew Dunstan wrote:
>
>   
>> I have verified that it does indeed work. Underneath the hood it uses  
>> the native call LockFileEx() see win32io.c in Perl source. I suggest we  
>> should switch from this flaky use of Global namespace to having the  
>> postmaster acquire an explicit lock on a file in the datadir.
>>     
>
> Does it work for all backends to grab a lock, so that if they continue
> to live after postmaster has died, then the new postmaster cannot start?
>
> I guess the postmaster could try-acquire an exclusive lock and all other
> processes would acquire a shared lock.
>   

I think we'd need to have the postmaster grab an exclusive lock to start 
with, to make sure nothing else has the lock, then swap to a shared lock 
before any backends are created. That might leave a tiny window on 
postmaster start, but I think it would be good enough.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Next
From: Andrew Dunstan
Date:
Subject: Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED