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 1wa6CC-001Wrr-10 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 06:25:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wa6CA-009zrq-34 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 06:25:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wa6CA-009zri-1p for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 06:25:46 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wa6C7-000000012ww-3jy7 for pgsql-hackers@postgresql.org; Thu, 18 Jun 2026 06:25:45 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-36b9033d230so314346a91.1 for ; Wed, 17 Jun 2026 23:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781763941; x=1782368741; darn=postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=ZTsKsNb84hrHq7oGxhlYGKC18m89wssmBzXCxci8fos=; b=Or7HitWFqs1VVoD02Ya7KmMb6sPCsFn76bDZFwnaal9iUHYF9QeKX6FNgjfonaodvx zrvcUWomZIQihnYQKt69JLWsLf7zXONwDxHCgeEwg2wskNb62OTYLcBXXOS9YBP5n1nS a8xdkk6Xd7NG2pCZhxf11dcRH4AVguH1mSE5z2eEa+po5FUskB7upEeGNNvLmuLyY+kl cczNtmuDy2bOULZUtf1HLrc8+TW2fv65dPkXvmfZwKx0/ezIuwrMOsrfZqSJJO82XL8E SwTXWFyiUw1qNPwV9BjyFKjQINYwABXD8H25XTMKFINGt34lkl5UIT9aTus/EnhMPV17 20RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781763941; x=1782368741; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZTsKsNb84hrHq7oGxhlYGKC18m89wssmBzXCxci8fos=; b=lWBctBZmy2vRhEnpG5JntrxjeTNqCcM5IDaBRjcQhTQokQ1m4yTGcvDFDahF0JNPGR Hwcw/0L6xfvaFnLsweSNa7opBS0mwpOq5jtegPtVMcP1uRPZh3kH3ypueHVFJ4yyczV+ xz9CtcpWZ3f1+H80Eav2YaRPD1QuR1E2u6TeNXkEf4cDfjFR/U8yfAXOF0Lc58J/3Nmc KlsxwqY7N/btV4WZVCxw+DSQp5ZT8G3d9QrOZAmLQjNOhcYuQhr/5yU/tvUOCNh06z1h hd+ZljSL584ForPbG7LuNrbKYJS1twWtO3WYladUcBQ/qKU3IQ3pMnb5CcPJqeMdoOdJ Z1Jg== X-Gm-Message-State: AOJu0YyNVcALFbD/o0qqx/fMZsGKbIM1edI1K0/N819qqU86lGrRrObz LSB3RKmpv1FlydI2wIuj4q5Npiuom4SibQrWlav5/vbZMyqJoM1rjmYw X-Gm-Gg: AfdE7ck961lr1lsCVF1hNYJZ2SWHp+f1ckiJq6Z/Ay6Wj8tVDdSHXE/89RFkigVpPf0 lQEYyF5Q+JWPfyQjaRZn8Rpr6ELZ6nseGF467umRKNIO2k5rgP/PwJOSgWa/xIdTf+Fdt8DQGF0 XJ5tEOInR37AyaXfGb3DUVjpCqTkhP/+J90126Vd9a6DLtAHPFGQWeDeAnVfmLNzY48pXNgI5aR QjxTtQHoLwSJSUFoDttyaycAPrm3Buh3MCH5NUaJi7aDtTMAHFwPZplTZQWAxm6DT+AtQJ+ERAW qGZ8Iwy48YwH/fVjEXT1Kr8ERoczo9+tXT3EtkFLfygiI3QyIckjq4m+aRBtP47lMNXQzlEIUAp Pbecpn2JIeABQU7I1RZwM3kDkCosgFIB8ZVsjNE4JtKM3gdPvv3EN7lapfiZlFfoD0LAjeJHGRP wI6keiAV9MCObha+uHrtWE2g== X-Received: by 2002:a17:90b:2ecb:b0:36b:9798:4f68 with SMTP id 98e67ed59e1d1-37cdbdb8e21mr2142519a91.9.1781763941127; Wed, 17 Jun 2026 23:25:41 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.161]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-37c5b377e43sm6898522a91.10.2026.06.17.23.25.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2026 23:25:40 -0700 (PDT) From: Chao Li Message-Id: <958C5B66-50B0-47C8-BBA5-7D32F7A09566@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_71BBEBC3-E186-4597-86EB-03BF8B21D0D3" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: pgbench --continue-on-error: clarify TPS and failure reporting Date: Thu, 18 Jun 2026 14:25:03 +0800 In-Reply-To: <20260618143631.25c2ed34b1d7527ee2d92a17@sraoss.co.jp> Cc: PostgreSQL-development , Fujii Masao , Rintaro Ikeda To: Yugo Nagata References: <597C9755-4386-488D-A289-16D50AD81FBF@gmail.com> <20260618143631.25c2ed34b1d7527ee2d92a17@sraoss.co.jp> X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_71BBEBC3-E186-4597-86EB-03BF8B21D0D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 18, 2026, at 13:36, Yugo Nagata wrote: >=20 > On Thu, 18 Jun 2026 11:24:04 +0800 > Chao Li wrote: >=20 >> Hi >>=20 >> While testing =E2=80=9C[0ab208fa5] pgbench: Add --continue-on-error = option=E2=80=9D, I got a question about the doc: >> ``` >> >> 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. >> >> ``` >>=20 >> The phrase =E2=80=9Cmeasure performance including those failures=E2=80=9D= gives the impression that failed transactions might be counted in TPS, = but they are not. >=20 > I agree with your point. The original phrasing "including those = failures" is > indeed=E3=80=80ambiguous and could mislead users into thinking failed = transactions are > included in the TPS calculation. >=20 >> In my test, all transactions failed, and TPS was reported as 0: >> ``` >> % pgbench -d evantest -n -t 5 --continue-on-error = --failures-detailed -f pgbench-coe.sql >> pgbench (19beta1) >> transaction type: pgbench-coe.sql >> scaling factor: 1 >> query mode: simple >> number of clients: 1 >> number of threads: 1 >> maximum number of tries: 1 >> number of transactions per client: 5 >> number of transactions actually processed: 0/5 >> number of failed transactions: 5 (100.000%) >> number of serialization failures: 0 (0.000%) >> number of deadlock failures: 0 (0.000%) >> number of other failures: 5 (100.000%) >> latency average =3D 0.389 ms (including failures) >> initial connection time =3D 4.172 ms >> tps =3D 0.000000 (without initial connection time) >> ``` >>=20 >> If this behavior is intended, I wonder if we should clarify the TPS = counting logic more explicitly. For example: >> ``` >> >> This option is useful when your custom script may raise errors >> such as unique constraint violations, but you want the = benchmark >> to continue despite individual statement failures. Failed = transactions >> are reported separately and included in latency statistics, = but are not >> counted as transactions actually processed for TPS. >> >> ``` >=20 > Your proposed documentation change is much clearer and accurately = reflects > the actual behavior. I prefer this version as well. >=20 > Regards, > Yugo Nagata >=20 > --=20 > Yugo Nagata 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 well. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_71BBEBC3-E186-4597-86EB-03BF8B21D0D3 Content-Disposition: attachment; filename=v1-0001-doc-Clarify-pgbench-reporting-with-continue-on-er.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v1-0001-doc-Clarify-pgbench-reporting-with-continue-on-er.patch" Content-Transfer-Encoding: quoted-printable =46rom=20abf245787746ffa7f696298d22101b4e0226f711=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Chao=20Li=20(Evan)"=20=0A= Date:=20Thu,=2018=20Jun=202026=2014:21:13=20+0800=0ASubject:=20[PATCH=20= v1]=20doc:=20Clarify=20pgbench=20reporting=20with=20--continue-on-error=0A= =0AClarify=20that=20transactions=20failed=20under=20--continue-on-error=20= are=20reported=0Aseparately=20and=20are=20not=20counted=20as=20= transactions=20actually=20processed=20or=20in=0ATPS.=20Also=20adjust=20= the=20latency=20description=20to=20avoid=20implying=20that=20failed=0A= transactions=20are=20generally=20included=20in=20latency=20measurements.=0A= =0AAuthor:=20Chao=20Li=20=0AReviewed-by:=20Yugo=20Nagata=20= =0ADiscussion:=20= https://postgr.es/m/597C9755-4386-488D-A289-16D50AD81FBF@gmail.com=0A---=0A= =20doc/src/sgml/ref/pgbench.sgml=20|=2012=20++++++++----=0A=201=20file=20= changed,=208=20insertions(+),=204=20deletions(-)=0A=0Adiff=20--git=20= a/doc/src/sgml/ref/pgbench.sgml=20b/doc/src/sgml/ref/pgbench.sgml=0A= index=202e401d1ceb8..abdb1df6c89=20100644=0A---=20= a/doc/src/sgml/ref/pgbench.sgml=0A+++=20b/doc/src/sgml/ref/pgbench.sgml=0A= @@=20-770,10=20+770,13=20@@=20pgbench=20=20= options=20=20d=0A=20=20= =20=20=20=20=20=20=20the=20connection=20to=20fail.=0A=20=20=20=20=20=20=20= =20=20See=20=20for=20more=20= information.=0A=20=20=20=20=20=20=20=20=0A+=0A=20=20=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20=20=20This=20option=20is=20useful=20= when=20your=20custom=20script=20may=20raise=20errors=0A=20=20=20=20=20=20= =20=20=20such=20as=20unique=20constraint=20violations,=20but=20you=20= want=20the=20benchmark=0A-=20=20=20=20=20=20=20=20to=20continue=20and=20= measure=20performance=20including=20those=20failures.=0A+=20=20=20=20=20=20= =20=20to=20continue=20despite=20individual=20statement=20failures.=20=20= Failed=0A+=20=20=20=20=20=20=20=20transactions=20are=20reported=20= separately,=20but=20are=20not=20counted=20as=0A+=20=20=20=20=20=20=20=20= transactions=20actually=20processed,=20nor=20are=20they=20included=20in=20= TPS.=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20= =0A=20=20=20=20=20=20=0A@@=20-2933,9=20= +2936,10=20@@=20statement=20latencies=20in=20milliseconds,=20failures=20= and=20retries:=0A=20=0A=20=20=20=0A=20=20=20=20The=20latency=20of=20= a=20successful=20transaction=20includes=20the=20entire=20time=20of=0A-=20= =20=20transaction=20execution=20with=20rollbacks=20and=20retries.=20The=20= latency=20is=20measured=0A-=20=20=20only=20for=20successful=20= transactions=20and=20commands=20but=20not=20for=20failed=20transactions=0A= -=20=20=20or=20commands.=0A+=20=20=20transaction=20execution=20with=20= rollbacks=20and=20retries.=20=20The=20latency=20is=20measured=0A+=20=20=20= only=20for=20successful=20transactions=20and=20commands,=20except=20that=20= failed=0A+=20=20=20transactions=20are=20included=20in=20the=20simple=20= average=20latency=20when=20the=0A+=20=20=20= =20option=20is=20used.=0A=20=20=20= =0A=20=0A=20=20=20=0A--=20=0A2.50.1=20(Apple=20Git-155)=0A=0A= --Apple-Mail=_71BBEBC3-E186-4597-86EB-03BF8B21D0D3--