Re: PSA: Systemd will kill PostgreSQL - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: PSA: Systemd will kill PostgreSQL
Date
Msg-id 47f5b8f8-ab50-76ea-05ba-b2188e031066@2ndquadrant.com
Whole thread Raw
In response to Re: PSA: Systemd will kill PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PSA: Systemd will kill PostgreSQL  (Robert Haas <robertmhaas@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_basebackup stream xlog to tar
Next
From: Craig Ringer
Date:
Subject: Re: [RFC] Transaction management overhaul is necessary?