[pgpool-general: 8524] "delay_threshold_by_time" not detecting replication lag

zam bak zam6ak at gmail.com
Tue Dec 27 10:54:16 JST 2022


 Hi

I just upgraded to 4.4.1 and am noticing that "delay_threshold_by_time"
does not seem to be logging or even showing replication lag.

I use pgbench with scale_factor=1000 to cause replication delay during the
initialization phase.
During this phase (which lasts about a minute) I am able to
SELECT * FROM pg_stat_replication
and see replication lag being 15-20 seconds for duration of initialization

However, pgpool log does not show and thresholds reached in the log
(despite having log_standby_delay = 'always' ) and "pcp_node_info" and
"show pool_nodes" show no lag either

if I switch back to "delay_threshold" param only, everything is working as
expected and I can see log entries such as:

sr_check_worker CONTEXT:  while checking replication time lag
sr_check_worker LOG:  Replication of node: 1 is behind 820903040 bytes from
the primary server (node: 0)

But none of this works when I put "delay_threshold_by_time=1"......

1. Is this a valid bug or could it be my settings?
2. If in fact this is a bug, is it just affecting logging/displaying or the
lag and the switching of SELECT queries to primary would still occur if I
use this setting and the lag threshold is reached?



Below if my config (just a diff of settings I changed from default
pgpool.conf.sample)
[/etc/pgpool-II]
[root at localhost]# pgpool --version
pgpool-II version 4.4.1 (nurikoboshi)

[/etc/pgpool-II]
[root at localhost]# diff --unchanged-line-format= --old-line-format=
--new-line-format='%L' pgpool.conf.sample pgpool.conf
listen_addresses = '*'
serialize_accept = on
backend_hostname0 = '10.11.32.15'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/data/pgdata/15'
backend_flag0 = 'ALWAYS_PRIMARY'
backend_application_name0 = 'pg-1'
backend_hostname1 = '10.11.96.15'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/data/pgdata/15'
backend_flag1 = 'DISALLOW_TO_FAILOVER'
backend_application_name1 = 'pg-2'
num_init_children = 246
max_pool = 2
child_life_time = 0
log_line_prefix = '%m [%p]: [%l-1] user=%u,db=%d,app=%a '   # printf-style
string to output at beginning of each log line.
log_connections = on
log_disconnections = on
log_standby_delay = 'always'
logging_collector = on
log_directory = '/var/log/pgpool-II'
log_filename = 'pgpool-01-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 100MB
write_function_list =
'currval,lastval,nextval,setval,convert_.*,create_.*,delete_.*'
statement_level_load_balance = on
sr_check_period = 5
sr_check_user = 'postgres'
#delay_threshold = 1000000
delay_threshold_by_time = 1
health_check_period = 10
health_check_timeout = 30
health_check_user = 'postgres'
health_check_max_retries = 10
failover_on_backend_error = off
check_temp_table = trace
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20221226/256a0f4e/attachment.htm>


More information about the pgpool-general mailing list