Re: Include WAL in base backup - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Include WAL in base backup
Date
Msg-id 4D45B4C7.3040804@enterprisedb.com
Whole thread Raw
In response to Re: Include WAL in base backup  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On 29.01.2011 09:10, Fujii Masao wrote:
> On Sat, Jan 29, 2011 at 6:02 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com>  wrote:
>> On 27.01.2011 06:44, Fujii Masao wrote:
>>>
>>> +               XLByteToSeg(endptr, endlogid, endlogseg);
>>> <snip>
>>> +                       /* Have we reached our stop position yet? */
>>> +                       if (logid>    endlogid ||
>>> +                               (logid == endlogid&&    logseg>= endlogseg))
>>> +                               break;
>>>
>>> What I said in upthread is wrong. We should use XLByteToPrevSeg
>>> for endptr and check "logseg>    endlogseg". Otherwise, if endptr is
>>> not a boundary byte, endlogid/endlogseg indicates the last
>>> necessary WAL file, but it's not sent.
>>
>> We should use XLByteToPrevSeg, but I believe>= is still correct.
>> logid/logseg is the last WAL segment we've successfully sent, and
>> endlogif/endlogid is the last WAL segment we need to send. When they are the
>> same, we're done.
>
> Really? logid/logseg is incremented just before the check as follows.
> So, when they are the same, the WAL file which logid/logseg indicates
> has not been sent yet. Am I missing something?
>
> +            /* Advance to the next WAL file */
> +            NextLogSeg(logid, logseg);
> +
> +            /* Have we reached our stop position yet? */
> +            if (logid>  endlogid ||
> +                (logid == endlogid&&  logseg>= endlogseg))
> +                break;

Ah, you're right, I misread it. Never mind..

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: REVIEW: Determining client_encoding from client locale
Next
From: Robert Haas
Date:
Subject: Re: multiset patch review