pgsql: Change the autovacuum launcher to use WaitLatch instead of a pol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change the autovacuum launcher to use WaitLatch instead of a pol
Date: 2011-08-10 16:27:12
Message-ID: E1QrBce-0003Cc-Bq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-08-10 20:46:02 pgsql: Add a bit of debug logging to backend_read_statsfile().
Previous Message Heikki Linnakangas 2011-08-10 06:29:24 pgsql: Oops, we're working on version 9.2 already, not 9.1. Update the