Avoid stuck of pbgench due to skipped transactions

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Avoid stuck of pbgench due to skipped transactions
Date: 2021-06-12 19:01:51
Message-ID: 20210613040151.265ff59d832f835bbcf8b3ba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I found that pgbench could get stuck when every transaction
come to be skipped and the number of transaction is not limitted
by -t option.

For example, when I usee a large rate (-R) for throttling and a
small latency limit (-L) values with a duration (-T), pbbench
got stuck.

$ pgbench -T 5 -R 100000000 -L 1;

When we specify the number of transactions by -t, it doesn't get
stuck because the number of skipped transactions are counted and
checked during the loop. However, the timer expiration is not
checked in the loop although it is checked before and after a
sleep for throttling.

I think it is better to check the timer expiration even in the loop
of transaction skips and to finish pgbnech successfully because we
should correcly repport how many transactions are proccessed and
skipped also in this case, and getting stuck would not be good
anyway.

I attached a patch for this fix.

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
pgbench_avoiding_stuck.patch text/x-diff 562 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-06-12 19:05:42 Re: no mailing list hits in google
Previous Message Alvaro Herrera 2021-06-12 18:43:08 Re: logical replication of truncate command with trigger causes Assert