HAWQ-547. When HAWQ RM does not have valid YARN resource queue status received 
the cluster report is not accepted


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

Branch: refs/heads/HAWQ-459
Commit: 5fda1826aff4780b20e24db5210f79f867ef39ae
Parents: 8e38e84
Author: YI JIN <[email protected]>
Authored: Wed Mar 16 13:52:37 2016 +1100
Committer: YI JIN <[email protected]>
Committed: Wed Mar 16 13:52:37 2016 +1100

----------------------------------------------------------------------
 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/5fda1826/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/5fda1826/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);
        }
 }

Reply via email to