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-749. segment registration should consider same ip across nodes
Date Thu, 26 May 2016 02:59:25 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master d49b735ea -> f55cc6a34


HAWQ-749. segment registration should consider same ip across nodes


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

Branch: refs/heads/master
Commit: f55cc6a343f24718f0a73be6e956690713ec942c
Parents: d49b735
Author: YI JIN <yjin@pivotal.io>
Authored: Thu May 26 12:59:08 2016 +1000
Committer: YI JIN <yjin@pivotal.io>
Committed: Thu May 26 12:59:08 2016 +1000

----------------------------------------------------------------------
 src/backend/resourcemanager/resourcepool.c | 32 +++++++------------------
 1 file changed, 9 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f55cc6a3/src/backend/resourcemanager/resourcepool.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcepool.c b/src/backend/resourcemanager/resourcepool.c
index 309ea9a..7221066 100644
--- a/src/backend/resourcemanager/resourcepool.c
+++ b/src/backend/resourcemanager/resourcepool.c
@@ -926,30 +926,10 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 	res = getSegIDByHostName(hostname, hostnamelen, &segid);
 	if ( res != FUNC_RETURN_OK )
 	{
-		/* Try addresses of this machine. */
-		for ( int i = 0 ; i < segstat->Info.HostAddrCount ; ++i )
-		{
-			elog(DEBUG5, "Resource manager checks host ip (%d)th to get segment.", i);
-			AddressString addr = NULL;
-			getSegInfoHostAddrStr(&(segstat->Info), i, &addr);
-			if ( strcmp(addr->Address, IPV4_DOT_ADDR_LO) == 0 &&
-				 segstat->Info.HostAddrCount > 1 )
-			{
-				/*
-				 * If the host has only one address as 127.0.0.1, we have to
-				 * save it to track the only one segment, otherwise, we skip
-				 * 127.0.0.1 address in resource pool. Because, each node has
-				 * one entry of this address.
-				 */
-				continue;
-			}
+		AddressString addr = NULL;
+		getSegInfoHostAddrStr(&(segstat->Info), 0, &addr);
 
-			res = getSegIDByHostAddr((uint8_t *)(addr->Address), addr->Length, &segid);
-			if ( res == FUNC_RETURN_OK )
-			{
-				break;
-			}
-		}
+		res = getSegIDByHostAddr((uint8_t *)(addr->Address), addr->Length, &segid);
 	}
 
 	/* CASE 1. It is a new host. */
@@ -1016,6 +996,12 @@ int addHAWQSegWithSegStat(SegStat segstat, bool *capstatchanged)
 						  hostaddrkey.Len, hostaddrkey.Array,
 						  hostname);
 			}
+			else
+			{
+				elog(WARNING, "Resource manager ignored ip address '%.*s' for host '%s'",
+						      hostaddrkey.Len, hostaddrkey.Array,
+							  hostname);
+			}
 		}
 		appendSMBStr(&logcontent, "");
 


Mime
View raw message