Re: Latch implementation that wakes on postmaster death on both win32 and Unix

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Date: 2011-07-07 18:15:38
Message-ID: CA+TgmobiZwEsqKOipi8v_yHyytRgdgbyUmStM6Hh0vjeQhZLpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 7, 2011 at 1:41 PM, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> I now think that we shouldn't change the return value format from the
> most recent revisions of the patch (i.e. returning a bitfield). We
> should leave it as-is, while documenting that it's possible, although
> extremely unlikely, for it to incorrectly report Postmaster death, and
> that clients therefore have a onus to check that themselves using
> PostmasterIsAlive(). We already provide fairly weak guarantees as to
> the validity of that return value ("Note that if multiple wake-up
> conditions are true, there is no guarantee that we return all of them
> in one call, but we will return at least one"). Making them a bit
> weaker still seems acceptable.

I agree - that seems like a good way to handle it.

> In addition, we'd change the implementation of PostmasterIsAlive() to
> /just/ perform the read() test as already described.
>
> I'm not concerned about the possibility of spurious extra cycles of
> auxiliary process event loops - should I be?

A tight loop would be bad, but an occasional spurious wake-up seems harmless.

--
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 Robert Haas 2011-07-07 18:43:22 Re: Avoid index rebuilds for no-rewrite ALTER TABLE ALTER TYPE
Previous Message Robert Haas 2011-07-07 18:12:28 Re: Inconsistency between postgresql.conf and docs