Re: logical replication of truncate command with trigger causes Assert

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Subject: Re: logical replication of truncate command with trigger causes Assert
Date: 2021-06-11 05:29:53
Message-ID: CAA4eK1+n=4pQXKVDMO6QG7kL2QUxgeV2cq3m8_CNd_Q3Vu73iA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 11, 2021 at 12:20 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> > On Wed, Jun 9, 2021 at 8:44 PM Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com> wrote:
> >> On Jun 9, 2021, at 7:52 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> Somewhat unrelated, but ... am I reading the code correctly that
> >>> apply_handle_stream_start and related routines are using Asserts
> >>> to check that the remote sent stream-control messages in the correct
> >>> order?
>
> > This also needs to be changed to test-and-elog.
>
> Here's a proposed patch for this. It looks like pretty much all of the
> bogosity is new with the streaming business.
>

Except for the change in change in apply_handle_commit which seems to
be from the time it is introduced in commit 7c4f5240

> You might quibble with
> which things I thought deserved elog versus report.

I wonder why you used elog in handle_streamed_transaction and
apply_handle_commit? It seems all the other places use ereport for
anything wrong it got from the protocol message.

> Another thing
> I'm wondering is how many of these messages really need to be
> translated. We could use errmsg_internal and avoid burdening the
> translators, perhaps.
>

Not sure but I see all existing similar ereport calls don't use errmsg_internal.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-06-11 06:07:07 Re: Decoding speculative insert with toast leaks memory
Previous Message Kyotaro Horiguchi 2021-06-11 05:26:44 Re: Race condition in recovery?