Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Дата
Msg-id CAA4eK1LjyC6nk3p4PSnLSjiFs5Jhxy6VUtRu2vSSsMWXb=5pGA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o  (Dilip Kumar <dilipbalaut@gmail.com>)
Список pgsql-hackers
On Tue, Aug 17, 2021 at 1:30 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Tue, Aug 17, 2021 at 10:54 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
>
> > 5. How can we provide a strict mechanism to not allow to use dsm APIs
> > for non-dsm FileSet? One idea could be that we can have a variable
> > (probably bool) in SharedFileSet structure which will be initialized
> > in SharedFileSetInit based on whether the caller has provided dsm
> > segment. Then in other DSM-based APIs, we can check if it is used for
> > the wrong type.
>
> Yeah, we can do something like that, can't we just use an existing
> variable instead of adding new, e.g. refcnt is required only when
> multiple processes are attached, so maybe if dsm segment is not passed
> then we can keep refcnt as 0 and based on we can give an error.  For
> example, if we try to call SharedFileSetAttach for the SharedFileSet
> which has refcnt as 0 then we error out?
>

But as of now, we treat refcnt as 0 for SharedFileSet that is already
destroyed. See SharedFileSetAttach.

-- 
With Regards,
Amit Kapila.



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: pgstat_send_connstats() introduces unnecessary timestamp and UDP overhead
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Allow multiple recursive self-references