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-570. YARN queue report should be a relative percentage value instead of an absolute value
Date Wed, 23 Mar 2016 02:14:17 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 26a5b2029 -> c00429fef


HAWQ-570. YARN queue report should be a relative percentage value instead of an absolute value


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

Branch: refs/heads/master
Commit: c00429feff5605cf7dbbddfab7acda3521f1b736
Parents: 26a5b20
Author: YI JIN <yjin@pivotal.io>
Authored: Wed Mar 23 13:14:04 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Wed Mar 23 13:14:04 2016 +1100

----------------------------------------------------------------------
 src/backend/resourcemanager/resourcemanager.c |  6 ++---
 src/backend/resourcemanager/resqueuemanager.c | 26 ++++++++++++----------
 2 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c00429fe/src/backend/resourcemanager/resourcemanager.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcemanager.c b/src/backend/resourcemanager/resourcemanager.c
index c7215be..eb2663c 100644
--- a/src/backend/resourcemanager/resourcemanager.c
+++ b/src/backend/resourcemanager/resourcemanager.c
@@ -645,11 +645,11 @@ int MainHandlerLoop(void)
 			 PRESPOOL->AddPendingContainerCount == 0 &&
 			 PRESPOOL->RetPendingContainerCount == 0 &&
 			 PQUEMGR->ForcedReturnGRMContainerCount == 0 &&
-			 (PQUEMGR->GRMQueueCurCapacity > PQUEMGR->GRMQueueCapacity ||
-			  PQUEMGR->GRMQueueResourceTight) )
+			 PQUEMGR->GRMQueueCurCapacity > 1 &&
+			 PQUEMGR->GRMQueueResourceTight )
 		{
 			elog(LOG, "Resource manager decides to breathe out resource. "
-					  "Current GRM queue capacity %lf, "
+					  "Current relative GRM queue capacity %lf, "
 					  "Expect GRM queue capacity %lf, "
 					  "Estimae GRM queue %s",
 					  PQUEMGR->GRMQueueCurCapacity,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c00429fe/src/backend/resourcemanager/resqueuemanager.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resqueuemanager.c b/src/backend/resourcemanager/resqueuemanager.c
index 538c2ad..b5072dc 100644
--- a/src/backend/resourcemanager/resqueuemanager.c
+++ b/src/backend/resourcemanager/resqueuemanager.c
@@ -5229,9 +5229,9 @@ void setForcedReturnGRMContainerCount(void)
 
 		if ( quetrack->DLDetector.LockedTotal.MemoryMB > 0 )
 		{
-			elog(LOG, "Queue %s has potential resource deadlock, skip breathe.",
+			elog(LOG, "Queue %s has potential resource deadlock, cancel breathe.",
 					  quetrack->QueueInfo->Name);
-			PQUEMGR->GRMQueueCurCapacity   = PQUEMGR->GRMQueueCapacity;
+			PQUEMGR->GRMQueueCurCapacity   = 1.0;
 			PQUEMGR->GRMQueueResourceTight = false;
 			return;
 		}
@@ -5240,20 +5240,22 @@ void setForcedReturnGRMContainerCount(void)
 	/* Get current GRM container size. */
 	int clusterctnsize = getClusterGRMContainerSize();
 	int toretctnsize = 0;
-	if ( PQUEMGR->GRMQueueCurCapacity > PQUEMGR->GRMQueueCapacity )
+	double curabscapacity = PQUEMGR->GRMQueueCurCapacity *
+							PQUEMGR->GRMQueueCapacity;
+
+	if ( curabscapacity > PQUEMGR->GRMQueueCapacity )
 	{
 		/*
 		 * We would like to return as many containers as possible to make queue
 		 * usage lower than expected capacity.
 		 */
-		double r = (PQUEMGR->GRMQueueCurCapacity - PQUEMGR->GRMQueueCapacity) /
-				   PQUEMGR->GRMQueueCurCapacity;
-		elog(DEBUG3, "GRM queue cur capacity %lf is larger than capacity %lf. "
-					 "ratio %lf, curent GRM container size %d",
-					 PQUEMGR->GRMQueueCurCapacity,
-					 PQUEMGR->GRMQueueCapacity,
-					 r,
-					 clusterctnsize);
+		double r = (curabscapacity - PQUEMGR->GRMQueueCapacity) / curabscapacity;
+		elog(LOG, "GRM queue is over-using, cur capacity %lf*%lf, "
+				  "ratio %lf, curent GRM container size %d",
+				  PQUEMGR->GRMQueueCurCapacity,
+				  PQUEMGR->GRMQueueCapacity,
+				  r,
+				  clusterctnsize);
 		toretctnsize = ceil(r * clusterctnsize);
 
 		if ( rm_return_percentage_on_overcommit > 0 )
@@ -5272,7 +5274,7 @@ void setForcedReturnGRMContainerCount(void)
 
 	/* Restore queue report to avoid force return again. */
 	PQUEMGR->ForcedReturnGRMContainerCount = toretctnsize;
-	PQUEMGR->GRMQueueCurCapacity		   = PQUEMGR->GRMQueueCapacity;
+	PQUEMGR->GRMQueueCurCapacity		   = 1.0;
 	PQUEMGR->GRMQueueResourceTight 		   = false;
 }
 


Mime
View raw message