pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal
Date: 2022-09-19 13:16:17
Message-ID: CALj2ACVyWceviH4T-SLDVG4CmYpV9DAaWoyDKmWZXLiHRF5Qjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I added xlogreader cache stats (hits/misses) to pg_stat_wal in
ReadPageInternal() for some of my work and ran some tests with logical
replication subscribers. I had expected that the new stats generated
by walsenders serving the subscribers would be accumulated and shown
via pg_stat_wal view in another session, but that didn't happen. Upon
looking around, I thought adding
pgstat_flush_wal()/pgstat_report_wal() around proc_exit() in
walsener.c might work, but that didn't help either. Can anyone please
let me know why the stats that I added aren't shown via pg_stat_wal
view despite the walsender doing pgstat_initialize() ->
pgstat_init_wal()? Am I missing something?

I'm attaching here with the patch that I was using.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Add-xlogreader-cache-stats.patch application/x-patch 6.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-09-19 13:32:14 Re: cataloguing NOT NULL constraints
Previous Message Bharath Rupireddy 2022-09-19 12:56:34 Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)