summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2001-11-04 19:55:31 +0000
committerTom Lane2001-11-04 19:55:31 +0000
commitfb5f1b2c13c0c1265f2d1244312fee256629a187 (patch)
tree840259e62246dd3cbfd8fc16af1174540b071262 /src/include
parent5f067722bfd8b28946f5654f99f3971d33df12a3 (diff)
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/include')
-rw-r--r--src/include/storage/pmsignal.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/include/storage/pmsignal.h b/src/include/storage/pmsignal.h
new file mode 100644
index 00000000000..f86c06656ef
--- /dev/null
+++ b/src/include/storage/pmsignal.h
@@ -0,0 +1,39 @@
+/*-------------------------------------------------------------------------
+ *
+ * pmsignal.h
+ * routines for signaling the postmaster from its child processes
+ *
+ *
+ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: pmsignal.h,v 1.1 2001/11/04 19:55:31 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PMSIGNAL_H
+#define PMSIGNAL_H
+
+/*
+ * Reasons for signaling the postmaster. We can cope with simultaneous
+ * signals for different reasons. If the same reason is signaled multiple
+ * times in quick succession, however, the postmaster is likely to observe
+ * only one notification of it. This is okay for the present uses.
+ */
+typedef enum
+{
+ PMSIGNAL_DO_CHECKPOINT, /* request to start a checkpoint */
+ PMSIGNAL_PASSWORD_CHANGE, /* pg_pwd file has changed */
+ PMSIGNAL_WAKEN_CHILDREN, /* send a NOTIFY signal to all backends */
+
+ NUM_PMSIGNALS /* Must be last value of enum! */
+} PMSignalReason;
+
+/*
+ * prototypes for functions in pmsignal.c
+ */
+extern void PMSignalInit(void);
+extern void SendPostmasterSignal(PMSignalReason reason);
+extern bool CheckPostmasterSignal(PMSignalReason reason);
+
+#endif /* PMSIGNAL_H */