mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
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
12788ae49e
, patch only 9.6
Author: Fabien Coelho
Reviewed-by: me
https://commitfest.postgresql.org/13/970/
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user