Re: [HACKERS] What does it mean by XLOG_BACKUP_RECORD? - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: [HACKERS] What does it mean by XLOG_BACKUP_RECORD?
Date
Msg-id CAD21AoDt2oBBaF1Cvn3AUagVBX27RnF_A+qtka8oz-p6xLxWNA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] What does it mean by XLOG_BACKUP_RECORD?  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] What does it mean by XLOG_BACKUP_RECORD?
List pgsql-hackers
On Thu, Jun 29, 2017 at 10:49 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Thu, Jun 29, 2017 at 10:28 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>> While reading source codes I found the following comment in xlog.c.
>>
>> /*
>>  * Have we passed our safe starting point? Note that minRecoveryPoint is
>>  * known to be incorrectly set if ControlFile->backupEndRequired, until
>>  * the XLOG_BACKUP_RECORD arrives to advise us of the correct
>>  * minRecoveryPoint. All we know prior to that is that we're not
>>  * consistent yet.
>>  */
>> if (!reachedConsistency && !ControlFile->backupEndRequired &&
>>     minRecoveryPoint <= lastReplayedEndRecPtr &&
>>     XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
>>
>> What does XLOG_BACKUP_RECORED means by? I could not find such XLOG info value.
>> Does it mean XLOG_BACKUP_END?
>
> This comment is a thinko, it refers to XLOG_BACKUP_END. This comment
> block could be reworded a bit, it looks cleaner to me to say
> "ControlFile->backupEndRequired is false" instead of just referring to
> the variable itself.

Thanks, I agree to use XLOG_BACKUP_END instead.

> Worse, the current comment implies that
> minRecoveryPoint is incorrectly set if it is true. Bleh.

Looking at the condition, we use minRecoveryPoint only when
ControlFile->backupEndRequired is *false*. So I guess that it means
that minRecoveryPoint is incorrectly set if
ControlFile->backupEndReuired is true. Am I missing something?

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] Start logical decoding from any lsn present in the wal segment
Next
From: Etsuro Fujita
Date:
Subject: [HACKERS] Add support for tuple routing to foreign partitions