Re: Streaming replication and WAL archive interactions
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>,
Venkata Balaji N <nag1010@gmail.com>,
Andres Freund <andres@anarazel.de>, Fujii Masao <masao.fujii@gmail.com>,
Borodin Vladimir <root@simply.name>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2015-04-23T08:11:19Z
Lists: pgsql-hackers
On 04/22/2015 11:58 PM, Robert Haas wrote: > On Wed, Apr 22, 2015 at 3:34 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote: >> On 04/22/2015 10:21 PM, Robert Haas wrote: >>> On Wed, Apr 22, 2015 at 3:01 PM, Heikki Linnakangas <hlinnaka@iki.fi> >>> wrote: >>>> For example, imagine that perform point-in-time recovery to WAL position >>>> 0/1237E568, on timeline 1. That falls within segment >>>> 000000010000000000000012. Then we end recovery, and switch to timeline 2. >>>> After the switch, and some more WAL-logged actions, we'll have these >>>> files >>>> in pg_xlog: >>>> >>>> 000000010000000000000011 >>>> 000000010000000000000012 >>>> 000000020000000000000012 >>>> 000000020000000000000013 >>>> 000000020000000000000014 >>> >>> >>> Is the 000000010000000000000012 file a "partial" segment of the sort >>> you're proposing to no longer achive? >> >> If you did pure archive recovery, with no streaming replication involved, >> then no. If it was created by streaming replication, and the replication had >> not filled the whole segment yet, then yes, it would be a partial segment. > > Why the difference? Because we don't archive partial segments, except for the last one at a timeline switch, and there was no timeline switch to timeline 1 within that segment. It doesn't really matter, though. The behaviour at the switch from timeline 1 to 2 works the same, whether the 000000010000000000000012 segment is complete or not. - Heikki