hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-254.Don't register segment into catalog table if master is running in utility mode
Date Tue, 22 Dec 2015 07:29:18 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master ec8ec9309 -> 2f581545d


HAWQ-254.Don't register segment into catalog table if master is running in utility mode


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

Branch: refs/heads/master
Commit: 2f581545d53f0c1811f1ff98a63a4ebb35c72e4b
Parents: ec8ec93
Author: Wen Lin <wlin@pivotal.io>
Authored: Tue Dec 22 15:37:55 2015 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Tue Dec 22 15:37:55 2015 +0800

----------------------------------------------------------------------
 .../communication/rmcomm_RM2RMSEG.c               | 10 ++++++++--
 src/backend/resourcemanager/requesthandler.c      |  8 ++++++--
 src/backend/resourcemanager/resourcemanager.c     |  5 ++++-
 src/backend/resourcemanager/resourcepool.c        | 18 ++++++++++++------
 4 files changed, 30 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f581545/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 c86a4d6..ecbc2b7 100644
--- a/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
+++ b/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c
@@ -233,7 +233,10 @@ void receivedRUAliveResponse(AsyncCommMessageHandlerContext  context,
 			 */
 			returnAllGRMResourceFromSegment(segres);
 			/* Set the host down in gp_segment_configuration table */
-			update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+			if (Gp_role != GP_ROLE_UTILITY)
+			{
+				update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+			}
 			/* Set the host down. */
 			elog(LOG, "Resource manager sets host %s from up to down "
 					  "due to not getting valid RUAlive response.",
@@ -279,7 +282,10 @@ void sentRUAliveError(AsyncCommMessageHandlerContext context)
 		 */
 		returnAllGRMResourceFromSegment(segres);
 		/* Set the host down in gp_segment_configuration table */
-		update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+		if (Gp_role != GP_ROLE_UTILITY)
+		{
+			update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+		}
 		/* Set the host down. */
 		elog(LOG, "Resource manager sets host %s from up to down "
 				  "due to communication error.",

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f581545/src/backend/resourcemanager/requesthandler.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/requesthandler.c b/src/backend/resourcemanager/requesthandler.c
index 9693656..9702e5b 100644
--- a/src/backend/resourcemanager/requesthandler.c
+++ b/src/backend/resourcemanager/requesthandler.c
@@ -976,8 +976,12 @@ bool handleRMRequestSegmentIsDown(void **arg)
 		        	/* Make resource pool remove unused containers */
 		        	returnAllGRMResourceFromSegment(segres);
 		        	/* Set the host down in gp_segment_configuration table */
-		        	update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET,
-		        						  SEGMENT_STATUS_DOWN);
+		        	if (Gp_role != GP_ROLE_UTILITY)
+		        	{
+		        		update_segment_status(segres->Stat->ID + REGISTRATION_ORDER_OFFSET,
+		        							  SEGMENT_STATUS_DOWN);
+		        	}
+
 		        	/* Set the host down. */
 		        	elog(LOG, "Resource manager sets host %s from up to down "
 		        			  "due to not reaching host.", hostname);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f581545/src/backend/resourcemanager/resourcemanager.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcemanager.c b/src/backend/resourcemanager/resourcemanager.c
index 160a4b7..9549855 100644
--- a/src/backend/resourcemanager/resourcemanager.c
+++ b/src/backend/resourcemanager/resourcemanager.c
@@ -2627,7 +2627,10 @@ void updateStatusOfAllNodes() {
         	 * This call makes resource pool remove unused containers.
         	 */
         	returnAllGRMResourceFromSegment(node);
-        	update_segment_status(idx + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+        	if (Gp_role != GP_ROLE_UTILITY)
+        	{
+        		update_segment_status(idx + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_DOWN);
+        	}
 
         	elog(LOG, "Resource manager sets host %s from up to down.",
         			  GET_SEGRESOURCE_HOSTNAME(node));

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f581545/src/backend/resourcemanager/resourcepool.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcepool.c b/src/backend/resourcemanager/resourcepool.c
index 95bb948..4c74029 100644
--- a/src/backend/resourcemanager/resourcepool.c
+++ b/src/backend/resourcemanager/resourcepool.c
@@ -716,11 +716,14 @@ int addHAWQSegWithSegStat(SegStat segstat)
 		getSegInfoHostAddrStr(&(segresource->Stat->Info), 0, &straddr);
 		Assert(straddr->Address != NULL);
 
-		add_segment_config_row(segid+REGISTRATION_ORDER_OFFSET,
-							   hostname,
-				               straddr->Address,
-							   segresource->Stat->Info.port,
-							   SEGMENT_ROLE_PRIMARY);
+		if (Gp_role != GP_ROLE_UTILITY)
+		{
+			add_segment_config_row(segid+REGISTRATION_ORDER_OFFSET,
+								   hostname,
+								   straddr->Address,
+								   segresource->Stat->Info.port,
+								   SEGMENT_ROLE_PRIMARY);
+		}
 
 		/* Add this node into the io bytes workload BBST structure. */
 		addSegResourceIOBytesWorkloadIndex(segresource);
@@ -742,7 +745,10 @@ int addHAWQSegWithSegStat(SegStat segstat)
 		if ( !IS_SEGSTAT_FTSAVAILABLE(segresource->Stat) )
 		{
 			setSegResHAWQAvailability(segresource, RESOURCE_SEG_STATUS_AVAILABLE);
-			update_segment_status(segresource->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_UP);
+			if (Gp_role != GP_ROLE_UTILITY)
+			{
+				update_segment_status(segresource->Stat->ID + REGISTRATION_ORDER_OFFSET, SEGMENT_STATUS_UP);
+			}
 
 			elog(LOG, "Resource manager sets segment %s(%d) up from down.",
 					  GET_SEGRESOURCE_HOSTNAME(segresource),


Mime
View raw message