You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Lili Ma (JIRA)" <ji...@apache.org> on 2016/03/10 08:06:40 UTC

[jira] [Commented] (HAWQ-510) Interconnect error(Could not pare remote listeneraddress '[local]') during running query with generate_series

    [ https://issues.apache.org/jira/browse/HAWQ-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15188814#comment-15188814 ] 

Lili Ma commented on HAWQ-510:
------------------------------

The error is thrown from entryDB which tries to connect to QD for interconnect connection. 
When QD establishes connection to entryDB through domain socket, entryDB marks the remote host for the connection as "\[local\]". 
{code}
/*
 * Convert an address to a hostname.
 */
static int
getnameinfo_unix(const struct sockaddr_un * sa, int salen,
				 char *node, int nodelen,
				 char *service, int servicelen,
				 int flags)
{
	int			ret = -1;

	/* Invalid arguments. */
	if (sa == NULL || sa->sun_family != AF_UNIX ||
		(node == NULL && service == NULL))
		return EAI_FAIL;

	/* We don't support those. */
	if ((node && !(flags & NI_NUMERICHOST))
		|| (service && !(flags & NI_NUMERICSERV)))
		return EAI_FAIL;

	if (node)
	{
		ret = snprintf(node, nodelen, "%s", "[local]");
		if (ret == -1 || ret > nodelen)
			return EAI_MEMORY;
	}

	if (service)
	{
		ret = snprintf(service, servicelen, "%s", sa->sun_path);
		if (ret == -1 || ret > servicelen)
			return EAI_MEMORY;
	}

	return 0;
}
#endif   /* HAVE_UNIX_SOCKETS */
{code}
When entryDB tries to prepare interconnect output packets to QD, it needs to analyze the remote host. In function adjustMasterRouting, it assigns the listenerAddr as MyProcPort->remote_host, e.g. "\[local\]"

{code}
void adjustMasterRouting(Slice *recvSlice)
{
	ListCell *lc = NULL;
	foreach(lc, recvSlice->primaryProcesses)
	{
		CdbProcess *cdbProc = (CdbProcess *)lfirst(lc);

		if (cdbProc->listenerAddr == NULL)
			cdbProc->listenerAddr = pstrdup(MyProcPort->remote_host);
	}
}
{code}
And then meets can't analyze host error.
{code}
	ret = pg_getaddrinfo_all(listenerAddr, service, &hint, &addrs);
	if (ret || !addrs)
	{
		if (addrs)
			pg_freeaddrinfo_all(hint.ai_family, addrs);

		ereport(ERROR, (errcode(ERRCODE_GP_INTERCONNECTION_ERROR),
			errmsg("Interconnect Error: Could not parse remote listener"
				   "address: '%s' port '%d': %s", listenerAddr,listenerPort,gai_strerror(ret)),
			errdetail("getaddrinfo() unable to parse address: '%s'",
					  listenerAddr)));
		return;
	}
{code}

> Interconnect error(Could not pare remote listeneraddress '[local]') during running query with generate_series
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HAWQ-510
>                 URL: https://issues.apache.org/jira/browse/HAWQ-510
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Interconnect
>            Reporter: Lili Ma
>            Assignee: Lili Ma
>
> Running below query meets can't parse remote listeneraddress error.
> {code}
> CREATE TABLE t (key INT, value INT) DISTRIBUTED RANDOMLY;
> INSERT INTO t VALUES (1, 0);
> postgres=# SELECT t2.key, t2.value                                                                        FROM                                                                                                      (SELECT key, value FROM t WHERE value = 0) AS t1,                                                         (SELECT generate_series(1, 2)::INT AS key, 0::INT AS value ) AS t2                                        WHERE t1.value = t2.value;
> ERROR:  Interconnect Error: Could not parse remote listeneraddress: '[local]' port '58162': Name or service not known  (seg0 test1:21000 pid=25039)
> DETAIL:  getaddrinfo() unable to parse address: '[local]'
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)