Re: Latch implementation that wakes on postmaster death on both win32 and Unix - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Date
Msg-id BANLkTinurkDnAigpBxqAqhW_jYDwce1dWw@mail.gmail.com
Whole thread Raw
In response to Re: Latch implementation that wakes on postmaster death on both win32 and Unix  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On 16 June 2011 15:27, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:

> I don't understand that comment. Why can't e.g postmaster death happen at
> the same time as a latch is set? I think the code is fine as it is, we just
> need to document that if there are several events that would wake up
> WaitLatch(), we make no promise that we return all of them in the return
> value. I believe all the callers would be fine with that.

I see your perspective...there is a window for the Postmaster to die
after the latch is set, but before it returns control to clients, and
this won't be reported. I would argue that Postmaster death didn't
actually coincide with the latch being set, because it didn't actually
cause the select() to unblock, and therefore we don't have a
responsibility to report it. Even if that view doesn't stand up to
scrutiny, and it may not, it is a fairly academic point, because, as
you say, it's unlikely that clients will ever much care. I'd be happy
to document that we make no promises, on the off chance that some
future caller might care.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: On-the-fly index tuple deletion vs. hot_standby
Next
From: Florian Pflug
Date:
Subject: Re: Re: Latch implementation that wakes on postmaster death on both win32 and Unix