Re: Switching XLog source from archive to streaming when primary available

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Switching XLog source from archive to streaming when primary available
Дата
Msg-id 20220909.141617.1843398696475923032.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Switching XLog source from archive to streaming when primary available  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
Being late for the party.

It seems to me that the function is getting too long.  I think we
might want to move the core part of the patch into another function.

I think it might be better if intentionalSourceSwitch doesn't need
lastSourceFailed set. It would look like this:

>  if (lastSourceFailed || switchSource)
>  {
>     if (nonblocking && lastSourceFailed)
>        return XLREAD_WOULDBLOCK;


+                    if (first_time)
+                        last_switch_time = curr_time;
..
+                    if (!first_time &&
+                        TimestampDifferenceExceeds(last_switch_time, curr_time,
..
+                    /* We're not here for the first time any more */
+                    if (first_time)
+                        first_time = false;

I don't think the flag first_time is needed.


regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: When should we bump the logical replication protocol version?
Следующее
От: John Naylor
Дата:
Сообщение: Re: build remaining Flex files standalone