Re: xact_rollback spikes when logical walsender exits

From: Mircea Cadariu <cadariu(dot)mircea(at)gmail(dot)com>
To: Nikolay Samokhvalov <nik(at)postgres(dot)ai>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Rafael Thofehrn Castro <rafaelthca(at)gmail(dot)com>
Subject: Re: xact_rollback spikes when logical walsender exits
Date: 2026-09-08 07:54:05
Message-ID: 591163e7-7e74-4c30-beb2-45bddcb9a90e@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2026-09-08 08:01:29 Re: Revert RI fast-path batching from REL_19_STABLE
Previous Message Fujii Masao 2026-09-08 07:52:14 Re: Stabilize 026_overwrite_contrecord test