Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6j8-000184-0b for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:36:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wi6j5-00Gtgw-2h for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 08:36:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi6j5-00Gtgc-1R for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 08:36:52 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wi6j3-000000000Ht-3IJA for pgsql-hackers@postgresql.org; Fri, 10 Jul 2026 08:36:51 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-c15c7d22070so99568566b.2 for ; Fri, 10 Jul 2026 01:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783672606; cv=none; d=google.com; s=arc-20260327; b=aS63iTjKtLuWQ1weSgfOtTq1oqfmZtYswaBlCXfp2ZbF14A9sV6OUdBXv/HzTKULZH 3v+TM1LPGH5MRXDSrXaxxcwiPJtKMmoX3HBV8QqnVZ1jAfvjKFurKOe8u+Arc7CIS5SZ DXthoaveL+wO1wQHERnM6hOdzQHlmEh59XutFcSPpypzHLGwT9ilGwGYYO5mYPjP51YQ uaVSqDzf5EMlNRlCIaTl7r23iHv6xd8lP1gXHe/pN2i6Sm8VPOK8UpyDpl3QVYwhQNe/ lGSEQJITLD3wD7lhCRPCUoffG1Xsnv2KHT3fY2uLmiRLHXTwBo7MhFBZ5mkcOWPICoeH FmKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=P3MJrow0YburwDNrcBN0j6uSKoBEVQNbhh0onIwyqLM=; fh=S93wrXv9JMDdUCHuVI6cjQfhDHzAAXDuYcBbN+H9PP0=; b=mV12yy4/j+Q/tBJ1W0VYL/qeUMasduudOpfp3WGeMWgAJjQwtfFlSwUzXdygnBtR4r z0okG45Zsy78KQR2GsIOyU0DW7aImIyQ15peM7VyUJkNwzAE9CN+GqynS9pX3cnEeaxx hl1MqCon1dqOiAwndCsNfCuw7hFvneAdNWQi1XKAMPYqdsXryENgmAu2dwlFItzlYLAJ u6IJkrNIsjfwbOisU+IO5LNGqcsKjqROu3vGO7RbsFfVfixV5b4vTaNhNiCi7x0XBXqJ MlwATxKY4WqaXKm0FKob+8eXS7I5b9r01Y52xlq4bi31ANDNt/4Zli3+sFWfdsJLP/gx JiVQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783672606; x=1784277406; darn=postgresql.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=P3MJrow0YburwDNrcBN0j6uSKoBEVQNbhh0onIwyqLM=; b=GhCrLz+OrmIUR5suM/zsf9TGFC4tEeUTnNOkk8fqC4DTA0e49pHyn7lq125JF/0GhW g+JiBq1Eg7W1cTWoeRytHQhm0S1h6DtqKi0N7W8xGOxAYo9Ew1IjvmuOa+vky6BwanEI yavmXgHCVAMcCgMwXX4gYHStiSQR2TXzf6RrY21mVSMRd4ZFVy2DdGm9D98Pizo7uDoY 080vvxyt/pmD6qzJMzLrSzQBuo3UgfS1L+IjIKIwKbN6NN7WmYK1pTLOCleng7brWvPV Uw5QpKatB/wqJVpQFiLjPhUci2zOqfOb2m2QGcea1+Uqg9cLkfQXJU1U5kU6yxMIogzA zMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783672606; x=1784277406; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=P3MJrow0YburwDNrcBN0j6uSKoBEVQNbhh0onIwyqLM=; b=PrvkelyJhXpqI3fiN8amUO19XdncK2TPwhR+wtOdW5+FwKgdtF14o+RjtvHTkmaTqx jlgL+EZ9RVEZpOHjcqB/8r+pbolkeA+WZ5ATRb5M7+OIqz2ClOuAEykryGwxk1X+rEZX eUZuahi4Q6RliypaZKKlPtCba+0vRqpkrgk6LFqcfbMdK+i/dVUoPIZt7O6yE8ub9t/y 4vhF1OpEG3qkigLcjO9ljEPPlPfP73pAWyGFsUCGwOoq59ozaSmcypyqrYQ92vPrW+om 9s/KxWBFCJSnuqNc8PbCQTrsk919ULaZVdPMcQMxwPtEI9BAJ0ZYYF2SHCd+Hac8H0jE Laow== X-Forwarded-Encrypted: i=1; AHgh+RoMt2uvYvBjTYkO7j7gLaX++0MRxFDsuoZy2DPffs/LenAoqnP03FYDOhBZnuI/3otCW3CBrJaPJx4GOJMm@postgresql.org X-Gm-Message-State: AOJu0YxtZq+hIICc3RGf/5I5UlLexHy2q2IaaWvgS//oZ2JwBl1n2z8s 4jirV1jlJWhtbTjgHbF2D0gfH6XojD7Efe2bkYLPps7548P8nxLzPrJQrPnuBBArxE9i/yWxdJE UNbGlN1M7G/0ahBg5raSTRY7ghe9qkVc= X-Gm-Gg: AfdE7ckZP8xfEKwaZlgyl+vvMQtsWRrkqsqu0MFZcepejQnIYX+F40sFz3EQtjZv2sv Kbure78lHnGuBZT5nQLIOxmHwSNan2ZTbKUhyH03A6bqMPnXvyvKAbiDlRdvHb1YQ/6MDP/GyrL OwQ26GEtCi5EMoEsglEbMF0LEw/vNx5JgS7DlaooITKpTbIOlsr67kYrJjSSSAumP9RWhnwFYfg cSG3t9Py97KJGU6/MLEy140UI1Z85/wZnzsrpNk2Kh3g6WGQc/EihVx8PszZ9PxLewOwcGIDu4P R4P7GXo04a+k0SYuiKf2XPQbroZquWhg4FEldJHzZib69PbpWa+D/luzkkfTbpd6T/Y9nw== X-Received: by 2002:a17:907:a04:b0:c10:256:3d6a with SMTP id a640c23a62f3a-c15ce0f9226mr409288566b.31.1783672605979; Fri, 10 Jul 2026 01:36:45 -0700 (PDT) MIME-Version: 1.0 References: <597C9755-4386-488D-A289-16D50AD81FBF@gmail.com> <20260618143631.25c2ed34b1d7527ee2d92a17@sraoss.co.jp> <958C5B66-50B0-47C8-BBA5-7D32F7A09566@gmail.com> <09361838-9213-4961-95A5-A0CD4AABF2DD@gmail.com> In-Reply-To: From: Xuneng Zhou Date: Fri, 10 Jul 2026 16:36:33 +0800 X-Gm-Features: AUfX_mzedCVZ3wxZ3KcqhVRoUKkzCuWhUdUHL9TsmV4ErO5rWb96hS4Zfqt4jj0 Message-ID: Subject: Re: pgbench --continue-on-error: clarify TPS and failure reporting To: Chao Li Cc: Fujii Masao , Yugo Nagata , PostgreSQL-development , Rintaro Ikeda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Evan, On Mon, Jun 22, 2026 at 4:11=E2=80=AFPM Chao Li wr= ote: > > > > > On Jun 18, 2026, at 20:45, Chao Li wrote: > > > > > > > >> On Jun 18, 2026, at 17:40, Fujii Masao wrote: > >> > >> On Thu, Jun 18, 2026 at 3:25=E2=80=AFPM Chao Li wrote: > >>> Thanks for confirming the doc issue. The here comes a small doc patch= . > >>> > >>> I also noticed there is a later paragraph about =E2=80=9Clatency=E2= =80=9D that also needs an update, it=E2=80=99s included in the patch as wel= l. > >> > >> Thanks for the patch! The TPS-related changes look good to me. > >> > >> The latency of a successful transaction includes the entire time of > >> - transaction execution with rollbacks and retries. The latency is m= easured > >> - only for successful transactions and commands but not for failed > >> transactions > >> - or commands. > >> + transaction execution with rollbacks and retries. The latency is = measured > >> + only for successful transactions and commands, except that failed > >> + transactions are included in the simple average latency when the > >> + option is used. > >> > >> It doesn't seem that the behavior of the latency average in the main > >> report depends on --continue-on-error itself. Instead, when neither > >> --progress, --rate, nor --latency-limit is specified, the main > >> report shows a simple latency average computed as the total benchmark > >> duration divided by the number of successful and failed transactions, > >> so failed transactions are included. > >> > >> On the other hand, when any of those options is specified, the > >> latency average and latency stddev in the main report are based > >> only on successful transactions. Likewise, the per-script and > >> per-command latency statistics are measured only for successful > >> transactions and commands. > >> > >> So how about something like this instead? > >> > >> ------------------------------- > >> > >> The latency of a successful transaction includes the entire time of > >> - transaction execution with rollbacks and retries. The simple > >> - latency average shown in the main report is com= puted from > >> - the total benchmark duration divided by both successful and failed > >> - transactions, and therefore includes failed transactions. In contr= ast, > >> - detailed latency statistics, including the per-script and per-comm= and > >> - reports, are measured only for successful transactions and command= s, not > >> - for failed transactions or commands. > >> + transaction execution with rollbacks and retries. In the main repo= rt, when > >> + neither , , nor > >> + is specified, the > >> + latency average is computed from the total benc= hmark > >> + duration divided by both successful and failed transactions, and t= herefore > >> + includes failed transactions. Otherwise, the latency > >> average > >> + and latency stddev shown in the main report are= measured > >> + only for successful transactions. Detailed latency statistics, inc= luding > >> + the per-script and per-command reports, are also measured only for > >> + successful transactions and commands, not for failed transactions = or > >> + commands. > >> > >> ------------------------------- > >> > > > > I feel that might be too detailed. Listing these three option names her= e could make the doc harder to read and maintain. When failures are include= d, the output line already says so explicitly: > > ``` > > latency average =3D 0.387 ms (including failures) > > ``` > > > > Can we simply say something like this? > > ``` > > > > The latency of a successful transaction includes the entire time of > > transaction execution with rollbacks and retries. The latency is mea= sured > > only for successful transactions and commands, not for failed transac= tions > > or commands, unless the report explicitly says that it includes failu= res. > > > > ``` > > > > Best regards, > > -- > > Chao Li (Evan) > > HighGo Software Co., Ltd. > > https://www.highgo.com/ > > Thinking it over, I came up with a version that combines Fujii-san=E2=80= =99s suggestion and my previous version: > ``` > > The latency of a successful transaction includes the entire time of > transaction execution with rollbacks and retries. In the main report, > when none of , , and > is specified, latency averag= e > is computed from both successful and failed transactions. In such cas= es, > this is explicitly indicated by (including failures). > Other latency statistics, including the per-script and per-command rep= orts, > are measured only for successful transactions and commands, not for fa= iled > transactions or commands. > > ``` This option is useful when your custom script may raise errors such as unique constraint violations, but you want the benchmark - to continue and measure performance including those failures. + to continue despite individual statement failures. Failed + transactions are reported separately, but are not counted as + transactions actually processed, nor are they included in TPS. "Nor are they included in TPS" seems misleading to me. Failed transactions do not enter the TPS accumulator, but their execution time remains in bench_duration, so they can reduce the overall TPS. tps =3D total->cnt / bench_duration; --=20 Regards, Xuneng Zhou HighGo Software Co., Ltd.