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

From: "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 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: 2023-01-08 06:02:33
Message-ID: 8f809b5b-380b-d4da-ca4f-39646719ecc7@inbox.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for your remarks.

On 07.01.2023 15:27, vignesh C wrote:
>
> Few suggestions:
> 1) There is a warning:
> +# This would crash on the subscriber if not fixed
> +$node_publisher->safe_psql('postgres', "INSERT INTO tab1 VALUES (3, 4)");
> +
> +my $result = $node_subscriber->wait_for_log(
> + "ERROR: relation \"error_name\" does not exist at character"
> +);
>
> "my" variable $result masks earlier declaration in same scope at
> t/100_bugs.pl line 400.
>
> You can change:
> my $result = $node_subscriber->safe_psql('postgres', "SELECT * FROM sch1.t1");
> to
> $result = $node_subscriber->safe_psql('postgres', "SELECT * FROM sch1.t1");

The reason is that the patch fell behind the master.
Fixed in v4 together with rebasing on current master.

> 2) Now that the crash is fixed, you could change it to a better message:
> +# This would crash on the subscriber if not fixed
> +$node_publisher->safe_psql('postgres', "INSERT INTO tab1 VALUES (3, 4)");
> +
> +my $result = $node_subscriber->wait_for_log(
> + "ERROR: relation \"error_name\" does not exist at character"
> +);
>

Tried to make this comment more clear.

Best wishes for the new year!

--
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
v4-0001-Test-for-func-error-in-logrep-worker.patch text/x-patch 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2023-01-08 06:02:46 RE: Perform streaming logical transactions by background workers and parallel apply
Previous Message Karl O. Pinc 2023-01-08 04:29:35 Re: drop postmaster symlink