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

From Fabien COELHO
Subject Re: Avoid stuck of pbgench due to skipped transactions
Date
Msg-id alpine.DEB.2.22.394.2106122339210.479449@pseudo
Whole thread Raw
In response to Avoid stuck of pbgench due to skipped transactions  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: Avoid stuck of pbgench due to skipped transactions
List pgsql-hackers
Hello Yugo-san,

> 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;

Indeed, it does not get out of the catchup loop for a long time because 
even scheduling takes more time than the expected transaction time!

> 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.

The patch mostly works for me, and I agree that the bench should not be in 
a loop on any parameters, even when "crazy" parameters are given…

However I'm not sure this is the right way to handle this issue.

The catch-up loop can be dropped and the automaton can loop over itself to 
reschedule. Doing that as the attached fixes this issue and also makes 
progress reporting work proprely in more cases, and reduces the number of 
lines of code. I did not add a test case because time sensitive tests have 
been removed (which is too bad, IMHO).

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: "an SQL" vs. "a SQL"
Next
From: Noah Misch
Date:
Subject: Re: Continuing instability in insert-conflict-specconflict test