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 1x3qei-006htw-0x for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Sep 2026 07:54:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x3qeh-005aAL-0t for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Sep 2026 07:54:11 +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 1x3qeg-005aAD-2v for pgsql-hackers@lists.postgresql.org; Tue, 08 Sep 2026 07:54:10 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x3qee-00000003XbF-2gce for pgsql-hackers@lists.postgresql.org; Tue, 08 Sep 2026 07:54:10 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-4858595f997so2597429f8f.1 for ; Tue, 08 Sep 2026 00:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788854047; x=1789458847; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=4ESHv88LqPcehBQSUSiYJmGoZeIJ4+dXQgnLw5lzJPs=; b=T2aVciWEO2VWIeVL8pD+dtUREz7t7iiXiMXPFP7HXcPrOrOvsD7F81vTI0Jw4KrtAZ xxy3lPYk1YKBj3bhi1npxOQLuvQkR0+dwdtcHNOlxS8mUyjbJuuT7Sh8jNwVQzVNs80H WlrEjlUV4VJWWM0UyO858LuXjXVO0tGHzMCOjWvlsls2kyNbI0Aspa9rUYEXH0GLQlGS cSaNd9MOdMg/x7bvbaiuwACBzNcj6xgchSJHa6qsGB7iqwaFlYrlVUIZw8BHcCsEPDJn G4ztWP6pGKI2L6xa6xr/KTEU8GzeGWhfbxpTqAhcKZYfoC3k0MPRXacmgV5nUYLyWEij LqXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788854047; x=1789458847; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4ESHv88LqPcehBQSUSiYJmGoZeIJ4+dXQgnLw5lzJPs=; b=oj9BlzCAfHo7nkUGbW+hHpvz976nTxOzf54QVay2gUkNecjhamOqbHMfCSmBJhSUze d7tC/fxjEkudLvUCYB5kzpWHkbvbpI3yMnX2bDjaYWQqnM8HFPgVrGjSJ9OWiEz6Xkyd upNLaAwrgsxM2bunsAwPucM+pA6LHCk4rCD8jywPatRU2Nerg+z9rdxYNcjm1lkdYHkt M9gnzowKtt2QJZVYBvF30lrnYmzBo787PGzQ8Nu7Aq4e/DUi9/Rmk7rkpglxIIH3QnYW PQVm+WDdZa/DYwWknwzeoxn2TdnNd4UBcsXizz9ETpCkYOAxXGDUogm1cXZqFc32Kgv4 TTZw== X-Gm-Message-State: AFuF++mEjTh3A+QL4BpwGBlm7PUF1BbS7wo4EwRy6MQiJEZU/W8Ff88Y CDwTCfrCzqIatMpvT6S8LURwfCepA4u5gLvs3t0r6JwBk0VdTIPaVdbH X-Gm-Gg: AYBFou0lSF/nkssKmN/S1irN4vfMRAdIQUB3Z4ZVPHNrcxyWSZFtTZe+XSbKbsMQLhw Kiq5Fl0gZEjeODcwV5LO3aR/KV8M2m0EkrfixE98yWotQz2leRExoJi20ehNP2ockmu+NJoT7vD IFY55+phdLli+OUaYi8pwhp1DHvideeW3RwXeai1D6KE4pD3oA9UkDdPUKEAizT9ALodYU7jQYq o2cWvwLe02zMx5cK56ygXr2cG98GEbkpu5gl6lCBa4Beofu5LbS18FxSVRrfsCxXfXcLRZGPQcq s8nIsRh+H+pf3t+E7ePGSSg8gjhULopo23isBVIjhYEuRO8g9lt+faT+cqKFWuInvkAhh5A22OP 9c1TiqVDdYBg/OqYeAFK6rUsNP2j2cC0YRZVWviUs/igl22hYz4TXUjWcpvMKulSlzPK7XfJEEO P2mucgE8s73XxrT4RGBa5DHVyAvSRCuQBzfAf8n1272BI8uRZnuVNPz0WTvY9TA1A3xEkpt0w6y Sogg0CbmiQeD81n/mKK2arYSjjx+up/f+HnGGwqgg== X-Received: by 2002:a05:6000:707:b0:485:8542:fee3 with SMTP id ffacd0b85a97d-4858708cab5mr60586012f8f.16.1788854047449; Tue, 08 Sep 2026 00:54:07 -0700 (PDT) Received: from [172.30.40.76] ([77.227.86.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-485958f1493sm22940931f8f.37.2026.09.08.00.54.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2026 00:54:06 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------iKeGHL6wV8FoO0450EGV77UK" Message-ID: <591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com> Date: Tue, 8 Sep 2026 09:54:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: xact_rollback spikes when logical walsender exits To: Nikolay Samokhvalov , Fujii Masao Cc: pgsql-hackers , Rafael Thofehrn Castro References: Content-Language: en-GB From: Mircea Cadariu In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------iKeGHL6wV8FoO0450EGV77UK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 08/07/2026 19:37, Nikolay Samokhvalov wrote: > Concretely, I propose splitting: > > 1) 0001 (v3, attached): narrow fix for the walsender miscount, > intended as a back-patchable bug fix -- this is what's paging people > in production today. Rebased on current master; the TAP test now > also verifies that xact_commit does not change as a function of > decoded transactions (walsender shutdown has a small fixed > bookkeeping delta, handled via a control run). > > 2) 0002 (attached, draft): master-only implementation of option 3 -- > count xact_commit/xact_rollback only for regular client backends -- > plus a doc change defining both columns explicitly. It also removes > the now-redundant parallel argument from AtEOXact_PgStat() and > AtEOXact_PgStat_Database(), since parallel workers are background > workers and are excluded by the backend-type check. 0002 has no test > yet; if the definition is agreed on, I'll extend the new TAP test to > cover the autovacuum/walsender exclusion. Thanks for submitting the v3 patch, I had a look. The patch applies cleanly on master. As experiment I added the tests only from 0001 and as expected they failed, but with the patch applied they pass. So far so good. While the approach in 0001 could be considered a bit "action at a distance" approach, a suitable structural solution is in 0002. I agree with starting to count xact_commit/xact_rollback only for regular client backends. TBH I expected it works this way already. Indeed, 0002 needs tests. I'll set it to Ready for Committer and am volunteering for adding the tests or any other aspect I can help with to progress this patch. -- Thanks, Mircea Cadariu --------------iKeGHL6wV8FoO0450EGV77UK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, 

On 08/07/2026 19:37, Nikolay Samokhvalov wrote:
Concretely, I propose splitting:

1) 0001 (v3, attached): narrow fix for the walsender miscount,
intended as a back-patchable bug fix -- this is what's paging people
in production today. Rebased on current master; the TAP test now
also verifies that xact_commit does not change as a function of
decoded transactions (walsender shutdown has a small fixed
bookkeeping delta, handled via a control run).

2) 0002 (attached, draft): master-only implementation of option 3 --
count xact_commit/xact_rollback only for regular client backends --
plus a doc change defining both columns explicitly. It also removes
the now-redundant parallel argument from AtEOXact_PgStat() and
AtEOXact_PgStat_Database(), since parallel workers are background
workers and are excluded by the backend-type check. 0002 has no test
yet; if the definition is agreed on, I'll extend the new TAP test to
cover the autovacuum/walsender exclusion.

Thanks for submitting the v3 patch, I had a look. 

The patch applies cleanly on master. As experiment I added the tests only from 0001 and as expected they failed, but with the patch applied they pass. So far so good. 

While the approach in 0001 could be considered a bit "action at a distance" approach, a suitable structural solution is in 0002. 

I agree with starting to count xact_commit/xact_rollback only for regular client backends. TBH I expected it works this way already. Indeed, 0002 needs tests. 

I'll set it to Ready for Committer and am volunteering for adding the tests or any other aspect I can help with to progress this patch. 

-- 
Thanks,
Mircea Cadariu
--------------iKeGHL6wV8FoO0450EGV77UK--