pgsql: Improve tests for postmaster death in auxiliary processes.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve tests for postmaster death in auxiliary processes.
Date: 2012-05-10 04:55:12
Message-ID: E1SSLPE-0001Ui-Ca@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve tests for postmaster death in auxiliary processes.

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.

There are a few other places where the same idea might be applied, but only
after substantial code rearrangement, so I didn't bother.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fd71421b0187de0e2bf76ff66b4a9433bd96c4a0

Modified Files
--------------
src/backend/postmaster/bgwriter.c | 6 ++++--
src/backend/postmaster/checkpointer.c | 23 +++++++++++++----------
src/backend/postmaster/pgstat.c | 9 +++++++--
src/backend/postmaster/walwriter.c | 23 +++++++++++++----------
4 files changed, 37 insertions(+), 24 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Joe Conway 2012-05-10 06:03:14 pgsql: PL/pgSQL RETURN NEXT was leaking converted tuples, causing
Previous Message Bruce Momjian 2012-05-10 04:32:20 pgsql: Update 9.2 SSL release note links.