Avoid stuck of pbgench due to skipped transactions - Mailing list pgsql-hackers

From Yugo NAGATA
Subject Avoid stuck of pbgench due to skipped transactions
Date
Msg-id 20210613040151.265ff59d832f835bbcf8b3ba@sraoss.co.jp
Whole thread Raw
Responses Re: Avoid stuck of pbgench due to skipped transactions
List 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@sraoss.co.jp>

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: logical replication of truncate command with trigger causes Assert
Next
From: Tom Lane
Date:
Subject: Re: recovery test failures on hoverfly