pgpool_setup -n 3 (or greater) triggers the bug. While recovering node
2, pgpool main process tried to retrieve version info from backend #2
even if it's not running. This causes the sefault because connection
was not established yet. The reason why PostgreSQL 9.6 or later was not
suffered from the bug was, PostgreSQL exited the loop as soon as the
server version is higher than 9.5. To fix this, call to VALID_BACKEND
macro was added.
*/
for (i=0;i<NUM_BACKENDS;i++)
{
+ if (!VALID_BACKEND(i))
+ continue;
+
if (get_server_version(slots, i) >= 90600)
{
check_connectivity = true;
{
primary[i] = 0;
+ if (!VALID_BACKEND(i))
+ continue;
+
if (pool_node_status[i] == POOL_NODE_STATUS_PRIMARY)
{
ereport(DEBUG1,