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

From: "Anton A(dot) Melnikov" <aamelnikov(at)inbox(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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: 2022-11-16 14:52:50
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks a lot for the fast reply!

On 03.11.2022 18:29, Tom Lane wrote:
> If we were just adding a
> query or two to an existing scenario, that could be okay; but spinning
> up and syncing a whole new primary and standby database is *expensive*
> when you multiply it by the number of times developers and buildfarm
> animals are going to run the tests in the future.

On 15.11.2022 04:59, Tom Lane wrote:
> "Anton A. Melnikov" <aamelnikov(at)inbox(dot)ru> writes:
>> On 02.11.2022 21:02, Tom Lane wrote:
>>> I don't think the cost of that test case is justified by the tiny
>>> probability that it'd ever catch anything.
>> Seems it is possible to do a test without these remarks. The attached
>> test uses existing nodes and checks the specific error message.
> My opinion remains unchanged: this would be a very poor use of test
> cycles.

Sorry, i didn't fully understand what is required and
added some functions to the test that spend extra cpu time. But i found
that it is possible to make a test according to previous remarks by adding
only a few extra queries to an existent test without any additional syncing.

Experimentally, i could not observe any significant difference in
CPU usage due to this test addition.
The difference in the CPU usage was less than standard error.
See 100_bugs-CPU-time.txt attached.

>> Additionally
>> i've tried to reduce overall number of nodes previously
>> used in this test in a similar way.
> Optimizing existing tests isn't an answer to that. We could
> install those optimizations without adding a new test case.

Oh sure! Here is a separate patch for this optimization:
On the contrary with previous case in that one the difference in the CPU usage
during is essential; it decreases approximately by 30%.

With the best wishes!

Anton A. Melnikov
Postgres Professional:
The Russian Postgres Company

Attachment Content-Type Size
v2-0001-Test-for-func-error-in-logrep-worker.patch text/x-patch 1.9 KB
100_bugs-CPU-time.txt text/plain 2.0 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2022-11-16 15:04:50 Re: Reducing power consumption on idle servers
Previous Message Tom Lane 2022-11-16 14:45:48 Re: const qualifier for list APIs