Log more information about connection error for ease in debugging
authorPavan Deolasee <[email protected]>
Mon, 23 May 2016 10:05:11 +0000 (15:35 +0530)
committerPavan Deolasee <[email protected]>
Mon, 23 May 2016 10:05:11 +0000 (15:35 +0530)
src/backend/pgxc/pool/poolmgr.c

index e3ed53ce4beb6d59404257817cc726c75e4a184c..6293e31ee4c9b0bd3aeb074d74a8c643493ebd71 100644 (file)
@@ -2382,10 +2382,13 @@ grow_pool(DatabasePool *dbPool, Oid node)
                slot->conn = PGXCNodeConnect(nodePool->connstr);
                if (!PGXCNodeConnected(slot->conn))
                {
-                       destroy_slot(slot);
                        ereport(LOG,
                                        (errcode(ERRCODE_CONNECTION_FAILURE),
-                                        errmsg("failed to connect to Datanode")));
+                                        errmsg("failed to connect to node, connection string (%s),"
+                                                 " connection error (%s)",
+                                                 nodePool->connstr,
+                                                 PQerrorMessage(slot->conn))));
+                       destroy_slot(slot);
                        /*
                         * If we failed to connect probably number of connections on the
                         * target node reached max_connections. Try and release idle