Re: pgbench small bug fix

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench small bug fix
Date: 2016-02-07 04:13:53
Message-ID: CA+TgmobtUBH4zVf_9Z8qJQNMat0O2j=6_C=Uq2BP5Qa2_4fynQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-07 04:14:02 Re: WIP: Make timestamptz_out less slow.
Previous Message Robert Haas 2016-02-07 03:39:49 Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)