diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-13 01:17:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-13 01:17:06 +0000 |
commit | 4d14fe0048cf80052a3ba2053560f8aab1bb1b22 (patch) | |
tree | 599c7fde5eb9b889e507b2da77fd8c0300a5dfc7 /doc/src | |
parent | b246510ccc8db96bf7a536a305cccf65aab21ce8 (diff) | |
download | postgresql-4d14fe0048cf80052a3ba2053560f8aab1bb1b22.tar.gz postgresql-4d14fe0048cf80052a3ba2053560f8aab1bb1b22.zip |
XLOG (and related) changes:
* Store two past checkpoint locations, not just one, in pg_control.
On startup, we fall back to the older checkpoint if the newer one
is unreadable. Also, a physical copy of the newest checkpoint record
is kept in pg_control for possible use in disaster recovery (ie,
complete loss of pg_xlog). Also add a version number for pg_control
itself. Remove archdir from pg_control; it ought to be a GUC
parameter, not a special case (not that it's implemented yet anyway).
* Suppress successive checkpoint records when nothing has been entered
in the WAL log since the last one. This is not so much to avoid I/O
as to make it actually useful to keep track of the last two
checkpoints. If the things are right next to each other then there's
not a lot of redundancy gained...
* Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs
on alternate bytes. Polynomial borrowed from ECMA DLT1 standard.
* Fix XLOG record length handling so that it will work at BLCKSZ = 32k.
* Change XID allocation to work more like OID allocation. (This is of
dubious necessity, but I think it's a good idea anyway.)
* Fix a number of minor bugs, such as off-by-one logic for XLOG file
wraparound at the 4 gig mark.
* Add documentation and clean up some coding infelicities; move file
format declarations out to include files where planned contrib
utilities can get at them.
* Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or
every CHECKPOINT_TIMEOUT seconds, whichever comes first. It is also
possible to force a checkpoint by sending SIGUSR1 to the postmaster
(undocumented feature...)
* Defend against kill -9 postmaster by storing shmem block's key and ID
in postmaster.pid lockfile, and checking at startup to ensure that no
processes are still connected to old shmem block (if it still exists).
* Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency
stop, for symmetry with postmaster and xlog utilities. Clean up signal
handling in bootstrap.c so that xlog utilities launched by postmaster
will react to signals better.
* Standalone bootstrap now grabs lockfile in target directory, as added
insurance against running it in parallel with live postmaster.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/checkpoint.sgml | 13 | ||||
-rw-r--r-- | doc/src/sgml/runtime.sgml | 32 | ||||
-rw-r--r-- | doc/src/sgml/wal.sgml | 15 |
3 files changed, 41 insertions, 19 deletions
diff --git a/doc/src/sgml/ref/checkpoint.sgml b/doc/src/sgml/ref/checkpoint.sgml index 021035888b4..5336c3f5529 100644 --- a/doc/src/sgml/ref/checkpoint.sgml +++ b/doc/src/sgml/ref/checkpoint.sgml @@ -1,4 +1,4 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.3 2001/01/27 10:19:52 petere Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.4 2001/03/13 01:17:05 tgl Exp $ --> <refentry id="sql-checkpoint"> <docinfo> @@ -26,11 +26,12 @@ CHECKPOINT <para> Write-Ahead Logging (WAL) puts a checkpoint in the transaction log - every 300 seconds by default. (This may be changed by the run-time - configuration option <parameter>CHECKPOINT_TIMEOUT</parameter>.) - The <command>CHECKPOINT</command> command forces a checkpoint at - the point at which the command is issued. The next automatic - checkpoint will still happen after the original cycle expires. + every so often. (To adjust the automatic checkpoint interval, see + the run-time + configuration options <parameter>CHECKPOINT_SEGMENTS</parameter> + and <parameter>CHECKPOINT_TIMEOUT</parameter>.) + The <command>CHECKPOINT</command> command forces an immediate checkpoint + when the command is issued, without waiting for a scheduled checkpoint. </para> <para> diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index b23dcbf5a60..f321cea669b 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.55 2001/02/18 05:30:12 tgl Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.56 2001/03/13 01:17:05 tgl Exp $ --> <Chapter Id="runtime"> @@ -976,6 +976,11 @@ env PGOPTIONS='-c geqo=off' psql fsyncs because of performance problems, you may wish to reconsider your choice. </para> + + <para> + This option can only be set at server start or in the + <filename>postgresql.conf</filename> file. + </para> </listitem> </varlistentry> @@ -1193,10 +1198,24 @@ env PGOPTIONS='-c geqo=off' psql <variablelist> <varlistentry> + <term>CHECKPOINT_SEGMENTS (<type>integer</type>)</term> + <listitem> + <para> + Maximum distance between automatic WAL checkpoints, in logfile + segments (each segment is normally 16 megabytes). + This option can only be set at server start or in the + <filename>postgresql.conf</filename> file. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term>CHECKPOINT_TIMEOUT (<type>integer</type>)</term> <listitem> <para> - Frequency of automatic WAL checkpoints, in seconds. + Maximum time between automatic WAL checkpoints, in seconds. + This option can only be set at server start or in the + <filename>postgresql.conf</filename> file. </para> </listitem> </varlistentry> @@ -1205,8 +1224,8 @@ env PGOPTIONS='-c geqo=off' psql <term>WAL_BUFFERS (<type>integer</type>)</term> <listitem> <para> - Number of buffers for WAL. This option can only be set at - server start. + Number of disk-page buffers for WAL log. This option can only be set + at server start. </para> </listitem> </varlistentry> @@ -1226,7 +1245,8 @@ env PGOPTIONS='-c geqo=off' psql <listitem> <para> Number of log files that are created in advance at checkpoint - time. This option can only be set at server start. + time. This option can only be set at server start or in the + <filename>postgresql.conf</filename> file. </para> </listitem> </varlistentry> @@ -1909,7 +1929,7 @@ default:\ <listitem> <para> This is the <firstterm>Immediate Shutdown</firstterm> which - will cause the postmaster to send a SIGUSR1 to all backends and + will cause the postmaster to send a SIGQUIT to all backends and exit immediately (without properly shutting down the database system). When WAL is implemented, this will lead to recovery on start-up. Right now it's not recommendable to use this option. diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index e706ee271c6..c92ccd9d230 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -1,4 +1,4 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.3 2001/02/26 00:50:07 tgl Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.4 2001/03/13 01:17:05 tgl Exp $ --> <chapter id="wal"> <title>Write-Ahead Logging (<acronym>WAL</acronym>)</title> @@ -257,7 +257,7 @@ The <acronym>WAL</acronym> log is held on the disk as a set of 16 MB files called <firstterm>segments</firstterm>. By default a new segment is created only if more than 75% of the current segment is - used. One can instruct the server to create up to 64 log segments + used. One can instruct the server to pre-create up to 64 log segments at checkpoint time by modifying the <varname>WAL_FILES</varname> configuration parameter. </para> @@ -272,11 +272,12 @@ </para> <para> - By default, the postmaster spawns a special backend process to - create the next checkpoint 300 seconds after the previous - checkpoint's creation. One can change this interval by modifying - the <varname>CHECKPOINT_TIMEOUT</varname> parameter. It is also - possible to force a checkpoint by using the SQL command + The postmaster spawns a special backend process every so often + to create the next checkpoint. A checkpoint is created every + <varname>CHECKPOINT_SEGMENTS</varname> log segments, or every + <varname>CHECKPOINT_TIMEOUT</varname> seconds, whichever comes first. + The default settings are 3 segments and 300 seconds respectively. + It is also possible to force a checkpoint by using the SQL command <command>CHECKPOINT</command>. </para> |