|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* procsignal.h
|
|
|
|
* Routines for interprocess signalling
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
|
|
|
* src/include/storage/procsignal.h
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PROCSIGNAL_H
|
|
|
|
#define PROCSIGNAL_H
|
|
|
|
|
|
|
|
#include "storage/backendid.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reasons for signalling a Postgres child process (a backend or an auxiliary
|
|
|
|
* process, like checkpointer). We can cope with concurrent signals for different
|
|
|
|
* reasons. However, if the same reason is signaled multiple times in quick
|
|
|
|
* succession, the process is likely to observe only one notification of it.
|
|
|
|
* This is okay for the present uses.
|
|
|
|
*
|
|
|
|
* Also, because of race conditions, it's important that all the signals be
|
|
|
|
* defined so that no harm is done if a process mistakenly receives one.
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
|
|
|
|
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
|
Create an infrastructure for parallel computation in PostgreSQL.
This does four basic things. First, it provides convenience routines
to coordinate the startup and shutdown of parallel workers. Second,
it synchronizes various pieces of state (e.g. GUCs, combo CID
mappings, transaction snapshot) from the parallel group leader to the
worker processes. Third, it prohibits various operations that would
result in unsafe changes to that state while parallelism is active.
Finally, it propagates events that would result in an ErrorResponse,
NoticeResponse, or NotifyResponse message being sent to the client
from the parallel workers back to the master, from which they can then
be sent on to the client.
Robert Haas, Amit Kapila, Noah Misch, Rushabh Lathia, Jeevan Chalke.
Suggestions and review from Andres Freund, Heikki Linnakangas, Noah
Misch, Simon Riggs, Euler Taveira, and Jim Nasby.
10 years ago
|
|
|
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
8 years ago
|
|
|
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for shutdown */
|
|
|
|
|
|
|
|
/* Recovery conflict reasons */
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_DATABASE,
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_TABLESPACE,
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_LOCK,
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT,
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
|
|
|
|
PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
|
|
|
|
|
|
|
|
NUM_PROCSIGNALS /* Must be last! */
|
|
|
|
} ProcSignalReason;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes for functions in procsignal.c
|
|
|
|
*/
|
|
|
|
extern Size ProcSignalShmemSize(void);
|
|
|
|
extern void ProcSignalShmemInit(void);
|
|
|
|
|
|
|
|
extern void ProcSignalInit(int pss_idx);
|
|
|
|
extern int SendProcSignal(pid_t pid, ProcSignalReason reason,
|
|
|
|
BackendId backendId);
|
|
|
|
|
|
|
|
extern void procsignal_sigusr1_handler(SIGNAL_ARGS);
|
|
|
|
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
8 years ago
|
|
|
#endif /* PROCSIGNAL_H */
|