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-08-26 03:13:13
Message-ID: 20210826121313.9b6ac52d3cd45780e6a4cff5@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 20 Aug 2021 02:05:27 +0900
Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:

>
> On 2021/08/11 13:56, Fujii Masao wrote:
> > Yes, but I was thinking that's a bug that we should fix.
> > IOW, I was thinking that, in v13, both connection and disconnection delays
> > should be measured whether -C is specified or not, *per spec*.
> > But, in v13, the disconnection delays are not measured in the cases
> > where -C is specified and not specified. So I was thinking that this is
> > a bug and we should fix those both cases.
> >
> > But you're thinking that, in v13, the disconnection delays don't need to
> > be measured because they are not measured for now?
>
> Please let me clarify my thought.

Thank you for your clarification.

>
> In master and v14,
>
> # Expected behavior
> (1) Both connection and disconnection delays should be measured
> only when -C is specified, but not otherwise.
> (2) When -C is specified, since each transaction establishes and closes
> a connection, those delays should be measured for each transaction.
>
> # Current behavior
> (1) Connection delay is measured whether -C is specified or not.
> (2) Even when -C is specified, disconnection delay is NOT measured
> at the end of transaction.
>
> # What the patch should do
> (1) Make pgbench skip measuring connection and disconnection delays
> if not necessary (i.e., -C is not specified).
> (2) Make pgbench measure the disconnection delays whenever
> the connection is closed at the end of transaction, when -C is specified.

I agree with you. This is what the patch for pg14 does. We don't need to measure
disconnection delay when -C is not specified because the output just reports
"initial connection time".

> In v13 or before,
>
> # Expected behavior
> (1) Both connection and disconnection delays should be measured
> whether -C is specified or not. Because information about those delays
> is used for the benchmark result report.
> (2) When -C is specified, since each transaction establishes and closes
> a connection, those delays should be measured for each transaction.
>
> # Current behavior
> (1)(2) Disconnection delay is NOT measured whether -C is specified or not.
>
> # What the patch should do
> (1)(2) Make pgbench measure the disconnection delays whenever
> the connection is closed at the end of transaction (for -C case)
> and the end of thread (for NOT -C case).

Ok. That makes sense. The output reports "including connections establishing"
and "excluding connections establishing" regardless with -C, so we should
measure delays in the same way.

I updated the patch for pg13 to measure disconnection delay when -C is not
specified. I attached the updated patch for pg13 as well as one for pg14
which is same as attached before.

>
> Anyway, I changed the status of this patch to "Waiting on Author" in CF.

I returned the status to "Ready for Committer".
Could you please review this?

Regards,
Yugo Nagata

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-08-26 03:19:56 Re: row filtering for logical replication
Previous Message Amit Kapila 2021-08-26 03:06:24 Re: Failure of subscription tests with topminnow