[pgpool-committers: 9172] pgpool: Fix sr worker to not send wrong query to standby server in corn
Tatsuo Ishii
ishii at sraoss.co.jp
Sun Feb 5 17:17:15 JST 2023
Fix sr worker to not send wrong query to standby server in corner case.
When ALWAYS_PRIMARY flag is set, PRIMARY_NODE_ID macro returns node
id, rather than -1 even if the primary is down. This confuses the test
if a node is primary or not, because PRIMARY_NODE_ID macro returns
main node id. In this case streaming replication delay check worker
sends "SELECT pg_current_wal_lsn()" or "SELECT
pg_current_xlog_location()" depending on PostgreSQL's version to
standby which of course raises an error.
To fix this, test the primary node is down or not, and if it's down,
skip the replication delay loop. If primary is down, there's no point
to perform streaming replication delay checking anyway.
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-February/004279.html
Backpatch-through: 4.0
Branch
------
V4_4_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=95ab9129e412ee243fb25710e516391725ced25f
Modified Files
--------------
src/streaming_replication/pool_worker_child.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
More information about the pgpool-committers
mailing list