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

From: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 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-02 00:03:04
Message-ID: CAN12+YJO5Dd4cXG9T2Phw5-28y=VUsM6ZtsJiMN1q9Ga3eNY+Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > This change is most likely isn't intentional?
>
> Not intentional. I am looking...

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.

--
Sami

Attachment Content-Type Size
v24-0003-pgstat-Move-pending-index-and-function-counts-in.patch application/octet-stream 10.0 KB
v24-0006-pgstat-Make-in-transaction-flushes-of-pending-st.patch application/octet-stream 13.8 KB
v24-0002-pgstat-Add-xact_boundary-to-flush-callbacks-and-.patch application/octet-stream 23.6 KB
v24-0005-test_custom_stats-Show-transactional-counters-in.patch application/octet-stream 14.6 KB
v24-0004-pgstat-Allow-pg_stat_force_next_flush-to-work-in.patch application/octet-stream 70.0 KB
v24-0001-pgstat-Track-HOT-and-new-page-updates-per-sub-tr.patch application/octet-stream 5.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajin Cherian 2026-12-02 00:13:41 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
Previous Message Nikolay Samokhvalov 2026-12-01 23:57:37 Re: REPACK (CONCURRENTLY): do not block the table while waiting for the final lock