pgpool: Remove unused track_table_mutation statistics counters.

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Remove unused track_table_mutation statistics counters.
Date: 2026-09-30 02:20:28
Message-ID: E1xBjvo-0000000DvYb-2ro8@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

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(at)tailorbrands(dot)com>
Reviewed-by: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Discussion: https://www.postgresql.org/message-id/CACeKOO1v6%2BKiK-qns_37zCz7YYxJ6Zi_xKaLAuQcjkYQcjQu2Q%40mail.gmail.com
Backpatch-through: master only

Branch
------
master

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

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(-)

Browse pgpool-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-10-01 11:16:27 pgpool: Fix lifecheck buffer overrun.
Previous Message Tatsuo Ishii 2026-09-29 10:57:21 pgpool: Reject negative read length in pool_read2.