Re: pgbench - minor fix for meta command only scripts

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael.paquier@gmail.com>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2016-09-20T05:09:43Z
Lists: pgsql-hackers
Hello Heikki,

> Yeah, it really is quite a mess. I tried to review your patch, and I think 
> it's correct, but I couldn't totally convince myself, because of the existing 
> messiness of the logic.

Alas:-(

> So I bit the bullet and started refactoring.

Wow!

> I came up with the attached. It refactors the logic in doCustom() into a 
> state machine.

Sounds good! This can only help.

> I think this is much clearer, what do you think?

I think that something was really needed. I'm going to review and test 
this patch very carefully, probably over next week-end, and report.

-- 
Fabien.


Commits

  1. Fix busy-wait in pgbench, with --rate.

  2. Refactor script execution state machine in pgbench.