Index: doc/src/sgml/backup.sgml =================================================================== RCS file: /home/sriggs/pg/REPOSITORY/pgsql/doc/src/sgml/backup.sgml,v retrieving revision 2.115 diff -c -r2.115 backup.sgml *** doc/src/sgml/backup.sgml 7 Mar 2008 01:46:41 -0000 2.115 --- doc/src/sgml/backup.sgml 28 Mar 2008 13:08:38 -0000 *************** *** 577,587 **** It is important that the archive command return zero exit status if and only if it succeeded. Upon getting a zero result, ! PostgreSQL will assume that the WAL segment file has been ! successfully archived, and will remove or recycle it. ! However, a nonzero status tells ! PostgreSQL that the file was not archived; it will try ! again periodically until it succeeds. --- 577,586 ---- It is important that the archive command return zero exit status if and only if it succeeded. Upon getting a zero result, ! PostgreSQL will assume that the file has been ! successfully archived, and will remove or recycle it. However, a nonzero ! status tells PostgreSQL that the file was not archived; ! it will try again periodically until it succeeds. *************** *** 1001,1011 **** It is important that the command return nonzero exit status on failure. ! The command will be asked for log files that are not present in the archive; it must return nonzero when so asked. This is not an ! error condition. Be aware also that the base name of the %p ! path will be different from %f; do not expect them to be ! interchangeable. --- 1000,1012 ---- It is important that the command return nonzero exit status on failure. ! The command will be asked for files that are not present in the archive; it must return nonzero when so asked. This is not an ! error condition. Not all of the requested files will be WAL segment ! files. You should also expect requests for files with a suffix of ! .backup or .history. Also be aware also that ! the base name of the %p path will be different from ! %f; do not expect them to be interchangeable. *************** *** 1576,1594 **** The magic that makes the two loosely coupled servers work together is ! simply a restore_command used on the standby that waits ! for the next WAL file to become available from the primary. The ! restore_command is specified in the recovery.conf file on the standby server. Normal recovery processing would request a file from the WAL archive, reporting failure if the file was unavailable. For standby processing it is normal for ! the next file to be unavailable, so we must be patient and wait for ! it to appear. A waiting restore_command can be written as ! a custom script that loops after polling for the existence of the next ! WAL file. There must also be some way to trigger failover, which should ! interrupt the restore_command, break the loop and return ! a file-not-found error to the standby server. This ends recovery and ! the standby will then come up as a normal server. --- 1577,1598 ---- The magic that makes the two loosely coupled servers work together is ! simply a restore_command used on the standby that, ! when asked for the next WAL file, waits for it to become available from ! the primary. The restore_command is specified in the recovery.conf file on the standby server. Normal recovery processing would request a file from the WAL archive, reporting failure if the file was unavailable. For standby processing it is normal for ! the next WAL file to be unavailable, so we must be patient and wait for ! it to appear. For files ending in .backup or ! .history there is no need to wait, though a non-zero return ! code should also be returned in this case. A waiting ! restore_command can be written as a custom script that loops ! after polling for the existence of the next WAL file. There must also be ! some way to trigger failover, which should interrupt the ! restore_command, break the loop and return a file-not-found ! error to the standby server. This ends recovery and the standby will then ! come up as a normal server. *************** *** 1608,1616 **** A working example of a waiting restore_command is provided ! as a contrib module named pg_standby. This ! example can be extended as needed to support specific configurations or ! environments. --- 1612,1621 ---- A working example of a waiting restore_command is provided ! as a contrib module named pg_standby. It ! should be used as a reference on how to correctly implement the logic ! described above. It can also be extended as needed to support specific ! configurations or environments.