Re: Include WAL in base backup

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Include WAL in base backup
Date: 2011-01-29 07:10:19
Message-ID: AANLkTimx-hbNzn2v-nMeyG03w7Vhup6fx+eqwrjdPB+F@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 29, 2011 at 6:02 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)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;

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-01-29 07:52:53 Re: Per-column collation, the finale
Previous Message Dan Ports 2011-01-29 04:36:40 Re: SSI patch version 14