From: Marina Polyakova <m.polyakova@postgrespro.ru>
To: Arthur Zakirov <a.zakirov@postgrespro.ru>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Date: Fri, 10 Aug 2018 17:59:29 +0300
Message-ID: <fe86b444c131176ea0e32f179747abe1@postgrespro.ru> (raw)
In-Reply-To: <20180810141918.GA5450@zakirov.localdomain>
References: <alpine.DEB.2.21.1807111435250.27883@lancre>
<976a25a46420c93866ada4051976b1be@postgrespro.ru>
<alpine.DEB.2.21.1807112124210.27883@lancre>
<f153ffd55f481d714ee44afc99ecc67e@postgrespro.ru>
<alpine.DEB.2.21.1807121801250.27883@lancre>
<25d7b1f518c218a8c335bdfc6c858ea1@postgrespro.ru>
<alpine.DEB.2.21.1808071823540.13466@lancre>
<fcc2512cdc9e6bc49d3b489181f454da@postgrespro.ru>
<20180810125327.GA2374@zakirov.localdomain>
<177cba37dface8918a58fda2188fa1ce@postgrespro.ru>
<20180810141918.GA5450@zakirov.localdomain>
On 10-08-2018 17:19, Arthur Zakirov wrote:
> On Fri, Aug 10, 2018 at 04:46:04PM +0300, Marina Polyakova wrote:
>> > +1 from me to keep initial name "pgbench_error". "pgbench_log" for new
>> > function looks nice to me. I think it is better than just "log",
>> > because "log" may conflict with natural logarithmic function (see "man 3
>> > log").
>>
>> Do you think that pgbench_log (or another whose name speaks only about
>> logging) will look good, for example, with FATAL? Because this means
>> that
>> the logging function also processes errors and calls exit(1) if
>> necessary..
>
> Yes, why not. "_log" just means that you want to log some message with
> the specified log level. Moreover those messages sometimes aren't
> error:
>
> pgbench_error(LOG, "starting vacuum...");
"pgbench_log" is already used as the default filename prefix for
transaction logging.
>> > I agree with Fabien. Calling pgbench_error() inside pgbench_error()
>> > could be dangerous. I think "fmt" checking could be removed, or we may
>> > use Assert()
>>
>> I would like not to use Assert in this case because IIUC they are
>> mostly
>> used for testing.
>
> I'd vote to remove this check at all. I don't see any place where it is
> possible to call pgbench_error() passing empty "fmt".
pgbench_error(..., "%s", PQerrorMessage(con)); ?
--
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: m.polyakova@postgrespro.ru, a.zakirov@postgrespro.ru, coelho@cri.ensmp.fr, alvherre@2ndquadrant.com, i.kurbangaliev@postgrespro.ru, teodor@sigaev.ru
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
In-Reply-To: <fe86b444c131176ea0e32f179747abe1@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox