Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Greg Smith <greg(at)2ndQuadrant(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Date: 2013-06-14 19:50:16
Message-ID: alpine.DEB.2.02.1306142033530.10940@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Greg,

I think that the weirdness really comes from the way transactions times
are measured, their interactions with throttling, and latent bugs in the
code.

One issue is that the throttling time was included in the measure, but not
the first time because "txn_begin" is not set at the beginning of
doCustom.

Also, flag st->listen is set to 1 but *never* set back to 0...
sh> grep listen pgbench.c
int listen;
if (st->listen)
st->listen = 1;
st->listen = 1;
st->listen = 1;
st->listen = 1;
st->listen = 1;
st->listen = 1;

ISTM that I can fix the "weirdness" by inserting an ugly "goto top;", but
I would feel better about it by removing all gotos and reordering some
actions in doCustom in a more logical way. However that would be a bigger
patch.

Please find attached 2 patches:

- the first is the full throttle patch which ensures that the
txn_begin is taken at a consistent point, after throttling,
which requires resetting "listen". There is an ugly goto.
I've also put times in a consistent format in the log,
"789.012345" instead of "789 12345".

- the second patch just shows the diff between v10 and the first one.

--
Fabien.

Attachment Content-Type Size
pgbench-throttle-test.patch text/x-diff 10.4 KB
pgbench-throttle-v10-to-test.patch text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2013-06-14 20:19:27 Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Previous Message Tom Lane 2013-06-14 18:28:38 Re: SPGist "triple parity" concept doesn't work