]> granicus.if.org Git - postgresql/commit
Prevent the already-archived WAL file from being archived again.
authorFujii Masao <fujii@postgresql.org>
Thu, 23 Oct 2014 07:21:27 +0000 (16:21 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 23 Oct 2014 07:22:41 +0000 (16:22 +0900)
commit6d12cc1f01c867fd7317ac5580b02c04f313d9ce
tree3a21db38d0696c1bf93ebf319868ad2209c983a4
parentb53942e59644d79c2df7951523a50dc4d2d97668
Prevent the already-archived WAL file from being archived again.

Previously the archive recovery always created .ready file for
the last WAL file of the old timeline at the end of recovery even when
it's restored from the archive and has .done file. That is, there was
the case where the WAL file had both .ready and .done files.
This caused the already-archived WAL file to be archived again.

This commit prevents the archive recovery from creating .ready file
for the last WAL file if it has .done file, in order to prevent it from
being archived again.

This bug was added when cascading replication feature was introduced,
i.e., the commit 5286105800c7d5902f98f32e11b209c471c0c69c.
So, back-patch to 9.2, where cascading replication was added.

Reviewed by Michael Paquier
src/backend/access/transam/xlog.c