Re: Online base backup from the hot-standby - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Online base backup from the hot-standby
Date
Msg-id CAHGQGwF2hwT1_xRGBkB-UPXw8qUgc=9napx5Q+u35GH9-qwDWA@mail.gmail.com
Whole thread Raw
In response to Re: Online base backup from the hot-standby  (Jun Ishiduka <ishizuka.jun@po.ntts.co.jp>)
Responses Re: Online base backup from the hot-standby
List pgsql-hackers
2011/7/1 Jun Ishiduka <ishizuka.jun@po.ntts.co.jp>:
>
>> On this commitfest, the goal of the patch is to be able to be
>> recovered using "Minimum recovery ending location" in the control file.
>
> Done.

When the standby restarts after it crashes during recovery, it always
checks whether recovery has reached the backup end location by
using minRecoveryPoint even though the standby doesn't start from
the backup. This looks odd.

-        XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
+        (XLogRecPtrIsInvalid(ControlFile->backupStartPoint) ||
+         reachedControlMinRecoveryPoint == true))

The flag 'reachedControlMinRecoveryPoint' is really required? When recovery
reaches minRecoveryPoint, ControlFile->backupStartPoint is reset to zero. So
we can check whether recovery has reached minRecoveryPoint or not by only
doing XLogRecPtrIsInvalid(ControlFile->backupStartPoint). No?

We should check if recovery has reached minRecoveryPoint before calling
CheckRecoveryConsistency() after reading new WAL record? Otherwise,
even if recovery has reached minRecoveryPoint, the standby cannot think
that it's in consistent state until it reads new WAL record.

+                        if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr))
+                            ControlFile->minRecoveryPoint = EndRecPtr;

Why does ControlFile->minRecoveryPoint need to be set to EndRecPtr?

Regards,

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


pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: per-column generic option
Next
From: Craig Ringer
Date:
Subject: Re: Crash dumps