Re: replication slot stats memory bug

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: replication slot stats memory bug
Дата
Msg-id
3654384.1616024206@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
replication slot stats memory bug Andres Freund <andres@anarazel.de>
Re: replication slot stats memory bug Andres Freund <andres@anarazel.de>
Re: replication slot stats memory bug Amit Kapila <amit.kapila16@gmail.com>
Re: replication slot stats memory bug Tom Lane <tgl@sss.pgh.pa.us>
Re: replication slot stats memory bug Andres Freund <andres@anarazel.de>
Andres Freund  writes:
> I saw a leak in pgstat_read_statsfiles(), more precisely:
> 	/* Allocate the space for replication slot statistics */
> 	replSlotStats = palloc0(max_replication_slots * sizeof(PgStat_ReplSlotStats));

Yeah, I just found that myself.  I think your fix is good.

> But it seems like we just shouldn't allocate it dynamically at all?
> max_replication_slots doesn't change during postmaster lifetime, so it
> seems like it should just be allocated once?

Meh.  I don't see a need to wire in such an assumption here.

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Julien Rouhaud
Дата:
От: Andres Freund
Дата:
FAQ