Re: SLRUs in the main buffer pool, redux

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: SLRUs in the main buffer pool, redux
Дата
Msg-id 7f09b521-36e3-4e09-2d50-7317490d5003@iki.fi
обсуждение исходный текст
Ответ на Re: SLRUs in the main buffer pool, redux  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: SLRUs in the main buffer pool, redux  (Shawn Debnath <clocksweep@gmail.com>)
Список pgsql-hackers
On 25/07/2022 09:54, Heikki Linnakangas wrote:
> In RecordTransactionCommit(), we enter a critical section, and then call
> TransactionIdCommitTree() to update the CLOG pages. That now involves a
> call to ReadBuffer_common(), which in turn calls
> ResourceOwnerEnlargeBuffers(). That can fail, because it might require
> allocating memory, which is forbidden in a critical section. I ran into
> an assertion about that with "make check" when I was playing around with
> a heavily modified version of this patch. Haven't seen it with your
> original one, but I believe that's just luck.
> 
> Calling ResourceOwnerEnlargeBuffers() before entering the critical
> section would probably fix that, although I'm a bit worried about having
> the Enlarge call so far away from the point where it's needed.

Oh I just saw that you had a comment about that in the patch and had 
hacked around it. Anyway, calling ResourceOwnerEnlargeBuffers() might be 
a solution. Or switch to a separate "CriticalResourceOwner" that's 
guaranteed to have enough pre-allocated space, before entering the 
critical section.

- Heikki



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

Предыдущее
От: vignesh C
Дата:
Сообщение: Re: Handle infinite recursion in logical replication setup
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Handle infinite recursion in logical replication setup