Re: Fix for segfault in logical replication on master

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: osumi(dot)takamichi(at)fujitsu(dot)com, "akapila(at)postgresql(dot)org" <akapila(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix for segfault in logical replication on master
Date: 2021-06-19 09:18:14
Message-ID: CAA4eK1+iC4bLQ11NjgJjv9dQ2jn5ZY-js3Psa6XwRejQptvqBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 18, 2021 at 9:18 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> > I thought it was cheap enough to check that the relation we open is an index, because if it is not, we'll segfault when accessing fields of the relation->rd_index struct. I wouldn't necessarily advocate doing any really expensive checks here, but a quick sanity check seemed worth the effort.
> >
>
> I am not telling you anything about the cost of these sanity checks. I
> suggest you raise elog rather than return NULL because if this happens
> there is definitely some problem and continuing won't be a good idea.
>

Pushed, after making the above change. Additionally, I have moved the
test case to the existing file 001_rep_changes instead of creating a
new one as the test seems to fit there and I was not sure if the test
for just this case deserves a new file.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-06-19 09:37:43 Re: seawasp failing, maybe in glibc allocator
Previous Message Thomas Munro 2021-06-19 05:07:51 Re: seawasp failing, maybe in glibc allocator