Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied” - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”
Date
Msg-id CAA4eK1La8-KdvpOan3nAYDhijyk_=wjSRT3fTq=Qzk1fyEf8WA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, May 16, 2016 at 9:45 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
>
> On Sun, May 15, 2016 at 3:34 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > Sounds sensible, but if we want to that route, shall we have some mechanism
> > such that if retrying it for 10 times (10 is somewhat arbitrary, but we
> > retry 10 times in PGSharedMemoryCreate, so may be there is some consistency)
> > doesn't give us unique name and we are getting EACCES error, then just throw
> > the error instead of more retries.  This is to ensure that if the API is
> > returning EACCES due to reason other than duplicate handle, then we won't
> > retry indefinitely.
>
> The logic in win32_shmem.c relies on the fact that a segment will be
> recycled, and the retry is here because it may take time at OS level.
> On top of that it relies on the segment names being unique across
> systems. So it seems to me that it is not worth the complication to
> duplicate that logic in the dsm implementation.

If we don't do retry for fixed number of times, then how will we handle the case if EACCES is due to the reason other than duplicate handle?

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: 10.0
Next
From: Piotr Stefaniak
Date:
Subject: A couple of cosmetic changes around shared memory code