Re: [BUG] pg_basebackup from disconnected standby fails

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [BUG] pg_basebackup from disconnected standby fails
Дата
Msg-id CAA4eK1Jj3vbBbMuqEnswX4kNKuwhFdxJ0Q1-OtYAK3ANxEcuVQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUG] pg_basebackup from disconnected standby fails  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [BUG] pg_basebackup from disconnected standby fails  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Wed, Oct 26, 2016 at 12:39 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Wed, Oct 26, 2016 at 1:40 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> If you are inclined towards this solution, then I think what we need
>> to do is to change the API UpdateMinRecoveryPoint() such that it's
>> second parameter can take three values.  0 means update
>> minRecoveryPoint to passed lsn if minRecoveryPoint < lsn; 1 means
>> update minRecoveryPoint to latest replayed point if minRecoveryPoint <
>> lsn, same as currently false for *force*; 2 indicates same behaviour
>> as current *force* as true.  Also we need to pass currentTLI parameter
>> (lastCheckPoint.ThisTimeLineID) to this API to update
>> minRecoveryPointTLI.  I have not tried this, but I think something on
>> these lines should work.
>
> 0 is the behavior that you get when force = false, so it works as 1, no?
>

I don't think so.  Refer below code:

UpdateMinRecoveryPoint()
{
..
else if (force || minRecoveryPoint < lsn)
{
/*
* To avoid having to update the control file too often, we update it
* all the way to the last record being replayed, even though 'lsn'
* would suffice for correctness.  This also allows the 'force' case
* to not need a valid 'lsn' value.
..
}

If my understanding is right, then the changes proposed by you as
below is not what is intended here.  I think you need to do something
as I have mentioned above.

+ /*
+ * Update minRecoveryPoint just past the last redo checkpoint if
+ * necessary. This ensures that at next startup minRecoveryPoint will
+ * not be past the next point it would start at, preventing any
+ * weird behaviors with for example backups taken from standbys that
+ * rely on minRecoveryPoint as end backup location.
+ */
+ UpdateMinRecoveryPoint(RedoRecPtr, false);
+

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: PL/Python adding support for multi-dimensional arrays
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Push down more full joins in postgres_fdw