Re: pgbench bug candidate: negative "initial connection time"

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench bug candidate: negative "initial connection time"
Date: 2021-06-17 09:16:42
Message-ID: 20210617181642.e9b9d9979e6bd3b02fcb3065@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Fabien,

On Thu, 17 Jun 2021 10:37:05 +0200 (CEST)
Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:

> > ). Is this acceptable for you?
>
> I disagree on two counts:
>
> First, thread[0] should not appear.
>
> Second, currently the *only* function to change the client state is
> advanceConnectionState, so it can be checked there and any bug is only
> there. We had issues before when several functions where doing updates,
> and it was a mess to understand what was going on. I really want that it
> stays that way, so I disagree with setting the state to ABORTED from
> threadRun. Moreover I do not see that it brings a feature, so ISTM that it
> is not an actual issue not to do it?

Ok. I gave up to change the state in threadRun. Instead, I changed the
condition at the end of bench, which enables to report abortion due to
socket errors.

+@@ -6480,7 +6490,7 @@ main(int argc, char **argv)
+ #endif /* ENABLE_THREAD_SAFETY */
+
+ for (int j = 0; j < thread->nstate; j++)
+- if (thread->state[j].state == CSTATE_ABORTED)
++ if (thread->state[j].state != CSTATE_FINISHED)
+ exit_code = 2;
+
+ /* aggregate thread level stats */

Does this make sense?

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

Attachment Content-Type Size
pgbench_connect_abort-3.patch text/x-diff 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-06-17 09:20:21 Re: Skipping logical replication transactions on subscriber side
Previous Message Masahiko Sawada 2021-06-17 09:14:20 Re: Teaching users how they can get the most out of HOT in Postgres 14