[pgpool-general: 8525] Re: "delay_threshold_by_time" not detecting replication lag
Tatsuo Ishii
ishii at sraoss.co.jp
Tue Dec 27 11:23:19 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?
delay_threshold_by_time just uses the query result of "int4" column of the following query:
SELECT application_name, state, sync_state,(EXTRACT(EPOCH FROM replay_lag)*1000000)::integer FROM pg_stat_replication;
application_name | state | sync_state | int4
------------------+-----------+------------+---------
server1 | streaming | async | 1578050
(the result above was taken in my local environment).
If you manually issue the query above against the PostgreSQL primary
node while executing pgbench -i, what do you see as a result?
Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
More information about the pgpool-general
mailing list