[HACKERS] Logical replication ApplyContext bloat

Поиск
Список
Период
Сортировка
От Stas Kelvich
Тема [HACKERS] Logical replication ApplyContext bloat
Дата
Msg-id 9A2F6FEC-D510-4AD6-8082-A1021040C840@postgrespro.ru
обсуждение исходный текст
Ответы Re: [HACKERS] Logical replication ApplyContext bloat
Список pgsql-hackers
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.



Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Maksim Milyutin
Дата:
Сообщение: Re: [HACKERS] Proposal: Local indexes for partitioned table
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: [HACKERS] SCRAM authentication, take three