Re: subscription/015_stream sometimes breaks

Поиск
Список
Период
Сортировка
Искать
От
Amit Kapila
Тема
Re: subscription/015_stream sometimes breaks
Дата
Msg-id
CAA4eK1KXrG9UER+RdMt4CTcA8SihREAcmiRgJhST5q1fGc=hNA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
subscription/015_stream sometimes breaks Thomas Munro <thomas.munro@gmail.com>
Re: subscription/015_stream sometimes breaks Thomas Munro <thomas.munro@gmail.com>
Re: subscription/015_stream sometimes breaks vignesh C <vignesh21@gmail.com>
RE: subscription/015_stream sometimes breaks "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
RE: subscription/015_stream sometimes breaks "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Re: subscription/015_stream sometimes breaks Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: subscription/015_stream sometimes breaks Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: subscription/015_stream sometimes breaks Amit Kapila <amit.kapila16@gmail.com>
Re: subscription/015_stream sometimes breaks Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: subscription/015_stream sometimes breaks Amit Kapila <amit.kapila16@gmail.com>
Re: subscription/015_stream sometimes breaks Amit Kapila <amit.kapila16@gmail.com>
Re: subscription/015_stream sometimes breaks Peter Smith <smithpb2250@gmail.com>
Re: subscription/015_stream sometimes breaks Amit Kapila <amit.kapila16@gmail.com>
Re: subscription/015_stream sometimes breaks Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: subscription/015_stream sometimes breaks Peter Smith <smithpb2250@gmail.com>
Re: subscription/015_stream sometimes breaks Peter Smith <smithpb2250@gmail.com>
Re: subscription/015_stream sometimes breaks Amit Kapila <amit.kapila16@gmail.com>
On Fri, Aug 25, 2023 at 9:09 AM Peter Smith  wrote:
>
> On Thu, Aug 24, 2023 at 8:18 PM Amit Kapila  wrote:
> >
> > On Thu, Aug 24, 2023 at 1:20 PM Alvaro Herrera  wrote:
> > >
> > > On 2023-Aug-24, Amit Kapila wrote:
> > >
> > > > On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera  wrote:
> > >
> > > > > Hmm, I think if worker->in_use is false, we shouldn't consult the rest
> > > > > of the struct at all, so I propose to add the attached 0001 as a minimal
> > > > > fix.
> > > >
> > > > I think that way we may need to add the check for in_use before
> > > > accessing each of the LogicalRepWorker struct fields or form some rule
> > > > about which fields (or places) are okay to access without checking
> > > > in_use field.
> > >
> > > As far as I realize, we have that rule already.  It's only a few
> > > relatively new places that have broken it.  I understand that the in_use
> > > concept comes from the one of the same name in ReplicationSlot, except
> > > that it is not at all documented in worker_internal.h.
> > >
> > > So I propose we do both: apply Zhijie's patch and my 0001 now; and
> > > somebody gets to document the locking design for LogicalRepWorker.
> > >
> >
> > Agreed.
>
> Both of these patches (Hou-san's expedient resetting of the worker
> type, Alvaro's 0001 putting the 'in_use' check within the isXXXWorker
> type macros) appear to be blending the concept of "type" with whether
> the worker is "alive" or not, which I am not sure is a good thing. IMO
> the type is the type forever, so I felt type should get assigned only
> once when the worker is "born". For example, a dead horse is still a
> horse.
>

I think it is important to have a alive check before accessing the
worker type as we are doing for some of the other fields. For example,
see the usage of in_use flag in the function logicalrep_worker_find().
The usage of parallel apply workers doesn't consider the use of in_use
flag where as other worker types would first check in_use flag.

-- 
With Regards,
Amit Kapila.


В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
Сообщение: broken master regress tests
От: Julien Rouhaud
Дата:
Сообщение: Re: psql --no-connect option
FAQ