Re: Fix around conn_duration in pgbench

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: Fix around conn_duration in pgbench
Date: 2021-07-30 05:43:43
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello Fujii-san,

On Fri, 30 Jul 2021 02:01:08 +0900
Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:

> On 2021/07/29 2:23, Fujii Masao wrote:
> >
> >
> > On 2021/07/28 16:15, Yugo NAGATA wrote:
> >>> I found another disconnect_all().
> >>>
> >>>     /* XXX should this be connection time? */
> >>>     disconnect_all(state, nclients);
> >>>
> >>> The measurement is also not necessary here.
> >>> So the above comment should be removed or updated?
> >>
> >> I think this disconnect_all will be a no-op because all connections should
> >> be already closed in threadRun(), but I left it just to be sure that
> >> connections are all cleaned-up. I updated the comment for explaining above.
> >>
> >> I attached the updated patch. Could you please look at this?
> >
> > Thanks for updating the patch! LGTM.
> This patch needs to be back-patched because it fixes the bug
> in measurement of disconnection delays. Thought?

This patch fixes three issues of connection time measurement:

1. The initial connection time is measured and stored into conn_duration
but the result is never used.
2. The disconnection time are not measured even when -C is specified.
3. The disconnection time measurement at the end of threadRun() is
not necessary.

The first one exists only in v14 and master, but others are also in v13 and
before. So, I think we can back-patch these fixes.

> But the patch fails to be back-patched to v13 or before because
> pgbench's time logic was changed by commit 547f04e734.
> Do you have the patches that can be back-patched to v13 or before?

I attached the patch for v13.

Yugo Nagata

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

Attachment Content-Type Size
pgbench-conn-duration-for-pg13.patch text/x-diff 2.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-07-30 06:02:40 Parallel Inserts (WAS: [bug?] Missed parallel safety checks..)
Previous Message Peter Smith 2021-07-30 05:40:52 Re: logical replication empty transactions