hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject [10/38] incubator-hawq git commit: HAWQ-578. Avoid validating whether total allocated resource is more than maximum YARN resource queue capacity
Date Thu, 31 Mar 2016 00:24:03 GMT
HAWQ-578. Avoid validating whether total allocated resource is more than maximum YARN resource
queue capacity


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

Branch: refs/heads/HAWQ-546
Commit: 673f930bcc207fe93e4aec1ecd576927a18096b7
Parents: 606c9e5
Author: YI JIN <yjin@pivotal.io>
Authored: Wed Mar 23 14:00:53 2016 +1100
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Wed Mar 30 17:23:27 2016 -0700

----------------------------------------------------------------------
 src/backend/resourcemanager/include/errorcode.h |  1 +
 src/backend/resourcemanager/resourcepool.c      | 25 ++++++++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/673f930b/src/backend/resourcemanager/include/errorcode.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/errorcode.h b/src/backend/resourcemanager/include/errorcode.h
index de08fff..0a2eb09 100644
--- a/src/backend/resourcemanager/include/errorcode.h
+++ b/src/backend/resourcemanager/include/errorcode.h
@@ -137,6 +137,7 @@ enum DRM_ERROR_CODE {
 	RESOURCEPOOL_DUPLICATE_HOST,
 	RESOURCEPOOL_UNRESOLVED_HOST,
 	RESOURCEPOOL_TOO_MANY_UAVAILABLE_HOST,
+	RESOURCEPOOL_TOO_MANY_CONTAINERS,
 
 	/*-----------------------------------------------------------------------*/
 	COMM2RM_CLIENT_START_TAG = 500,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/673f930b/src/backend/resourcemanager/resourcepool.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcepool.c b/src/backend/resourcemanager/resourcepool.c
index 3a8d72b..3359207 100644
--- a/src/backend/resourcemanager/resourcepool.c
+++ b/src/backend/resourcemanager/resourcepool.c
@@ -1972,6 +1972,21 @@ int  addGRMContainerToToBeAccepted(GRMContainer ctn)
 	/* The host must has registered resource information linked. */
 	Assert( ctn->Resource != NULL);
 
+	/* If the new container makes total possible resource quota greater than
+	 * maximum resource capacity, reject this container.
+	 */
+	uint32_t memlimit = DRMGlobalInstance->ImpType == NONE_HAWQ2 ?
+						ctn->Resource->Stat->FTSTotalMemoryMB :
+						ctn->Resource->Stat->GRMTotalMemoryMB;
+	if ( ctn->Resource->IncPending.MemoryMB + ctn->Resource->Allocated.MemoryMB
> memlimit )
+	{
+		elog(WARNING, "Global resource manager allocated too many containers to "
+					  "host %s. To return this host's resource container at once.",
+					  ctn->HostName);
+		addGRMContainerToKicked(ctn);
+		return RESOURCEPOOL_TOO_MANY_CONTAINERS;
+	}
+
 	/* Set the resource as increasing pending. */
 	addResourceBundleData(&(ctn->Resource->IncPending), ctn->MemoryMB, ctn->Core);
 
@@ -4162,10 +4177,12 @@ void validateResourcePoolStatus(bool refquemgr)
 
 	if ( totalallocmem > mem || totalalloccore > core )
 	{
-		elog(ERROR, "HAWQ RM Validation. Allocated too much resource in resource "
-					"pool. (%d MB, %lf CORE)",
-					totalallocmem,
-					totalalloccore);
+		elog(WARNING, "HAWQ RM Validation. Allocated too much resource in resource "
+					  "pool (%d MB, %lf CORE), maximum capacity (%d MB, %lf CORE)",
+					  totalallocmem,
+					  totalalloccore,
+					  core,
+					  mem);
 	}
 
 	/*


Mime
View raw message