diff options
| author | Simon Riggs | 2011-11-01 17:14:47 +0000 |
|---|---|---|
| committer | Simon Riggs | 2011-11-01 17:14:47 +0000 |
| commit | 806a2aee3791244bf0f916729bfdb5489936e068 (patch) | |
| tree | 1eb84ca670e07bdf49dfddbc1e1472ce934ba03d /src/include | |
| parent | 589adb86ee826190d2b6e744d117eee1fa6bbf75 (diff) | |
Split work of bgwriter between 2 processes: bgwriter and checkpointer.
bgwriter is now a much less important process, responsible for page
cleaning duties only. checkpointer is now responsible for checkpoints
and so has a key role in shutdown. Later patches will correct doc
references to the now old idea that bgwriter performs checkpoints.
Has beneficial effect on performance at high write rates, but mainly
refactoring to more easily allow changes for power reduction by
simplifying previously tortuous code around required to allow page
cleaning and checkpointing to time slice in the same process.
Patch by me, Review by Dickson Guedes
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/xlog_internal.h | 2 | ||||
| -rw-r--r-- | src/include/bootstrap/bootstrap.h | 1 | ||||
| -rw-r--r-- | src/include/postmaster/bgwriter.h | 1 | ||||
| -rw-r--r-- | src/include/storage/proc.h | 8 | ||||
| -rw-r--r-- | src/include/storage/procsignal.h | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 4eaa243948b..cb438797734 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -256,7 +256,7 @@ typedef struct RmgrData extern const RmgrData RmgrTable[]; /* - * Exported to support xlog switching from bgwriter + * Exported to support xlog switching from checkpointer */ extern pg_time_t GetLastSegSwitchTime(void); extern XLogRecPtr RequestXLogSwitch(void); diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index cee9bd1fa47..6153b7a0a23 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -22,6 +22,7 @@ typedef enum BootstrapProcess, StartupProcess, BgWriterProcess, + CheckpointerProcess, WalWriterProcess, WalReceiverProcess, diff --git a/src/include/postmaster/bgwriter.h b/src/include/postmaster/bgwriter.h index eaf2206f5e2..c05901e929d 100644 --- a/src/include/postmaster/bgwriter.h +++ b/src/include/postmaster/bgwriter.h @@ -23,6 +23,7 @@ extern int CheckPointWarning; extern double CheckPointCompletionTarget; extern void BackgroundWriterMain(void); +extern void CheckpointerMain(void); extern void RequestCheckpoint(int flags); extern void CheckpointWriteDelay(int flags, double progress); diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 46ec625e087..6e798b1b2d9 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -190,11 +190,11 @@ extern PROC_HDR *ProcGlobal; * We set aside some extra PGPROC structures for auxiliary processes, * ie things that aren't full-fledged backends but need shmem access. * - * Background writer and WAL writer run during normal operation. Startup - * process and WAL receiver also consume 2 slots, but WAL writer is - * launched only after startup has exited, so we only need 3 slots. + * Background writer, checkpointer and WAL writer run during normal operation. + * Startup process and WAL receiver also consume 2 slots, but WAL writer is + * launched only after startup has exited, so we only need 4 slots. */ -#define NUM_AUXILIARY_PROCS 3 +#define NUM_AUXILIARY_PROCS 4 /* configurable options */ diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h index 2a27e0b7edc..d5afe017781 100644 --- a/src/include/storage/procsignal.h +++ b/src/include/storage/procsignal.h @@ -19,7 +19,7 @@ /* * Reasons for signalling a Postgres child process (a backend or an auxiliary - * process, like bgwriter). We can cope with concurrent signals for different + * 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. |
