Re: [HACKERS] Weaker shmem interlock w/o postmaster.pid

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, "9erthalion6(at)gmail(dot)com" <9erthalion6(at)gmail(dot)com>, "sfrost(at)snowman(dot)net" <sfrost(at)snowman(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Weaker shmem interlock w/o postmaster.pid
Date: 2019-04-01 08:19:56
Message-ID: eUPnXaH0-lP5UPgJAeBbpVF-9I3A9TzxXyQOAsTBO4jmB1sFTzFs6vSwaRAnHTmoDo0wJ-EtuHeyM0vn1LO0xm6NPc_dR0dwOzg8dJrLqhU=@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, April 1, 2019 12:42 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Fri, Mar 29, 2019 at 09:53:51AM +0000, Daniel Gustafsson wrote:

> > This seems like a case where it would be useful to log a shmdt() error or do
> > an Assert() around the success of the operation perhaps?
>
> I'll add the same elog(LOG) we have at other shmdt() sites. I can't think of
> a site where we Assert() about the results of a system call. While shmdt()
> might be a justified exception, elog(LOG) seems reasonable.

Agreed, seems reasonable.

> > - - Loop till we find a free IPC key. Trust CreateDataDirLockFile() to
> > - - ensure no more than one postmaster per data directory can enter this
> > - - loop simultaneously. (CreateDataDirLockFile() does not ensure that,
> > - - but prefer fixing it over coping here.)
> >
> > This comment make it seem like there is a fix to CreateLockFile() missing to
> > his patch, is that correct? If so, do you have an idea for that patch?
>
> That comment refers to
> https://postgr.es/m/flat/20120803145635.GE9683%40tornado.leadboat.com

Gotcha, thanks for the clarification.

cheers ./daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2019-04-01 08:25:57 Re: Enable data checksums by default
Previous Message Christoph Berg 2019-04-01 08:16:47 Re: Enable data checksums by default