提交 f538fe33 编写于 作者: S Shengliang Guan

TD-2331

上级 eede5a77
......@@ -202,7 +202,7 @@ void mnodeCancelGetNextMnode(void *pIter) {
void mnodeUpdateMnodeEpSet(SMInfos *pMinfos) {
bool set = false;
SMInfos mInfos = {0};
mInfo("vgId:1, update mnodes epSet, numOfEps:%d pMinfos:%p", mnodeGetMnodesNum(), pMinfos);
mInfo("vgId:1, update mnodes epSet, numOfMnodes:%d pMinfos:%p", mnodeGetMnodesNum(), pMinfos);
if (pMinfos != NULL) {
set = true;
......@@ -232,9 +232,9 @@ void mnodeUpdateMnodeEpSet(SMInfos *pMinfos) {
}
mInfos.mnodeNum = index;
if (sdbGetReplicaNum() != mInfos.mnodeNum) {
if (mInfos.mnodeNum < sdbGetReplicaNum()) {
set = false;
mDebug("vgId:1, mnodes info not synced, cfg:%d current:%d", sdbGetReplicaNum(), mInfos.mnodeNum);
mDebug("vgId:1, mnodes info not synced, current:%d syncCfgNum:%d", mInfos.mnodeNum, sdbGetReplicaNum());
}
}
......@@ -316,15 +316,13 @@ void mnodeGetMnodeInfos(void *pMinfos) {
}
static int32_t mnodeSendCreateMnodeMsg(int32_t dnodeId, char *dnodeEp) {
mDebug("dnode:%d, send create mnode msg to dnode %s", dnodeId, dnodeEp);
SCreateMnodeMsg *pCreate = rpcMallocCont(sizeof(SCreateMnodeMsg));
if (pCreate == NULL) {
return TSDB_CODE_MND_OUT_OF_MEMORY;
} else {
pCreate->dnodeId = htonl(dnodeId);
tstrncpy(pCreate->dnodeEp, dnodeEp, sizeof(pCreate->dnodeEp));
pCreate->mnodes = tsMInfos;
mnodeGetMnodeInfos(&pCreate->mnodes);
bool found = false;
for (int i = 0; i < pCreate->mnodes.mnodeNum; ++i) {
if (pCreate->mnodes.mnodeInfos[i].mnodeId == htonl(dnodeId)) {
......@@ -338,6 +336,11 @@ static int32_t mnodeSendCreateMnodeMsg(int32_t dnodeId, char *dnodeEp) {
}
}
mDebug("dnode:%d, send create mnode msg to dnode %s, numOfMnodes:%d", dnodeId, dnodeEp, pCreate->mnodes.mnodeNum);
for (int32_t i = 0; i < pCreate->mnodes.mnodeNum; ++i) {
mDebug("index:%d, mnodeId:%d ep:%s", i, pCreate->mnodes.mnodeInfos[i].mnodeId, pCreate->mnodes.mnodeInfos[i].mnodeEp);
}
SRpcMsg rpcMsg = {0};
rpcMsg.pCont = pCreate;
rpcMsg.contLen = sizeof(SCreateMnodeMsg);
......
......@@ -344,7 +344,7 @@ void sdbUpdateSync(void *pMnodes) {
}
syncCfg.replica = index;
} else {
mDebug("vgId:1, mInfos input, numOfMnodes:%d", syncCfg.replica);
mDebug("vgId:1, mInfos input, numOfMnodes:%d", pMinfos->mnodeNum);
for (index = 0; index < pMinfos->mnodeNum; ++index) {
SMInfo *node = &pMinfos->mnodeInfos[index];
......
......@@ -1134,7 +1134,7 @@ static void syncProcessIncommingConnection(int32_t connFd, uint32_t sourceIp) {
pPeer = (i < pNode->replica) ? pNode->peerInfo[i] : NULL;
if (pPeer == NULL) {
sError("vgId:%d, peer:%s not configured", pNode->vgId, firstPkt.fqdn);
sError("vgId:%d, peer:%s:%u not configured", pNode->vgId, firstPkt.fqdn, firstPkt.port);
taosCloseSocket(connFd);
// syncSendVpeerCfgMsg(sync);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册