Re: pgstat: Flush some statistics within running transactions, take 2

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Lukas Fittl <lukas(at)fittl(dot)com>
Subject: Re: pgstat: Flush some statistics within running transactions, take 2
Date: 2026-12-04 05:01:40
Message-ID: axJJNCBrdygieKDv@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 01, 2026 at 06:03:04PM -0600, Sami Imseih wrote:
> Fixed in v24-0006, which added the CFI in the flush loop. A FATAL raised
> there happens between entries, so the shutdown hook now flushes the
> pending stats as usual instead of discarding them. I also added your
> case as an isolation test in stats.spec.

I have spent some time on v24-0001, and adding these two fields sounds
fine here as a start, so done this part.

It's not something that we need to add to the 2PC file, as nothing
(aka autovacuum) care about the availability of this information, so
the change in PostPrepare_PgStat_Relations() was raising my eyebrow
but I can see why you have done so.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2026-12-04 05:04:12 Re: Add a hook for handling logical decoding messages on subscribers.
Previous Message Hayato Kuroda (Fujitsu) 2026-12-04 04:48:48 RE: Table AM callback for logical decoding support (REPACK CONCURRENTLY)