Re: RecoveryInProgress() has critical side effects

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: RecoveryInProgress() has critical side effects
Дата
Msg-id YawLYK/xuV3SxXIb@paquier.xyz
обсуждение исходный текст
Ответ на Re: RecoveryInProgress() has critical side effects  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: RecoveryInProgress() has critical side effects  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Tue, Nov 16, 2021 at 09:41:58AM -0500, Robert Haas wrote:
> Maybe I'm not understanding you properly here, but it seems like you
> might be forgetting that this is a local variable and thus every
> backend is going to have something different. In the startup process,
> it will be initialized by StartupXLOG(); in other processes, it's
> currently initialized by RecoveryInProgress(), but with this patch it
> wouldn't be. Either way, it's then updated by future calls to
> XLogInsertRecord() as required. XLOG_FPW_CHANGE records might affect
> the new value that gets set the next time XLogInsertRecord(), but they
> don't directly affect doPageWrites.

My main worry here is that this changes slightly the definition of
doPageWrites across stable branches at the end of recovery as there
could be records generated there.  Note that GetFullPageWriteInfo()
gets called in XLogInsert(), while Insert->fullPageWrites gets updated
before CleanupAfterArchiveRecovery().  And it may influence
the value of doPageWrites in the startup process.
--
Michael

Вложения

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

Предыдущее
От: Chapman Flack
Дата:
Сообщение: Re: SPI TupTable memory context
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Remove extra Logging_collector check before calling SysLogger_Start()