Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fb5f1b2

Browse files
committed
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.
1 parent 5f06772 commit fb5f1b2

File tree

8 files changed

+254
-121
lines changed

8 files changed

+254
-121
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.80 2001/10/28 06:25:42 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.81 2001/11/04 19:55:31 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -35,6 +35,7 @@
3535
#include "catalog/pg_control.h"
3636
#include "storage/bufpage.h"
3737
#include "storage/lwlock.h"
38+
#include "storage/pmsignal.h"
3839
#include "storage/proc.h"
3940
#include "storage/sinval.h"
4041
#include "storage/spin.h"
@@ -1048,7 +1049,7 @@ XLogWrite(XLogwrtRqst WriteRqst)
10481049
{
10491050
if (XLOG_DEBUG)
10501051
elog(DEBUG, "XLogWrite: time for a checkpoint, signaling postmaster");
1051-
kill(getppid(), SIGUSR1);
1052+
SendPostmasterSignal(PMSIGNAL_DO_CHECKPOINT);
10521053
}
10531054
}
10541055
LWLockRelease(ControlFileLock);

src/backend/commands/user.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.88 2001/11/02 18:39:57 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.89 2001/11/04 19:55:31 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -15,7 +15,6 @@
1515
#include <sys/types.h>
1616
#include <sys/stat.h>
1717
#include <fcntl.h>
18-
#include <signal.h>
1918
#include <unistd.h>
2019

2120
#include "access/heapam.h"
@@ -27,6 +26,7 @@
2726
#include "commands/user.h"
2827
#include "libpq/crypt.h"
2928
#include "miscadmin.h"
29+
#include "storage/pmsignal.h"
3030
#include "utils/array.h"
3131
#include "utils/builtins.h"
3232
#include "utils/fmgroids.h"
@@ -180,8 +180,7 @@ write_password_file(Relation rel)
180180
/*
181181
* Signal the postmaster to reload its password-file cache.
182182
*/
183-
if (IsUnderPostmaster)
184-
kill(getppid(), SIGHUP);
183+
SendPostmasterSignal(PMSIGNAL_PASSWORD_CHANGE);
185184
}
186185

187186

0 commit comments

Comments
 (0)