This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 3c6780c fix:In a cluster environment, verify that nodes have matching
bug.
new dce7441 Merge pull request #1611 from wenhemin/fixbug-20191227
3c6780c is described below
commit 3c6780c3cd155e357b21879bd2c1b99d6e7713c8
Author: 温合民 <[email protected]>
AuthorDate: Fri Dec 27 16:53:51 2019 +0800
fix:In a cluster environment, verify that nodes have matching bug.
---
.../java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
index 5b937ce..0e95ddd 100644
---
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
+++
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
@@ -144,7 +144,7 @@ public abstract class AbstractZKClient extends
ZookeeperCachedOperator{
String parentPath = getZNodeParentPath(zkNodeType);
String serverPathPrefix = parentPath + "/" + OSUtils.getHost();
String registerPath =
zkClient.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath(
- serverPathPrefix + "_",
heartbeatZKInfo.getBytes());
+ serverPathPrefix + UNDERLINE,
heartbeatZKInfo.getBytes());
logger.info("register {} node {} success" ,
zkNodeType.toString(), registerPath);
return registerPath;
}
@@ -307,7 +307,7 @@ public abstract class AbstractZKClient extends
ZookeeperCachedOperator{
}
Map<String, String> serverMaps = getServerMaps(zkNodeType);
for(String hostKey : serverMaps.keySet()){
- if(hostKey.startsWith(host)){
+ if(hostKey.startsWith(host + UNDERLINE)){
return true;
}
}