On Friday, December 21, 2012 6:24 PM Heikki Linnakangas wrote:
On 17.12.2012 18:58, Magnus Hagander wrote:
> On Mon, Dec 17, 2012 at 5:19 PM, Tom Lane<t...@sss.pgh.pa.us>  wrote:
>> Heikki Linnakangas<hlinnakan...@vmware.com>  writes:
>>>> I'm not happy with the fact that we just ignore the problem in a backup
>>>> taken from a standby, silently giving the user a backup that won't start
>>>> up. Why not include the timeline history file in the backup?
>>> +1.  I was not aware that we weren't doing that --- it seems pretty
>>> foolish, especially since as you say they're tiny.
>> Yeah, +1. That should probably have been a part of the whole
>> "basebackup from slave" patch, so it can probably be considered a
>> back-patchable bugfix in itself, no?

>Yes, this should be backpatched to 9.2. I came up with the attached.

> One solution to that would be to pay more attention to the timelines to
> include WAL from. basebackup.c could read the timeline history file, to
> see exactly where the timeline switches happened, and then construct the
> filename of each WAL segment using the correct timeline id. Another
> approach would be to do readdir() on pg_xlog, and include all WAL files,
> regardless of timeline IDs, that fall in the right XLogRecPtr range. The
> latter seems easier to backpatch.

I also think approach implemented by you is more better.
One small point, shouldn't it check (walsender_shutdown_requested || 
walsender_ready_to_stop) during ReadDir of pg_xlog similar to what is done in 
ReadDir() in SendDir?

With Regards,
Amit Kapila.

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

Reply via email to