提交 1b9b49c9 编写于 作者: S Shengliang Guan

modify the clusterId generation method

上级 fad58e87
......@@ -124,12 +124,11 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
if (code != 0) {
strcpy(clusterObj.name, "tdengine2.0");
mError("failed to get name from system, set to default val %s", clusterObj.name);
} else {
mDebug("cluster:%" PRId64 ", name is %s", clusterObj.id, clusterObj.name);
}
clusterObj.id = MurmurHash3_32(clusterObj.name, TSDB_CLUSTER_ID_LEN);
clusterObj.id = mndGenerateUid(clusterObj.name, TSDB_CLUSTER_ID_LEN);
clusterObj.id = (clusterObj.id >= 0 ? clusterObj.id : -clusterObj.id);
pMnode->clusterId = clusterObj.id;
mDebug("cluster:%" PRId64 ", name is %s", clusterObj.id, clusterObj.name);
SSdbRaw *pRaw = mndClusterActionEncode(&clusterObj);
if (pRaw == NULL) return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册