diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2017-03-24 19:23:13 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2017-03-24 19:23:13 +0300 |
commit | 2ed391f95b34bb88b4d092f0a1d68ce3903df375 (patch) | |
tree | c4f451100deb8ed849438ca05de4b787076a0d0b /src | |
parent | 8de6278d3b7c810fe5d31486491189d88550a2a6 (diff) | |
download | postgresql-2ed391f95b34bb88b4d092f0a1d68ce3903df375.tar.gz postgresql-2ed391f95b34bb88b4d092f0a1d68ce3903df375.zip |
Fix pgbench options -C and -R together
The bug is that prior to --rate doCustom was always disconnect/reconnect
without exiting, but with rate it returns if it has to wait. However threadRun
test whether there is a connection before recalling doCustom, so it was never
called.
Bug is not existed in head branch because of refactoring at
12788ae49e1933f463bc59a6efe46c4a01701b76, patch only 9.6
Author: Fabien Coelho
Reviewed-by: me
https://commitfest.postgresql.org/13/970/
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pgbench/pgbench.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 412f153230c..163dcad137f 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -1967,7 +1967,6 @@ top: st->listen = false; st->sleeping = false; st->throttling = false; - st->is_throttled = false; memset(st->prepared, 0, sizeof(st->prepared)); } @@ -4345,6 +4344,12 @@ threadRun(void *arg) remains--; /* I've aborted */ } } + else if (is_connect && st->sleeping) + { + /* it is sleeping for throttling, maybe it is done, let us try */ + if (!doCustom(thread, st, &aggs)) + remains--; + } if (st->ecnt > prev_ecnt && commands[st->state]->type == META_COMMAND) { |