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-564. QD hangs when connecting to resource manager
Date Fri, 01 Apr 2016 01:53:37 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 758d26539 -> 02a1c6c22


HAWQ-564. QD hangs when connecting to resource manager


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

Branch: refs/heads/master
Commit: 02a1c6c221184d2dfbda8c2c29b36e049646f12f
Parents: 758d265
Author: YI JIN <yjin@pivotal.io>
Authored: Fri Apr 1 12:53:22 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Fri Apr 1 12:53:22 2016 +1100

----------------------------------------------------------------------
 .../communication/rmcomm_RM2RMSEG.c             |  6 ++-
 .../resourcemanager/include/resourcepool.h      |  1 -
 src/backend/resourcemanager/resourcepool.c      | 45 ++++++++++++++++----
 3 files changed, 41 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/02a1c6c2/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c b/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
index 85629a8..c784f65 100644
--- a/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
+++ b/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
@@ -618,7 +618,7 @@ void processContainersAfterIncreaseMemoryQuota(GRMContainerSet ctns, bool
accept
     		ctn->Life += 1;
 
     		PRESPOOL->AddPendingContainerCount--;
-    		elog(LOG, "AddPendingContainerCount minused 1, current value %d",
+    		elog(LOG, "AddPendingContainerCount minus 1, current value %d",
     				  PRESPOOL->AddPendingContainerCount);
     		/*
     		 * Add container to ToKickContainers if lifetime is not too long.
@@ -628,6 +628,10 @@ void processContainersAfterIncreaseMemoryQuota(GRMContainerSet ctns,
bool accept
     		if( !isCleanGRMResourceStatus() &&
     			ctn->Life < RESOURCE_CONTAINER_MAX_LIFETIME )
     		{
+    			/* This container can not generate additional increase pending */
+    			minusResourceBundleData(&(ctn->Resource->IncPending),
+    									ctn->MemoryMB,
+										ctn->Core);
     			addGRMContainerToToBeAccepted(ctn);
     		}
     		/* Add container to KickedContainers if lifetime is long enough */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/02a1c6c2/src/backend/resourcemanager/include/resourcepool.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/resourcepool.h b/src/backend/resourcemanager/include/resourcepool.h
index f9f893d..8c25ee1 100644
--- a/src/backend/resourcemanager/include/resourcepool.h
+++ b/src/backend/resourcemanager/include/resourcepool.h
@@ -308,7 +308,6 @@ struct SegResourceData {
 SegResource createSegResource(SegStat segstat);
 
 int setSegResHAWQAvailability( SegResource segres, uint8_t newstatus);
-int setSegResGLOBAvailability( SegResource segres, uint8_t newstatus);
 
 /* Set the segment is under or not under RUAlive pending status. */
 bool setSegResRUAlivePending( SegResource segres, bool pending);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/02a1c6c2/src/backend/resourcemanager/resourcepool.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcepool.c b/src/backend/resourcemanager/resourcepool.c
index 976ddca..0f06f22 100644
--- a/src/backend/resourcemanager/resourcepool.c
+++ b/src/backend/resourcemanager/resourcepool.c
@@ -907,8 +907,8 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 	int32_t		 	 segid			 = SEGSTAT_ID_INVALID;
 	SimpString		 hostnamekey;
 	SimpArray 		 hostaddrkey;
-	bool			 segcapchanged  = false;
-
+	bool			 segcapchanged   = false;
+	bool			 segavailchanged = false;
 	/*
 	 * Anyway, the host capacity is updated here if the cluster level capacity
 	 * is fixed.
@@ -1040,6 +1040,7 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 		if (segresource->Stat->StatusDesc == 0)
 		{
 			setSegResHAWQAvailability(segresource, RESOURCE_SEG_STATUS_AVAILABLE);
+			segavailchanged = true;
 		}
 
 		/* Add this node into the table gp_segment_configuration */
@@ -1277,12 +1278,20 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 		{
 			if (oldStatus == RESOURCE_SEG_STATUS_UNAVAILABLE ||
 					oldStatus == RESOURCE_SEG_STATUS_UNSET)
-				setSegResHAWQAvailability(segresource, RESOURCE_SEG_STATUS_AVAILABLE);
+			{
+				setSegResHAWQAvailability(segresource,
+										  RESOURCE_SEG_STATUS_AVAILABLE);
+				segavailchanged = true;
+			}
 		}
 		else
 		{
 			if (oldStatus == RESOURCE_SEG_STATUS_AVAILABLE)
-				setSegResHAWQAvailability(segresource, RESOURCE_SEG_STATUS_UNAVAILABLE);
+			{
+				setSegResHAWQAvailability(segresource,
+										  RESOURCE_SEG_STATUS_UNAVAILABLE);
+				segavailchanged = true;
+			}
 		}
 
 		if (oldStatusDesc != segresource->Stat->StatusDesc ||
@@ -1376,6 +1385,12 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 		res = RESOURCEPOOL_DUPLICATE_HOST;
 	}
 
+	if ( segavailchanged )
+	{
+		refreshResourceQueueCapacity(false);
+		refreshActualMinGRMContainerPerSeg();
+	}
+
 	validateResourcePoolStatus(true);
 	return res;
 }
@@ -1585,6 +1600,8 @@ int updateHAWQSegWithGRMSegStat( SegStat segstat)
 	{
 		Assert(statusDescChange == true);
 		setSegResHAWQAvailability(segres, RESOURCE_SEG_STATUS_AVAILABLE);
+		refreshResourceQueueCapacity(false);
+		refreshActualMinGRMContainerPerSeg();
 	}
 
 	if (statusDescChange && Gp_role != GP_ROLE_UTILITY)
@@ -1945,14 +1962,23 @@ int  addGRMContainerToToBeAccepted(GRMContainer ctn)
 	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);
