Re: pgsql: Implement streaming mode in ReorderBuffer.

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amit Kapila <akapila(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Implement streaming mode in ReorderBuffer.
Date: 2021-04-28 02:54:06
Message-ID: CAA4eK1+f_Z7J52F0hrFgc1-Phnghk+v=eX9mgf7+GyR4sNN+bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Apr 28, 2021 at 5:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Kapila <akapila(at)postgresql(dot)org> writes:
> > Implement streaming mode in ReorderBuffer.
>
> I notice that new buildfarm member wrasse is unhappy about some of the
> code added by this commit:
>
> "/export/home/nm/farm/studio64v12_6/HEAD/pgsql.build/../pgsql/src/backend/replication/logical/reorderbuffer.c", line 2510: Warning: Likely null pointer dereference (*(curtxn+272)): ReorderBufferProcessTXN
>
> It's griping about this:
>
> curtxn->concurrent_abort = true;
>
> and I think it's got a point. There is little if any reason to have
> confidence that curtxn must be non-NULL when this code is reached,
> because it's in a PG_CATCH segment and there is a lot of code within
> the PG_TRY that could throw an error before the spot where curtxn
> is set. Not to mention that curtxn is set only conditionally.
>
> So I think
>
> if (curtxn)
> curtxn->concurrent_abort = true;
>
> would be cheap insurance against a core dump.
>

We can do that to silence this Warning, otherwise, there won't be any
problem because it is set only when we get a particular error code and
we can get that error code only when the conditions that lead to
curtxn being set are met.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-04-28 02:57:12 Re: pgsql: Fix pg_identify_object_as_address() with event triggers
Previous Message Tom Lane 2021-04-28 02:44:08 Re: pgsql: Fix pg_identify_object_as_address() with event triggers