From ef96a32ea52f858f40b5fc78817d30b36f82cf38 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sun, 31 Jan 2021 11:27:47 +0900 Subject: [PATCH] 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 92b94f7cd..8789bdc5c 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)); -- 2.39.5