|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/wal.sgml,v 1.68 2010/07/08 16:44:12 momjian Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/wal.sgml,v 1.69 2010/07/16 11:20:23 heikki Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="wal">
|
4 | 4 | <title>Reliability and the Write-Ahead Log</title>
|
|
449 | 449 | <para>
|
450 | 450 | There will always be at least one WAL segment file, and will normally
|
451 | 451 | not be more than (2 + <varname>checkpoint_completion_target</varname>) * <varname>checkpoint_segments</varname> + 1
|
| 452 | + or <varname>checkpoint_segments</> + <xref linkend="guc-wal-keep-segments"> + 1 |
452 | 453 | files. Each segment file is normally 16 MB (though this size can be
|
453 | 454 | altered when building the server). You can use this to estimate space
|
454 | 455 | requirements for <acronym>WAL</acronym>.
|
|
460 | 461 | of recycled until the system gets back under this limit.
|
461 | 462 | </para>
|
462 | 463 |
|
| 464 | + <para> |
| 465 | + In archive recovery or standby mode, the server periodically performs |
| 466 | + <firstterm>restartpoints</><indexterm><primary>restartpoint</></> |
| 467 | + which are similar to checkpoints in normal operation: the server forces |
| 468 | + all its state to disk, updates the <filename>pg_control</> file to |
| 469 | + indicate that the already-processed WAL data need not be scanned again, |
| 470 | + and then recycles any old log segment files in <filename>pg_xlog</> |
| 471 | + directory. A restartpoint is triggered if at least one checkpoint record |
| 472 | + has been replayed and <varname>checkpoint_timeout</> seconds have passed |
| 473 | + since last restartpoint. In standby mode, a restartpoint is also triggered |
| 474 | + if <varname>checkoint_segments</> log segments have been replayed since |
| 475 | + last restartpoint and at least one checkpoint record has been replayed. |
| 476 | + Restartpoints can't be performed more frequently than checkpoints in the |
| 477 | + master because restartpoints can only be performed at checkpoint records. |
| 478 | + </para> |
| 479 | + |
463 | 480 | <para>
|
464 | 481 | There are two commonly used internal <acronym>WAL</acronym> functions:
|
465 | 482 | <function>LogInsert</function> and <function>LogFlush</function>.
|
|
0 commit comments