[pgpool-committers: 9053] pgpool: Fix integer overflow in streaming replication check.
Tatsuo Ishii
ishii at sraoss.co.jp
Fri Jan 13 10:31:25 JST 2023
Fix integer overflow in streaming replication check.
When delay_threshold_by_time is enabled, following query is
periodically sent to the primary node to obtain the replication delay
in micro seconds.
SELECT application_name, state, sync_state,(EXTRACT(EPOCH FROM
replay_lag)*1000000)::integer FROM pg_stat_replication";
Unfortunately the result from EXTRACT::integer overflows if replay_lag
is bigger than 2147483647/1000000 (that is about 35 minutes and 47
seconds). Fix is, changing "integer" to "bigint". By this, the result
will not overflow unless it becomes bigger than 292,472 years.
Discussion: https://www.pgpool.net/pipermail/pgpool-general/2023-January/008600.html
Backpatch-through: 4.4
Branch
------
master
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=e553ab46e947a895424a18d0ec9065851e09e1a2
Modified Files
--------------
src/streaming_replication/pool_worker_child.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
More information about the pgpool-committers
mailing list