Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD

From: Maxim Sobolev <sobomax(at)freebsd(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, Konstantin Belousov <kib(at)freebsd(dot)org>
Subject: Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD
Date: 2016-06-22 14:52:41
Message-ID: CAH7qZfuvxpLtyJ50+YkyOxmOTkVKFeN4cKU-SWby_0wOBpUHiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom, on the related note on merits of SYSV semaphores vs. POSIX the
handling of SYSV semaphore shortage in PG is, uggh, awful. The whole server
crashes (abort()s), bumping into that on production box is not fun at all
and it's particularly easy since the resource is severely constrained by
default. Ideally it should just deny the particular connection request. I
don't know if it's also true for POSIX primitives, but at least those are
by design more abundant. This is experienced with fairly recent PG 9.1,
we've been dealing with some of those crashes just last month. Maybe
something you guys need to consider for improvement, if you have not
already.

-Max

On Tue, Jun 21, 2016 at 1:36 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Maxim Sobolev <sobomax(at)freebsd(dot)org> writes:
> > Tom, thanks for looking at it so promptly. I am adding kib@ into the
> > discussion. Perhaps he would comment on the SYSV vs. POSIX in FreeBSD and
> > named vs. unnamed.
>
> BTW, I trawled our archives and found this thread concerning the switch
> from POSIX to SYSV on OS X:
>
>
> https://www.postgresql.org/message-id/flat/3830CBEB-F8CE-4EBC-BE16-A415E78A4CBC%40apple.com
>
> I'm not sure what you were using to decide that POSIX semaphores were
> okay, but the points in that thread about pgbench not being a very
> good test case remain relevant.
>
> > As far as I can tell, the sem_init(3) interface is present in the FreeBSD
> > 10.3, so maybe we can use those instead?
>
> If that seems like a competitive alternative for you, it'd be nice to have
> a platform where we use unnamed POSIX semaphores by default. I'm a little
> worried about whether that code has suffered bit-rot, since it's been
> sitting there basically unused for so long.
>
> regards, tom lane
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2016-06-22 14:53:49 Re: pg_dump doesn't dump new objects created in schemas from extensions
Previous Message Tom Lane 2016-06-22 14:48:50 Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD