Re: RecoveryInProgress() has critical side effects

Поиск
Список
Период
Сортировка
От Bossart, Nathan
Тема Re: RecoveryInProgress() has critical side effects
Дата
Msg-id DBF5D5C0-5A25-4181-956E-E1D3C9FAC1C8@amazon.com
обсуждение исходный текст
Ответ на RecoveryInProgress() has critical side effects  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: RecoveryInProgress() has critical side effects  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 11/11/21, 9:20 AM, "Robert Haas" <robertmhaas@gmail.com> wrote:
> memory, and not much is lost if they are set up and not used. So, in
> 0001, I propose to move the call to InitXLogInsert() from
> InitXLOGAccess() to BaseInit(). That means every backend will do it
> the first time it starts up. It also means that CreateCheckPoint()
> will no longer need a special case call to InitXLogInsert(), which
> seems like a good thing.

0001 looks reasonable to me.

> connected. However, it does have the effect of introducing a branch
> into GetFullPageWritesInfo(), which I'm not 100% sure is cheap enough
> not to matter. I think the obvious alternative is to just not
> initialize RedoRecPtr and doPageWrites at all and document in the
> comments that the first time each backend does something with them
> it's going to end up retrying once; perhaps that is preferable. Going

Unless there's a demonstrable performance benefit from adding the
branch, my preference is to leave it out.  I could be off-base, but it
seems possible that future changes might end up depending on any side
effects from this new branch, which is exactly what you're trying to
fix.  Plus, always using the retry path is a good way to test that it
works as expected.

Nathan


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add additional information to src/test/ssl/README
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Test::More version