Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fo8tB-0002ck-6E for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Aug 2018 14:59:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fo8t6-0004F2-Uj for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Aug 2018 14:59:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fo8t6-0004Eu-F3 for pgsql-hackers@lists.postgresql.org; Fri, 10 Aug 2018 14:59:36 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fo8t2-0002SQ-JV for pgsql-hackers@postgresql.org; Fri, 10 Aug 2018 14:59:35 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7697521C2426; Fri, 10 Aug 2018 17:59:29 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail.postgrespro.ru (cyclops.l.postgrespro.ru [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 32E6C21C2409; Fri, 10 Aug 2018 17:59:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1533913169; bh=xJrvABZgc37hBsxiXpPmncGygNiexUQY2GkvM09ucU8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=nx8o6GhO/AqqxUqNCblBB+eppuR2U/ZYxAe0RXIYUDIf+DFBA/qhSL55507CEwMBY luzfHeDsiqdQ+VMyHOlxu/rxpO/pwXM9C/q1GA0rGMp2WOQoYiwDGT/rBcgdx6xD4k QkFw9NWMzse3OsO8vz93tSFqhFwlQcyCRKz8y/PU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 10 Aug 2018 17:59:29 +0300 From: Marina Polyakova To: Arthur Zakirov Cc: Fabien COELHO , pgsql-hackers@postgresql.org, Alvaro Herrera , Ildus Kurbangaliev , Teodor Sigaev Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors Organization: Postgres Professional In-Reply-To: <20180810141918.GA5450@zakirov.localdomain> References: <976a25a46420c93866ada4051976b1be@postgrespro.ru> <25d7b1f518c218a8c335bdfc6c858ea1@postgrespro.ru> <20180810125327.GA2374@zakirov.localdomain> <177cba37dface8918a58fda2188fa1ce@postgrespro.ru> <20180810141918.GA5450@zakirov.localdomain> Message-ID: X-Sender: m.polyakova@postgrespro.ru User-Agent: Roundcube Webmail/1.2.4 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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