Re: [HACKERS] Logical replication ApplyContext bloat

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: [HACKERS] Logical replication ApplyContext bloat
Дата
Msg-id 3cde85de-4464-3742-882c-75cd0d5a7528@2ndquadrant.com
обсуждение исходный текст
Ответ на [HACKERS] Logical replication ApplyContext bloat  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Ответы Re: [HACKERS] Logical replication ApplyContext bloat
Список pgsql-hackers
On 18/04/17 13:45, Stas Kelvich wrote:
> Hi,
> 
> currently logical replication worker uses ApplyContext to decode received data
> and that context is never freed during transaction processing. Hence if publication
> side is performing something like 10M row inserts in single transaction, then
> subscription worker will occupy more than 10G of ram (and can be killed by OOM).
> 
> Attached patch resets ApplyContext after each insert/update/delete/commit.
> I’ve tried to reset context only on each 100/1000/10000 value of CommandCounter,
> but didn’t spotted any measurable difference in speed.
> 
> Problem spotted by Mikhail Shurutov.
> 

Hmm we also do replication protocol handling inside the ApplyContext
(LogicalRepApplyLoop), are you sure this change is safe in that regard?

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Maksim Milyutin
Дата:
Сообщение: Re: [HACKERS] Proposal: Local indexes for partitioned table
Следующее
От: Stas Kelvich
Дата:
Сообщение: Re: [HACKERS] Logical replication ApplyContext bloat