pgpool2.git / summary / log / commit / refs
commit 11bccff58649658d22c3a68939cfbd8853347012
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Sun Jan 31 02:27:47 2021 +0000
Fix oversight in commit 3a36284c53c125389c999de5c6c4710973c4cb82.
When si_get_snapshot() is called, load balance node has not been
decided yet and we cannot use VALID_BACKEND macro. Use
VALID_BACKEND_RAW instead.
src/protocol/pool_proto_modules.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c
index a52851555..0137ee2fc 100644
--- a/src/protocol/pool_proto_modules.c
+++ b/src/protocol/pool_proto_modules.c
@@ -4390,7 +4390,10 @@ si_get_snapshot(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, Node
static char *si_query = "SELECT current_setting('transaction_read_only')";
POOL_SELECT_RESULT *res;
- if (!VALID_BACKEND(i))
+ /* We cannot use VALID_BACKEND macro here because load balance
+ * node has not been decided yet.
+ */
+ if (!VALID_BACKEND_RAW(i))
continue;
do_query(CONNECTION(backend, i), si_query, &res, MAJOR(backend));
[parent: 6d34482739e7]