Re: PSA: Systemd will kill PostgreSQL

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: PSA: Systemd will kill PostgreSQL
Date: 2016-10-21 12:29:56
Message-ID: 47f5b8f8-ab50-76ea-05ba-b2188e031066@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/16/16 1:05 PM, Tom Lane wrote:
> Oh, interesting. It had occurred to me that we might be able to dodge
> this issue if we started to recommend using unnamed POSIX semaphores
> instead of SysV. (Obviously we'd want to check performance, but it's
> at least a plausible alternative.) I had not wanted to go there if
> it meant that we could have silent loss of SysV shmem with no other
> symptoms, because as I said upthread, I'm concerned about that breaking
> the multiple-postmaster interlock. However, if the cleanup kills only
> semaphores and not attached-to shmem, then that objection goes away and
> this becomes something we should seriously consider.

I was digging around this issue the other day again. We have switched
to unnamed POSIX semaphores by default now, which will help. But for
dynamic shared memory (DSM) we use POSIX shared memory by default, which
is cleaned up without regarding to attachment. So there is still a
potential for failures here, possibly more rare or obscure, given the
usage of DSM.

(If someone is keeping score, it appears the "safest" combination is
SysV shared memory + POSIX semaphores.)

I have started a wiki page to collect this information:
https://wiki.postgresql.org/wiki/Systemd

To be continued, I suppose ...

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2016-10-21 12:41:30 Re: [RFC] Transaction management overhaul is necessary?
Previous Message Michael Paquier 2016-10-21 12:02:01 Re: pg_basebackup stream xlog to tar