seems like a bug in pgbench -R

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: seems like a bug in pgbench -R
Date: 2019-03-14 21:10:16
Message-ID: cc5d76c1-6144-bbed-ad1b-961d13d88f3b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

There seems to be a bug in pgbench when used with '-R' option, resulting
in stuck pgbench process. Reproducing it is pretty easy:

echo 'select 1' > select.sql

while /bin/true; do
pgbench -n -f select.sql -R 1000 -j 8 -c 8 -T 1 > /dev/null 2>&1;
date;
done;

I do get a stuck pgbench within a few rounds (~10-20), but YMMV. It gets
stuck like this (this is on REL_11_STABLE):

0x00007f3b1814fcb3 in __GI___select (nfds=nfds(at)entry=0,
readfds=readfds(at)entry=0x7fff9d668ec0, writefds=writefds(at)entry=0x0,
exceptfds=exceptfds(at)entry=0x0, timeout=timeout(at)entry=0x0)
at ../sysdeps/unix/sysv/linux/select.c:41
41 return SYSCALL_CANCEL (select, nfds, readfds, writefds, exceptfds,
(gdb) bt
#0 0x00007f3b1814fcb3 in __GI___select (nfds=nfds(at)entry=0,
readfds=readfds(at)entry=0x7fff9d668ec0, writefds=writefds(at)entry=0x0,
exceptfds=exceptfds(at)entry=0x0, timeout=timeout(at)entry=0x0)
at ../sysdeps/unix/sysv/linux/select.c:41
#1 0x000000000040834d in threadRun (arg=arg(at)entry=0x1c9f370) at
pgbench.c:5810
#2 0x0000000000403e0a in main (argc=<optimized out>, argv=<optimized
out>) at pgbench.c:5583

All the connections are already closed at this point (there is nothing
in pg_stat_activity and log_disconnections=on confirms that), and then
there's this:

(gdb) p remains
$1 = 0
(gdb) p nstate
$1 = 1
(gdb) p state[0]
$2 = {con = 0x0, id = 0, state = CSTATE_FINISHED, cstack = 0xf21b10,
use_file = 0, command = 1, variables = 0xf2b0b0, nvariables = 4,
vars_sorted = false, txn_scheduled = 699536519281, sleep_until = 0,
txn_begin = {tv_sec = 699536, tv_nsec = 518478603}, stmt_begin = {tv_sec
= 0, tv_nsec = 0}, prepared = {false <repeats 128 times>}, cnt = 132,
ecnt = 0}

So I guess this is a bug in 12788ae49e1933f463bc59a6efe46c4a01701b76, or
one of the other commits touching this part of the code.

cheers

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-03-14 22:08:08 Re: hyrax vs. RelationBuildPartitionDesc
Previous Message Andrew Dunstan 2019-03-14 21:09:30 Re: pgsql: Add support for hyperbolic functions, as well as log10().