Re: Something fishy happening on frogmouth

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something fishy happening on frogmouth
Date: 2013-10-31 14:43:27
Message-ID: CA+Tgmobk7nL8MAQdOVPTHzn2pA7aP-kfYvjHTqUsZnbu3FsOxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 31, 2013 at 10:29 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Oct 31, 2013 at 5:50 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>>> On 2013-10-31 11:33:28 +0200, Heikki Linnakangas wrote:
>>>> Wait, that sounds horrible. If you kill -9 the server, and then rm -rf
>>>> $PGDATA, the shared memory segment is leaked until next reboot?
>
>>> Our main shared memory segment works the same way, doesn't it? And it
>>> has for a long time.
>
>> It does, and what's the alternative, anyway?
>
> Well, what we expect from the existing shmem code is that restarting the
> postmaster will clean things up, ie find and destroy the leaked shmem.
> It sounds to me like this may not work like that, in which case I agree
> with Heikki that it's not really acceptable.

I'm getting a little frustrated. It *does* work like that. I sent an
email explaining that yesterday, and Andres sent another one this
morning.

Let me say this again: the dynamic shared memory code *does* clean up
after itself. If you kill -9 the postmaster and all of its children,
you'll orphan the main shared memory segment and any dynamic shared
memory segments that exist. There is nothing we can do about that.
When you restart the postmaster, both the main shared memory segment
and any dynamic shared memory segments orphaned by the previous kill
will be cleaned up. I spent a lot of time trying to make sure that
the handling of dynamic shared memory segments is, in all cases, as
parallel to the handling of the main shared memory segment as
possible. There should be no cases where the main shared memory
segment gets cleaned up and the dynamic shared memory segments do not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-10-31 14:52:34 ERROR during end-of-xact/FATAL
Previous Message Andres Freund 2013-10-31 14:43:17 Re: Something fishy happening on frogmouth