Re: Patch to address creation of PgStat* contexts with null parent context

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Patch to address creation of PgStat* contexts with null parent context
Дата
Msg-id 20220729.115356.1101005842809628822.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Patch to address creation of PgStat* contexts with null parent context  (Zhang Mingli <zmlpostgres@gmail.com>)
Ответы Re: Patch to address creation of PgStat* contexts with null parent context  (Reid Thompson <reid.thompson@crunchydata.com>)
Список pgsql-hackers
At Thu, 28 Jul 2022 22:03:13 +0800, Zhang Mingli <zmlpostgres@gmail.com> wrote in 
> Hi,
> 
> On Jul 28, 2022, 21:30 +0800, Reid Thompson <reid.thompson@crunchydata.com>, wrote:
> > Attached is a patch to address this.

Good Catch!

> Codes seem good, my question is:
> 
> Do auto vacuum processes need CacheMemoryContext?

pgstat_report_vacuum requires it. Startup process doesn't seem to use
pgstats while recovery proceeding but requires the context only at
termination...

> Is it designed not to  create CacheMemoryContext in such processes?
> 
> If so, we’d better use TopMemoryContext in such processes.

That makes the memorycontext-tree structure unstable because
CacheMemoryContext can be created on-the-fly.

Honestly I don't like to call CreateCacheMemoryContext in the two
functions on-the-fly.  Since every process that calls
pgstat_initialize() necessarily calls pgstat_setup_memcxt() at latest
at process termination, I think we can create at least
CacheMemoryContext in pgstat_initialize(). Or couldn't we create the
all three contexts in the function, instead of calling
pgstat_setup_memcxt() on-the fly?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

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

Предыдущее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: Functions 'is_publishable_class' and 'is_publishable_relation' should stay together.
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Functions 'is_publishable_class' and 'is_publishable_relation' should stay together.