Re: pgsql: Improve tests for postmaster death in auxiliary processes.

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Improve tests for postmaster death in auxiliary processes.
Date: 2012-05-10 15:08:17
Message-ID: CAEYLb_VEwJQ3PuLy_A2wzorMbsY4w1dq1vyGckHUQgCHyYURYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 10 May 2012 05:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> In checkpointer and walwriter, avoid calling PostmasterIsAlive unless
> WaitLatch has reported WL_POSTMASTER_DEATH.  This saves a kernel call per
> iteration of the process's outer loop, which is not all that much, but a
> cycle shaved is a cycle earned.  I had already removed the unconditional
> PostmasterIsAlive calls in bgwriter and pgstat in previous patches, but
> forgot that WL_POSTMASTER_DEATH is supposed to be treated as untrustworthy
> (per comment in unix_latch.c); so adjust those two cases to match.

I'm not sure why we're pushing the responsibility to call
PostmasterIsAlive() onto latch clients. Why not just do it within
WaitLatchOrSocket just as the WL_POSTMASTER_DEATH bit is set? It's not
as if someone could conceivably care that the Postmaster might have
died, but not enough to want to be sure.

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-05-10 15:19:41 Re: pgsql: Improve tests for postmaster death in auxiliary processes.
Previous Message Bruce Momjian 2012-05-10 14:29:59 pgsql: Improve two 9.2 release note items.