*** wal.sgml.orig Wed Jan 24 21:55:56 2001 --- wal.sgml Wed Jan 24 22:08:44 2001 *************** *** 149,154 **** --- 149,176 ---- + + Database Recovery with WAL + + + After a checkpoint has been made and the log flushed, the checkpoint's + position is saved in pg_control. Therefore, when + recovery is to be done, the backend first reads + pg_control, and then the checkpoint record; next it + reads the redo record, whose position is saved in the checkpoint, and + begins the REDO operation. Because the entire content of the + pages is saved in the log on the first page modification after a + checkpoint, the pages will be first restored to a consistent state. + + Using pg_control to get the checkpoint position speeds + up the recovery process, but to handle possible corruption of + pg_control, we should actually + implement the reading of existing log segments in reverse order -- newest + to oldest -- in order to find the last checkpoint. This has not yet been + done at release 7.1. + + + WAL parameters *************** *** 187,196 **** what record in the log (known as the redo record) it should start the REDO operation, since any changes made to data files before that record are already on disk. After a checkpoint has been made, any log segments ! written before the redo record may be removed/archived, so checkpoints ! are used to free disk space in the WAL directory. The checkpoint maker ! is also able to create a few log segments for future use, so as to avoid ! the need for LogInsert or LogFlush to spend time in creating them. --- 209,220 ---- what record in the log (known as the redo record) it should start the REDO operation, since any changes made to data files before that record are already on disk. After a checkpoint has been made, any log segments ! written before the redo record are automatically removed, so checkpoints ! are used to free disk space in the WAL directory. Once WAL-based BAR ! is implemented, the log segments can be archived instead of just being ! removed. The checkpoint maker is also able to create a few log segments ! for future use, so as to avoid the need for LogInsert ! or LogFlush to spend time in creating them.