pg.ddx.io  pgpool-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tatsuo Ishii <ishii@postgresql.org>
To: pgpool-committers@lists.postgresql.org
Subject: pgpool: Remove unused track_table_mutation statistics counters.
Date: Wed, 30 Sep 2026 02:20:28 +0000
Message-ID: <E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org> (raw)

Remove unused track_table_mutation statistics counters.

TrackTableMutationState carried three counters -- stats_queries_checked,
stats_forced_primary and stats_allowed_replica -- that were initialized and
incremented but never read.  Nothing in the tree consumes them: there is no
SHOW command, reporting view or pcp command that exposes them, and the
pool_track_table_mutation_get_stats() accessor that would have done so was
removed before the feature was committed.

Maintaining them was not free.  pool_track_table_mutation_table_is_stale()
released the table map semaphore after the lookup and then re-acquired it
solely to bump these counters, so every staleness check on every
load-balanceable SELECT paid a second trip through the semaphore to update
state no one could observe.  Dropping the counters removes that critical
section entirely and lets the table_oid/dboid sanity check return directly
instead of jumping to a shared epilogue.

No functional change: the return value of
pool_track_table_mutation_table_is_stale() is unaffected for every input.

If exposing these numbers is wanted, they are better reintroduced together
with a way to read them -- a reporting view or a pcp command -- rather than
accumulated in shared memory with no consumer.

Author: Nadav Shatz <nadav@tailorbrands.com>
Reviewed-by: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://www.postgresql.org/message-id/CACeKOO1v6%2BKiK-qns_37zCz7YYxJ6Zi_xKaLAuQcjkYQcjQu2Q%40mail.g...
Backpatch-through: master only

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=91c85223dce3718cc321b582802e9c39f8b0a...

Modified Files
--------------
src/include/utils/pool_track_table_mutation.h |  3 ---
src/utils/pool_track_table_mutation.c         | 24 +-----------------------
2 files changed, 1 insertion(+), 26 deletions(-)



Message-ID: <E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org>
Permalink:  ../E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org/
Also on:    postgresql.org/message-id/E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgpool-committers@postgresql.org
  Cc: ishii@postgresql.org
  Subject: Re: pgpool: Remove unused track_table_mutation statistics counters.
  In-Reply-To: <E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org>
  References: <E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org>

* 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