Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()
Дата
Msg-id Y7OQO3tlMen184Ss@paquier.xyz
обсуждение исходный текст
Ответ на Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Fri, Dec 30, 2022 at 10:32:57AM -0800, Nathan Bossart wrote:
> This looks correct to me.  The only thing that stood out to me was the loop
> through 'tles' in XLogFileReadyAnyTLI.  With this change, we'd loop through
> the timelines for both XLOG_FROM_PG_ARCHIVE and XLOG_FROM_PG_WAL, whereas
> now we only loop through the timelines once.  However, I doubt this makes
> much difference in practice.  You'd only do the extra loop whenever
> restoring from the archives failed.

        case XLOG_FROM_ARCHIVE:
+
+           /*
+            * After failing to read from archive, we try to read from
+            * pg_wal.
+            */
+           currentSource = XLOG_FROM_PG_WAL;
+           break;
In standby mode, the priority lookup order is pg_wal -> archive ->
stream.  With this change, we would do pg_wal -> archive -> pg_wal ->
stream, meaning that it could influence some recovery scenarios while
involving more lookups than necessary to the local pg_wal/ directory?

See, on failure where the current source is XLOG_FROM_ARCHIVE, we
would not switch anymore directly to XLOG_FROM_STREAM.
--
Michael

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: perl 5.36, C99, -Wdeclaration-after-statement -Wshadow=compatible-local
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: CFM for 2023-01