Re: [BUG] Logical replica crash if there was an error in a function.

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Maxim Orlov <orlovmg(at)gmail(dot)com>
Subject: Re: [BUG] Logical replica crash if there was an error in a function.
Date: 2022-10-10 10:06:45
Message-ID: 20221010100645.pfula2bpv56a6txm@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Sep-24, Tom Lane wrote:

> "Anton A. Melnikov" <aamelnikov(at)inbox(dot)ru> writes:
> > [ v4-0001-Fix-logical-replica-assert-on-func-error.patch ]
>
> I took a quick look at this. I think you're solving the
> problem in the wrong place. The real issue is why are
> we not setting up ActivePortal correctly when running
> user-defined code in a logrep worker? There is other code
> that expects that to be set, eg EnsurePortalSnapshotExists.

Right ... mostly, the logical replication *does* attempt to set up a
transaction and active snapshot when replaying actions (c.f.
begin_replication_step()). Is this firing at an inappropriate time,
perhaps?

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-10-10 12:10:22 Re: problems with making relfilenodes 56-bits
Previous Message Alvaro Herrera 2022-10-10 10:04:22 Re: make_ctags: use -I option to ignore pg_node_attr macro