Hi, Fujii san,

On Wed, Aug 7, 2013 at 7:03 AM, Fujii Masao <masao.fu...@gmail.com> wrote:
On second thought, probably we cannot remove the restored WAL files early
because they might be required for fast promotion which is new feature in 9.3. In fast promotion, an end-of-recovery checkpoint is not executed. After the end of recovery, normal online checkpoint starts. If the server crashes before such an online checkpoint completes, the server needs to replay again all the WAL files which it replayed before the promotion. Since this is the crash recovery, all those WAL files need to exist in pg_xlog directory. So if we remove the
restored WAL file from pg_xlog early, such a crash recovery might fail.

So even if cascade replication is disabled, if standby_mode = on, i.e., fast promotion can be performed, we cannot remove the restored WAL files early.

Following Fujii-san's advice, I've made the attached patch. This prevents unnecessary WAL accumulation in pg_xlog/ during archive recovery (not standby recovery). To do this, I had to revive some code in exitArchiveRecovery() from 9.1.

Could you commit this to 9.2 and later?


Attachment: wal_increase_in_pitr.patch
Description: Binary data

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to