Revert "Revert "HAWQ-547. When HAWQ RM does not have valid YARN resource queue status received the cluster report is not accepted""
This reverts commit 2be5899ca55b954de90aa72d00c8bd02f8f2fb83. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1897ba1d Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1897ba1d Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1897ba1d Branch: refs/heads/HAWQ-459 Commit: 1897ba1d00135f80a8d7ff656ca8389b2be213bd Parents: 2be5899 Author: hubertzhang <[email protected]> Authored: Thu Mar 17 15:37:09 2016 +0800 Committer: hubertzhang <[email protected]> Committed: Thu Mar 17 15:37:09 2016 +0800 ---------------------------------------------------------------------- src/backend/resourcemanager/include/errorcode.h | 1 + .../resourcebroker/resourcebroker_LIBYARN.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1897ba1d/src/backend/resourcemanager/include/errorcode.h ---------------------------------------------------------------------- diff --git a/src/backend/resourcemanager/include/errorcode.h b/src/backend/resourcemanager/include/errorcode.h index ca338a8..de08fff 100644 --- a/src/backend/resourcemanager/include/errorcode.h +++ b/src/backend/resourcemanager/include/errorcode.h @@ -162,6 +162,7 @@ enum DRM_ERROR_CODE { RESBROK_WRONG_GLOB_MGR_ADDRESS, RESBROK_WRONG_GLOB_MGR_QUEUE, RESBROK_WRONG_GLOB_MGR_APPNAME, + RESBROK_WRONG_GLOB_MGR_QUEUEREPORT, RESBROK_PIPE_ERROR, RESBROK_NOMORE_RESOURCE_IN_GRM, RESBROK_WRONG_MESSAGE_ID, http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1897ba1d/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN.c ---------------------------------------------------------------------- diff --git a/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN.c b/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN.c index cdbe0d5..b8d205e 100644 --- a/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN.c +++ b/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN.c @@ -568,7 +568,7 @@ int handleRB2RM_ClusterReport(void) } elog(LOG, "YARN mode resource broker got cluster report having %d host(s), " - "maximum capacity is %lf.", + "maximum queue capacity is %lf.", response.MachineCount, response.QueueMaxCapacity); @@ -631,6 +631,19 @@ int handleRB2RM_ClusterReport(void) * TILL NOW, the whole message content is received. */ + if ( res == FUNC_RETURN_OK ) + { + /* Check if the YARN resource queue report is valid, i.e. maximum + * capacity and capacity are all greater than 0. + */ + if ( response.QueueCapacity <= 0 || response.QueueMaxCapacity <= 0 ) + { + elog(WARNING, "YARN mode resource broker got invalid cluster report"); + res = RESBROK_WRONG_GLOB_MGR_QUEUEREPORT; + + } + } + /* If something wrong, no need to keep the received content, free them. */ if ( res != FUNC_RETURN_OK ) { @@ -1176,6 +1189,7 @@ void RB_LIBYARN_handleError(int errorcode) } else { - Assert(errorcode == FUNC_RETURN_OK); + Assert(errorcode == FUNC_RETURN_OK || + errorcode == RESBROK_WRONG_GLOB_MGR_QUEUEREPORT); } }
