hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From y...@apache.org
Subject incubator-hawq git commit: HAWQ-631. Wrongly report error message when QD fails to connect to resource manager
Date Wed, 06 Apr 2016 06:57:08 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 5e6cdd69a -> 8bd10631e


HAWQ-631. Wrongly report error message when QD fails to connect to resource manager


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/8bd10631
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/8bd10631
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/8bd10631

Branch: refs/heads/master
Commit: 8bd10631ecb90f05042abc90471cd170250cf680
Parents: 5e6cdd6
Author: YI JIN <yjin@pivotal.io>
Authored: Wed Apr 6 16:56:57 2016 +1000
Committer: YI JIN <yjin@pivotal.io>
Committed: Wed Apr 6 16:56:57 2016 +1000

----------------------------------------------------------------------
 .../communication/rmcomm_SyncComm.c              |  6 +++---
 src/backend/tcop/pquery.c                        | 19 ++++++-------------
 2 files changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8bd10631/src/backend/resourcemanager/communication/rmcomm_SyncComm.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/communication/rmcomm_SyncComm.c b/src/backend/resourcemanager/communication/rmcomm_SyncComm.c
index dfc89d7..f476add 100644
--- a/src/backend/resourcemanager/communication/rmcomm_SyncComm.c
+++ b/src/backend/resourcemanager/communication/rmcomm_SyncComm.c
@@ -84,7 +84,7 @@ int callSyncRPCRemote(const char     	   *hostname,
 				 "failed to connect to remote socket server %s:%d",
 				 hostname,
 				 port);
-		elog(WARNING, "%s", errorbuf);
+		elog(LOG, "%s", errorbuf);
 		goto exit;
 	}
 
@@ -106,7 +106,7 @@ int callSyncRPCRemote(const char     	   *hostname,
 				 fd,
 				 hostname, port);
 
-		elog(WARNING, "%s", errorbuf);
+		elog(LOG, "%s", errorbuf);
 		goto exit;
 	}
 
@@ -150,7 +150,7 @@ int callSyncRPCRemote(const char     	   *hostname,
 
 	if (res != FUNC_RETURN_OK)
 	{
-	  elog(WARNING, "Sync RPC framework (inet) finds exception raised.");
+	  elog(LOG, "Sync RPC framework (inet) finds exception raised.");
 
 	  switch(res)
 	  {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8bd10631/src/backend/tcop/pquery.c
----------------------------------------------------------------------
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 04420c3..243ac75 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -747,8 +747,7 @@ AllocateResource(QueryResourceLife   life,
 
 	int ret;
 	int resourceId = -1;
-	char errorbuf[1024];
-	int  errorcode;
+	static char errorbuf[1024];
 
 	QDResourceContext rescontext = NULL;
 
@@ -766,7 +765,8 @@ AllocateResource(QueryResourceLife   life,
 
 	/* Create new resource context. */
 	ret = createNewResourceContext(&resourceId);
-	if ( ret == FUNC_RETURN_OK ) {
+	if ( ret == FUNC_RETURN_OK )
+	{
 		elog(DEBUG3, "Created new resource context for this session indexed %d",
 					 resourceId);
 	}
@@ -782,16 +782,9 @@ AllocateResource(QueryResourceLife   life,
 									  useridoid,
 									  errorbuf,
 									  sizeof(errorbuf));
-	errorcode = ret;
-	if (ret != FUNC_RETURN_OK) {
-		ereport(ERROR,
-				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
-				 errmsg("must be superuser to create resource queues")));
-		elog(ERROR, "%s. (%d)", errorbuf, ret);
-	}
-
-	if ( errorcode != FUNC_RETURN_OK ) {
-		elog(ERROR, "%s. (%d)", errorbuf, errorcode);
+	if (ret != FUNC_RETURN_OK)
+	{
+		ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("%s",errorbuf)));
 	}
 
 	AddToGlobalQueryResources(resourceId, life);


Mime
View raw message