pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rework the pgbench state machine code for clarity
Date: Wed, 21 Nov 2018 19:35:47 +0000
Message-ID: <E1gPYHr-0001mE-Me@gemulon.postgresql.org> (raw)

Rework the pgbench state machine code for clarity

This commit continues the code improvements started by commit
12788ae49e19.  With this commit, state machine transitions are better
contained in the routine that was called doCustom() and is now called
advanceConnectionState -- the resulting code is easier to reason about,
since there are no state changes occuring in the outer layer.

This change is prompted by future patches to add more features to
pgbench, which will need to effect some more surgery to this code.

Fabien's original had all the machine state changes inside one routine,
but I (Álvaro) thought that a subroutine to handle command execution is
more straightforward to review, so this commit does not match Fabien's
submission closely.  If something is broken, it's probably my fault.

Author: Fabien Coelho, Álvaro Herrera
Reviewed-by: Kirk Jamison
Discussion: https://postgr.es/m/alpine.DEB.2.21.1808111104320.1705@lancre

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3bac77c48f166b9024a5ead984df73347466ae12

Modified Files
--------------
src/bin/pgbench/pgbench.c | 723 ++++++++++++++++++++++------------------------
1 file changed, 351 insertions(+), 372 deletions(-)



Message-ID: <E1gPYHr-0001mE-Me@gemulon.postgresql.org>
Permalink:  ../E1gPYHr-0001mE-Me@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gPYHr-0001mE-Me@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Rework the pgbench state machine code for clarity
  In-Reply-To: <E1gPYHr-0001mE-Me@gemulon.postgresql.org>
  References: <E1gPYHr-0001mE-Me@gemulon.postgresql.org>

* 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