Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWRrR-00022J-2H for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Jan 2017 17:59:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cWRrQ-00028Z-LT for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Jan 2017 17:59:56 +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.84_2) (envelope-from ) id 1cWRrP-000234-AO for pgsql-bugs@postgresql.org; Wed, 25 Jan 2017 17:59:55 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137] helo=cc-tupan-roaming-a.ensmp.fr) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWRrM-0005Q5-9Y for pgsql-bugs@postgresql.org; Wed, 25 Jan 2017 17:59:54 +0000 Received: from cri.ensmp.fr (176.237.219.88.rev.sfr.net [88.219.237.176]) (authenticated bits=0) by cc-tupan-roaming-a.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id v0PHxjMP014926 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Jan 2017 18:59:46 +0100 Date: Wed, 25 Jan 2017 18:59:45 +0100 (CET) From: Fabien COELHO X-X-Sender: fabien@lancre Reply-To: Fabien COELHO To: nuko yokohama cc: PostgreSQL Bugs List Subject: Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-193965029-1485367186=:2871" X-Miltered: at cc-tupan-roaming-a.ensmp.fr with ID 5888E791.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 5888E791.000 from 176.237.219.88.rev.sfr.net/176.237.219.88.rev.sfr.net/88.219.237.176/cri.ensmp.fr/ X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-193965029-1485367186=:2871 Content-Type: text/plain; format=flowed; charset=US-ASCII >> It operates normally when only the -C option or only the -R option is >> specified. >> >> In the PostgreSQL document, It is not described that "these two options can >> not be specified at the same time ". Is this a problem of pgbench? > > Yes, indeed there is. Thanks for the report. Option -C is seldom used and > tested. The problem is already fixed in head. Looking at git log, it was unclear to guess which change fixed that... After another reading, I got it in one, it has been fixed by Heikki restructuring patch 12788ae49e1933f463bc59a6efe46c4a01701b76 which has no vocation to be backpatched to prior versions... The bug is that prior to --rate doCustom was always disconnect/reconnect without exiting, but with rate it returns if it has to wait. However threadRun test whether there is a connection before recalling doCustom, so it was never called. This is exactly the kind of unmanageable state combination that refactoring has cleaned up. Attached a small patch which fixes the issue, I think, in 9.6. Fixing it raised another issue wrt to some stats under -C, that I fixed as well. -- Fabien. --8323329-193965029-1485367186=:2871 Content-Type: text/x-diff; name=pgbench-CR-bug-1.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-CR-bug-1.patch ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jDQppbmRleCA1MzE2NzFhLi4xZjFiN2Jm IDEwMDY0NA0KLS0tIGEvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KKysr IGIvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KQEAgLTE5NjcsNyArMTk2 Nyw2IEBAIHRvcDoNCiAJCXN0LT5saXN0ZW4gPSBmYWxzZTsNCiAJCXN0LT5z bGVlcGluZyA9IGZhbHNlOw0KIAkJc3QtPnRocm90dGxpbmcgPSBmYWxzZTsN Ci0JCXN0LT5pc190aHJvdHRsZWQgPSBmYWxzZTsNCiAJCW1lbXNldChzdC0+ cHJlcGFyZWQsIDAsIHNpemVvZihzdC0+cHJlcGFyZWQpKTsNCiAJfQ0KIA0K QEAgLTQzNDUsNiArNDM0NCwxMiBAQCB0aHJlYWRSdW4odm9pZCAqYXJnKQ0K IAkJCQkJCXJlbWFpbnMtLTsJCS8qIEkndmUgYWJvcnRlZCAqLw0KIAkJCQl9 DQogCQkJfQ0KKwkJCWVsc2UgaWYgKGlzX2Nvbm5lY3QgJiYgc3QtPnNsZWVw aW5nKQ0KKwkJCXsNCisJCQkJLyogaXQgaXMgc2xlZXBpbmcgZm9yIHRocm90 dGxpbmcsIG1heWJlIGl0IGlzIGRvbmUsIGxldCB1cyB0cnkgKi8NCisJCQkJ aWYgKCFkb0N1c3RvbSh0aHJlYWQsIHN0LCAmYWdncykpDQorCQkJCQlyZW1h aW5zLS07DQorCQkJfQ0KIA0KIAkJCWlmIChzdC0+ZWNudCA+IHByZXZfZWNu dCAmJiBjb21tYW5kc1tzdC0+c3RhdGVdLT50eXBlID09IE1FVEFfQ09NTUFO RCkNCiAJCQl7DQo= --8323329-193965029-1485367186=:2871 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --8323329-193965029-1485367186=:2871--