Re: subscription/015_stream sometimes breaks

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: subscription/015_stream sometimes breaks
Date: 2023-08-24 07:50:44
Message-ID: 20230824075044.cn4slf6wgvkpdc7f@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Aug-24, Amit Kapila wrote:

> On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> 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.

> > In fact, I'd go further and propose that if we do take that stance, then
> > we don't need clear out the contents of this struct at all, so let's
> > not. That's 0002.
>
> Personally, I think we should consider this change (0002 and 0002) separately.

I agree. I'd maybe even retract them.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Shinderuk 2023-08-24 08:11:49 Re: Fix error handling in be_tls_open_server()
Previous Message Peter Eisentraut 2023-08-24 06:57:58 Remove IndexInfo.ii_OpclassOptions field