Re: [BUG] Logical replica crash if there was an error in a function.
Anton A. Melnikov <aamelnikov@inbox.ru>
From: "Anton A. Melnikov" <aamelnikov@inbox.ru>
To: vignesh C <vignesh21@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>,
Amit Kapila <amit.kapila16@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Maxim Orlov <orlovmg@gmail.com>
Date: 2023-01-08T06:02:33Z
Lists: pgsql-hackers
Attachments
- v4-0001-Test-for-func-error-in-logrep-worker.patch (text/x-patch) patch v4-0001
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
Commits
-
Avoid crash after function syntax error in a replication worker.
- dea834938005 16.0 landed
- f2dc7f9e35a2 15.1 landed
- ed019b5ef955 11.18 landed
- d9ffccf8db4b 12.13 landed
- b00f342ea0f0 13.9 landed
- 5f3cec77b1b5 10.23 landed
- 2489c38cdc58 14.6 landed