public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tatsuo Ishii <[email protected]>
To: [email protected]
Subject: pgpool: Feature: load balancing control by table tracking.
Date: Sun, 28 Jun 2026 00:55:21 +0000
Message-ID: <[email protected]> (raw)
Feature: load balancing control by table tracking.
Prevent routing of read only queries to standby if replication delay
of tables used in the query exceeds certain amount of value
collected by streaming replication process. To enable this feature,
set disable_load_balance_on_write to dml_adaptive_global.
In this mode, when tables are modified by
INSERT/UPDATE/DELETE/TRUNCATE/MERGE/data modification WITH, for
certain peoriod SELECTs using the tables are not load balanced:
i.e. routed to the primary PostgreSQL server to avoid the data
staleness by replication delay.
Unlike dml_adaptive mode, any table modifications decribed above are
detected even they happn in other sessions (in dml_adaptive, table
modifications are only detected in the same transaction). Note,
however, you cannot use dml_adaptive_object_relationship_list to track
dependency among table and other objects.
Besides dml_adaptive_global, there are some tuning knobs for the
feature:
- track_table_mutation_ttl_factor
Parameter to calculate TTL of each tracking data.
- track_table_mutation_max_staleness
Maximum duration in milliseconds that a single table entry can
continuously force queries to primary.
- track_table_mutation_cold_start_duration
Duration in milliseconds to route all queries to primary after a
child process starts.
- track_table_mutation_table_buckets
Number of hash buckets for the track table mutation hash table.
- track_table_mutation_table_size
Maximum number of tables that can be tracked simultaneously in the
track table mutation.
Author: Nadav Shatz <[email protected]>
Reviewed-by: Tatsuo Ishii <[email protected]>
Japanese-docs-by: Tatsuo Ishii <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/20260407.181009.1762204033074164841.ishii%40postgresql.or...
Branch
------
master
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=243463af09513be0413f52917a1045836f50f...
Author: Nadav Shatz <[email protected]>
Modified Files
--------------
doc.ja/src/sgml/loadbalance.sgml | 274 +++++++
doc/src/sgml/loadbalance.sgml | 327 ++++++++
src/Makefile.am | 1 +
src/config/pool_config_variables.c | 65 ++
src/context/pool_query_context.c | 262 +++++-
src/context/pool_session_context.c | 19 +-
src/include/context/pool_session_context.h | 18 +-
src/include/pool.h | 3 +-
src/include/pool_config.h | 24 +-
src/include/utils/pool_track_table_mutation.h | 167 ++++
src/main/pgpool_main.c | 29 +-
src/protocol/CommandComplete.c | 49 ++
src/protocol/child.c | 8 +
src/protocol/pool_proto_modules.c | 6 +-
src/sample/pgpool.conf.sample-stream | 45 ++
src/streaming_replication/pool_worker_child.c | 24 +
src/test/regression/libs.sh | 2 +
.../tests/043.track_table_mutation/test.sh | 354 +++++++++
.../044.track_table_mutation_watchdog/test.sh | 184 +++++
src/tools/pgindent/typedefs.list | 4 +
src/utils/pool_track_table_mutation.c | 885 +++++++++++++++++++++
21 files changed, 2715 insertions(+), 35 deletions(-)
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgpool: Feature: load balancing control by table tracking.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox