diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-04 19:55:31 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-04 19:55:31 +0000 |
commit | fb5f1b2c13c0c1265f2d1244312fee256629a187 (patch) | |
tree | 840259e62246dd3cbfd8fc16af1174540b071262 /src/backend/storage/ipc/sinvaladt.c | |
parent | 5f067722bfd8b28946f5654f99f3971d33df12a3 (diff) | |
download | postgresql-fb5f1b2c13c0c1265f2d1244312fee256629a187.tar.gz postgresql-fb5f1b2c13c0c1265f2d1244312fee256629a187.zip |
Merge three existing ways of signaling postmaster from child processes,
so that only one signal number is used not three. Flags in shared
memory tell the reason(s) for the current signal. This method is
extensible to handle more signal reasons without chewing up even more
signal numbers, but the immediate reason is to keep pg_pwd reloads
separate from SIGHUP processing in the postmaster.
Also clean up some problems in the postmaster with delayed response to
checkpoint status changes --- basically, it wouldn't schedule a checkpoint
if it wasn't getting connection requests on a regular basis.
Diffstat (limited to 'src/backend/storage/ipc/sinvaladt.c')
-rw-r--r-- | src/backend/storage/ipc/sinvaladt.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c index d05a651097f..35931f00a14 100644 --- a/src/backend/storage/ipc/sinvaladt.c +++ b/src/backend/storage/ipc/sinvaladt.c @@ -8,17 +8,15 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.41 2001/09/29 04:02:24 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.42 2001/11/04 19:55:31 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" -#include <signal.h> -#include <unistd.h> - #include "miscadmin.h" #include "storage/backendid.h" +#include "storage/pmsignal.h" #include "storage/proc.h" #include "storage/sinvaladt.h" @@ -205,11 +203,11 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidationMessage *data) /* * Try to prevent table overflow. When the table is 70% full send a - * SIGUSR2 (ordinarily a NOTIFY signal) to the postmaster, which will - * send it back to all the backends. This will force idle backends to - * execute a transaction to look through pg_listener for NOTIFY - * messages, and as a byproduct of the transaction start they will - * read SI entries. + * WAKEN_CHILDREN request to the postmaster. The postmaster will send + * a SIGUSR2 signal (ordinarily a NOTIFY signal) to all the backends. + * This will force idle backends to execute a transaction to look through + * pg_listener for NOTIFY messages, and as a byproduct of the transaction + * start they will read SI entries. * * This should never happen if all the backends are actively executing * queries, but if a backend is sitting idle then it won't be starting @@ -222,7 +220,7 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidationMessage *data) { if (DebugLvl >= 1) elog(DEBUG, "SIInsertDataEntry: table is 70%% full, signaling postmaster"); - kill(getppid(), SIGUSR2); + SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN); } /* |