+					  "host %s. To return this host's resource container at once. "
+					  "pending memory %d mb, allocated memory %d mb.",
+					  ctn->HostName,
+					  ctn->Resource->IncPending.MemoryMB,
+					  ctn->Resource->Allocated.MemoryMB);
 		addGRMContainerToKicked(ctn);
 		return RESOURCEPOOL_TOO_MANY_CONTAINERS;
 	}
 
 	/* Set the resource as increasing pending. */
 	addResourceBundleData(&(ctn->Resource->IncPending), ctn->MemoryMB, ctn->Core);
+	elog(RMLOG, "Host %s is added container to be accepted (%d MB, %d CORE), "
+				"now pending %d MB.",
+				ctn->HostName,
+				ctn->MemoryMB,
+				ctn->Core,
+				ctn->Resource->IncPending.MemoryMB);
 
 	/* Add the container to the hash-table to be processed consequently. */
 	SimpString key;
@@ -1971,7 +1997,7 @@ int  addGRMContainerToToBeAccepted(GRMContainer ctn)
 
 	appendGRMContainerSetContainer(ctns, ctn);
 	PRESPOOL->AddPendingContainerCount++;
-	elog(LOG, "AddPendingContainerCount added 1, current value %d",
+	elog(LOG, "AddPendingContainerCount added 1, current value %d.",
 			  PRESPOOL->AddPendingContainerCount);
 	return FUNC_RETURN_OK;
 }
@@ -2046,13 +2072,14 @@ void addGRMContainerToResPool(GRMContainer container)
 	reorderSegResourceCombinedWorkloadIndex(segresource);
 
 	elog(LOG, "Resource manager added resource container into resource pool "
-			  "(%d MB, %d CORE) at %s (%d:%.*s)",
+			  "(%d MB, %d CORE) at %s (%d:%.*s), still pending %d MB",
 			  container->MemoryMB,
 			  container->Core,
 			  container->HostName,
 			  segresource->Stat->ID,
 			  segresource->Stat->Info.HostNameLen,
-			  GET_SEGRESOURCE_HOSTNAME(segresource));
+			  GET_SEGRESOURCE_HOSTNAME(segresource),
+			  segresource->IncPending.MemoryMB);
 }
 
 void addGRMContainerToToBeKicked(GRMContainer ctn)


Mime
View raw message