pgsql: Change the autovacuum launcher to use WaitLatch instead of a pol - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Change the autovacuum launcher to use WaitLatch instead of a pol
Date
Msg-id E1QrBce-0003Cc-Bq@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Change the autovacuum launcher to use WaitLatch instead of a poll loop.

In pursuit of this (and with the expectation that WaitLatch will be needed
in more places), convert the latch field that was already added to PGPROC
for sync rep into a generic latch that is activated for all PGPROC-owning
processes, and change many of the standard backend signal handlers to set
that latch when a signal happens.  This will allow WaitLatch callers to be
wakened properly by these signals.

In passing, fix a whole bunch of signal handlers that had been hacked to do
things that might change errno, without adding the necessary save/restore
logic for errno.  Also make some minor fixes in unix_latch.c, and clean
up bizarre and unsafe scheme for disowning the process's latch.  Much of
this has to be back-patched into 9.1.

Peter Geoghegan, with additional work by Tom

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4dab3d5ae1498eb4246e54225a48cf667ab693da

Modified Files
--------------
src/backend/access/transam/xlog.c     |   16 +++++++
src/backend/port/unix_latch.c         |   47 ++++++++++++++++++---
src/backend/postmaster/autovacuum.c   |   71 +++++++++++++++++----------------
src/backend/postmaster/pgarch.c       |   20 +++++++--
src/backend/replication/syncrep.c     |   20 +++------
src/backend/replication/walreceiver.c |    4 ++
src/backend/replication/walsender.c   |   16 +++++++
src/backend/storage/lmgr/proc.c       |   41 +++++++++++++++----
src/backend/tcop/postgres.c           |   21 +++++++---
src/include/replication/syncrep.h     |    4 +-
src/include/storage/proc.h            |    3 +-
11 files changed, 186 insertions(+), 77 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Oops, we're working on version 9.2 already, not 9.1. Update the
Next
From: Tom Lane
Date:
Subject: pgsql: Add a bit of debug logging to backend_read_statsfile().