hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject [03/38] incubator-hawq git commit: HAWQ-570. YARN queue report should be a relative percentage value instead of an absolute value
Date Thu, 31 Mar 2016 00:23:56 GMT
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/c40a6b1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/c40a6b1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/c40a6b1a

Branch: refs/heads/HAWQ-546
Commit: c40a6b1a3bee40eabd8c32e052fd06791a396c6f
Parents: 7549897
Author: YI JIN <yjin@pivotal.io>
Authored: Wed Mar 23 13:14:04 2016 +1100
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Wed Mar 30 17:23:26 2016 -0700

----------------------------------------------------------------------
 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/c40a6b1a/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/c40a6b1a/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