From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: pgbench - minor fix for meta command only scripts
Date: Sat, 30 Sep 2017 00:21:49 +0200 (CEST)
Message-ID: <alpine.DEB.2.20.1709292356110.4754@lancre> (raw)
In-Reply-To: <CA+Tgmoa41z4ptkD9P4e64=VV2pm6o1zNR-Wgz1qtLo5tcm+i5g@mail.gmail.com>
References: <alpine.DEB.2.20.1607090850120.3412@sto>
<CAB7nPqRZmRbsfdShOLPMGuqU3BeZFbYG5u0jsXv1q+LxLsP5uw@mail.gmail.com>
<alpine.DEB.2.20.1607110653460.12659@sto>
<6016.1468357163@sss.pgh.pa.us>
<alpine.DEB.2.20.1607130823530.7486@sto>
<c1a85521-5009-ebe5-1f5e-544e0bd7a88a@iki.fi>
<alpine.DEB.2.20.1609241112330.6473@lancre>
<b7aa6d66-daf8-bbe7-eeb3-26a25d18629a@iki.fi>
<CAMkU=1x5hoX0pLLKPRnXCy0T8uHoDvXdq+7kAM9eoC9_z72ucw@mail.gmail.com>
<alpine.DEB.2.20.1709042249120.19424@lancre>
<CAMkU=1xCmFMHC1z3SPXU6s-LQiEaJ9z=11_nLLKY3rJ6uMkMuw@mail.gmail.com>
<alpine.DEB.2.20.1709111044310.32517@lancre>
<CA+Tgmoa41z4ptkD9P4e64=VV2pm6o1zNR-Wgz1qtLo5tcm+i5g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hello Robert,
>> ISTM that this bug exists since rate was introduced, so shame on me and
>> back-patching should be needed.
>
> I took a look at this and found that the proposed patch applies
> cleanly all the way back to 9.5, but the regression is reported to
> have begun with a commit that starts in v10. I haven't probed into
> this in any depth, but are we sure that
> 12788ae49e1933f463bc59a6efe46c4a01701b76 is in fact where this problem
> originated?
Yes.
I just rechecked that the problem occurs at 12788ae but not at the
preceding da6c4f6ca8.
Now the situation before the restructuring is that it worked but given the
spaghetti code it was very hard to guess why, not to fix issues when
not...
My late at night fuzzy interpretation is as follows:
The issue is in the code above the fix I submitted which checks what has
to be selected. In the previous version ISTM that the condition was laxed,
so it filled the input_mask even if the client was not waiting for
anything, so it was calling select later which was really just
implementing the timeout. With the updated version the input mask and
maxsock is only set if there is really something to wait, and if not then
it fall through and is active instead of doing a simple sleep/timeout.
So I would say that the previous version worked because of a side effect
which may or may not have been intentional at the time, and was revealed
by checking the condition better.
Basically I'd say that the restructuring patch fixed a defect which
triggered the bug. Programming is fun:-)
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: coelho@cri.ensmp.fr, robertmhaas@gmail.com, jeff.janes@gmail.com, hlinnaka@iki.fi, tgl@sss.pgh.pa.us, michael.paquier@gmail.com
Subject: Re: pgbench - minor fix for meta command only scripts
In-Reply-To: <alpine.DEB.2.20.1709292356110.4754@lancre>
References: <alpine.DEB.2.20.1607090850120.3412@sto> <CAB7nPqRZmRbsfdShOLPMGuqU3BeZFbYG5u0jsXv1q+LxLsP5uw@mail.gmail.com> <alpine.DEB.2.20.1607110653460.12659@sto> <6016.1468357163@sss.pgh.pa.us> <alpine.DEB.2.20.1607130823530.7486@sto> <c1a85521-5009-ebe5-1f5e-544e0bd7a88a@iki.fi> <alpine.DEB.2.20.1609241112330.6473@lancre> <b7aa6d66-daf8-bbe7-eeb3-26a25d18629a@iki.fi> <CAMkU=1x5hoX0pLLKPRnXCy0T8uHoDvXdq+7kAM9eoC9_z72ucw@mail.gmail.com> <alpine.DEB.2.20.1709042249120.19424@lancre> <CAMkU=1xCmFMHC1z3SPXU6s-LQiEaJ9z=11_nLLKY3rJ6uMkMuw@mail.gmail.com> <alpine.DEB.2.20.1709111044310.32517@lancre> <CA+Tgmoa41z4ptkD9P4e64=VV2pm6o1zNR-Wgz1qtLo5tcm+i5g@mail.gmail.com> <alpine.DEB.2.20.1709292356110.4754@lancre>
* 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