[pgpool-committers: 8333] pgpool: Allow to specify replication delay by time.

Tatsuo Ishii ishii at sraoss.co.jp
Fri Jan 28 10:53:56 JST 2022


Allow to specify replication delay by time.

delay_threshold specifies replication delay upper limit in bytes. Add
similar parameter called delay_threshold_by_time so that the limit can
be specified by time (seconds). The new parameter is effective if it is
greater than 0 and track_commit_timestamp (available in >> PostgreSQL
9.5 or after) is enabled. In this case "show pool_ndoes" and
pcp_node_info display the replication delay in seconds. If the
parameter is set to 0 or track_commit_timestamp is not enabled,
delay_threshold_by_time is ignored and falls back to delay_threshold
mode.

For this purpose new member standby_delay_by_time is added to shared
memory data Backendinfo to distinguish whether replication delay is
measured in byte (standby_delay_by_time == false) or seconds
(standby_delay_by_time = true). If standby_delay_by_time is true,
standby_delay is measured in second * 1000000, so that the precision
is 6 digits after decimal point.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2021-December/004081.html

Branch
------
master

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

Modified Files
--------------
doc.ja/src/sgml/ref/pcp_node_info.sgml        |  12 ++
doc.ja/src/sgml/stream-check.sgml             |  74 ++++++++++-
doc/src/sgml/ref/pcp_node_info.sgml           |   8 ++
doc/src/sgml/stream-check.sgml                |  73 +++++++++--
src/config/pool_config_variables.c            |  13 +-
src/include/pcp/libpcp_ext.h                  |   1 +
src/include/pool_config.h                     |  12 +-
src/libs/pcp/pcp.c                            |   8 ++
src/pcp_con/pcp_worker.c                      |   5 +
src/protocol/pool_pg_utils.c                  |   3 +-
src/streaming_replication/pool_worker_child.c | 182 +++++++++++++++++++++++---
src/tools/pcp/pcp_frontend_client.c           |  23 +++-
src/utils/pool_process_reporting.c            |  17 ++-
13 files changed, 394 insertions(+), 37 deletions(-)



More information about the pgpool-committers mailing list