pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mircea Cadariu <cadariu.mircea@gmail.com>
To: Nikolay Samokhvalov <nik@postgres.ai>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Cc: Rafael Thofehrn Castro <rafaelthca@gmail.com>
Subject: Re: xact_rollback spikes when logical walsender exits
Date: Tue, 8 Sep 2026 09:54:05 +0200
Message-ID: <591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com> (raw)
In-Reply-To: <CAM527d8Evz3BCffJeL=1RJi-7jjPYbKz_ZoUxm2Go2i-_N+g6w@mail.gmail.com>
References: <CAM527d_EbU5Li4a5FdKQjYsdF-4Lqr_i3jXmZOm7Wbb=Q2KzTw@mail.gmail.com>
	<CAHGQGwFDv6=Dcbf1YbGH5S7y-M4ar4-zC-c1GWco_Cn_SE0c7w@mail.gmail.com>
	<CAM527d8Evz3BCffJeL=1RJi-7jjPYbKz_ZoUxm2Go2i-_N+g6w@mail.gmail.com>

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

view thread (8+ messages)  latest in thread

Message-ID: <591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com>
Permalink:  ../591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com/
Also on:    postgresql.org/message-id/591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: cadariu.mircea@gmail.com, nik@postgres.ai, masao.fujii@gmail.com, pgsql-hackers@lists.postgresql.org, rafaelthca@gmail.com
  Subject: Re: xact_rollback spikes when logical walsender exits
  In-Reply-To: <591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox