Re: pgbench small bug fix - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pgbench small bug fix
Date
Msg-id CA+TgmobtUBH4zVf_9Z8qJQNMat0O2j=6_C=Uq2BP5Qa2_4fynQ@mail.gmail.com
Whole thread Raw
In response to pgbench small bug fix  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench small bug fix
List pgsql-hackers
On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>
> While testing for something else I encountered two small bugs under very low
> rate (--rate=0.1). The attached patches fixes these.
>
>  - when a duration (-T) is specified, ensure that pgbench ends at that
>    time (i.e. do not wait for a transaction beyond the end of the run).

Why does this use INSTR_TIME_GET_DOUBLE() and not INSTR_TIME_GET_MICROSEC()?

Also, why do we really need this change?  Won't the timer expiration
stop the thread at the right time anyway?  I mean, sure, in theory
it's wasteful for the thread to sit around doing nothing waiting for
the timer to expire, but it's not evident to me that hurts anything,
really.

>  - when there is a progress (-P) report, ensure that all progress
>    reports are shown even if no more transactions are schedule.

That's pretty ugly - it would be easy for the test at the top of the
loop to be left out of sync with the similar test inside the loop by
some future patch.  And again, I wonder why this is really a bug.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)
Next
From: Tom Lane
Date:
Subject: Re: WIP: Make timestamptz_out less slow.