Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jh4Dn-0002UG-8j for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Jun 2020 04:44:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jh4Dk-0005bF-Ul for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Jun 2020 04:44:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jh4Dk-0005b8-J5 for pgsql-bugs@lists.postgresql.org; Fri, 05 Jun 2020 04:44:44 +0000 Received: from courriel-2.mines-paristech.fr ([77.158.173.19] helo=antispam-1.ensmp.fr) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jh4Df-0008BN-If for pgsql-bugs@lists.postgresql.org; Fri, 05 Jun 2020 04:44:43 +0000 Received: from smtp-5.mines-paristech.fr (smtp.mines-paristech.fr [77.158.173.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id A77C856434; Fri, 5 Jun 2020 06:44:35 +0200 (CEST) Received: from pseudo (159.237.219.88.rev.sfr.net [88.219.237.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-5.mines-paristech.fr (Postfix) with ESMTPSA id 2FC5220159; Fri, 5 Jun 2020 06:44:35 +0200 (CEST) Date: Fri, 5 Jun 2020 06:44:33 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo To: David Rowley cc: Tom Lane , "Jawarilal, Manish" , "pgsql-bugs@lists.postgresql.org" Subject: Re: pgbench bug / limitation In-Reply-To: Message-ID: References: <7221.1590687090@sss.pgh.pa.us> <10327.1590763515@sss.pgh.pa.us> <384920.1591027137@sss.pgh.pa.us> <512846.1591057287@sss.pgh.pa.us> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2056645051-495762549-1591332275=:213031" X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrudegvddgkedtucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesmhdtreertdervdenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucggtffrrghtthgvrhhnpeehkeduhedtjeehleehtefhjeefgedvgfeltdegtedttdehtdegvedugfefleelvdenucfkphepkeekrddvudelrddvfeejrdduheelnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2056645051-495762549-1591332275=:213031 Content-Type: text/plain; charset=US-ASCII; format=flowed Hello David, > On Tue, 2 Jun 2020 at 23:27, Fabien COELHO wrote: >> Attached is a blind attempt at working around the issue based on what you >> show below, that I cannot test. > > I suppose we might be able to do something like that. It does expose > us to the implementation of Microsoft's fd_set struct, but surely the > shape of that must be pretty much fixed since if it were to be changed > then software that's already compiled would break. Yep. I cannot seen how to do it without some assumption about the underlying implementation. I agree that it breaks the very principle of the interface, which is to hide fdset implementation details. > I tested the patch on a Windows machine Thanks. > and it seems to work. Good. > I'm not much a fan of the naming of the new macro though. Wouldn't it > be better to reverse the logic and call it IS_VALID_FD? I hesitated. Here it is with a inversion/renaming, and a check that fd is positive on windows. I renamed to "FD_IS_VALID" which seems to read better. -- Fabien. --2056645051-495762549-1591332275=:213031 Content-Type: text/x-diff; name=pgbench-select-win-2.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-select-win-2.patch ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jDQppbmRleCAwOGE1OTQ3YTllLi4yM2Yz NTczMTVmIDEwMDY0NA0KLS0tIGEvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2gu Yw0KKysrIGIvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KQEAgLTY2OTgs MTAgKzY2OTgsMjIgQEAgY2xlYXJfc29ja2V0X3NldChzb2NrZXRfc2V0ICpz YSkNCiAJc2EtPm1heGZkID0gLTE7DQogfQ0KIA0KKyNpZm5kZWYgV0lOMzIN CisjZGVmaW5lIEZEX0lTX1ZBTElEKGZkLCBzZXQpICgoZmQpID49IDAgJiYg KGZkKSA8IEZEX1NFVFNJWkUpDQorI2Vsc2UNCisvKg0KKyAqIFdpbmRvd3Mg aW1wbGVtZW50YXRpb24gaXMgYm9ndXM6IGl0IGRvZXMgbm90IGFsbG9jYXRl IGZkIHdpdGggdGhlIGxvd2VzdA0KKyAqIHBvc3NpYmxlIG51bWJlciwgYW5k IEZEX1NFVCBpcyBpbXBsZW1lbnRlZCBhcyBhIHNpbXBsZSBhcnJheS4NCisg Kg0KKyAqIEZpbGxpbmcgdGhlIHNldCBpcyBpbiBPKE5eMikuDQorICovDQor I2RlZmluZSBGRF9JU19WQUxJRChmZCwgc2V0KSAoKGZkKSA+PSAwICYmIChz ZXQpLT5mZF9jb3VudCA8IEZEX1NFVFNJWkUpDQorI2VuZGlmIC8qIFdJTjMy ICovDQorDQogc3RhdGljIHZvaWQNCiBhZGRfc29ja2V0X3RvX3NldChzb2Nr ZXRfc2V0ICpzYSwgaW50IGZkLCBpbnQgaWR4KQ0KIHsNCi0JaWYgKGZkIDwg MCB8fCBmZCA+PSBGRF9TRVRTSVpFKQ0KKwlpZiAoIUZEX0lTX1ZBTElEKGZk LCAmc2EtPmZkcykpDQogCXsNCiAJCS8qDQogCQkgKiBEb2luZyBhIGhhcmQg ZXhpdCBoZXJlIGlzIGEgYml0IGdyb3R0eSwgYnV0IGl0IGRvZXNuJ3Qgc2Vl bSB3b3J0aA0K --2056645051-495762549-1591332275=:213031--