This commit is contained in:
Minghao Li 2022-03-02 16:19:15 +08:00
parent 3e591a022c
commit a2d9cd4403
2 changed files with 16 additions and 3 deletions

View File

@ -188,7 +188,7 @@ static void *syncIOConsumerFunc(void *param) {
SSyncIO *io = param; SSyncIO *io = param;
STaosQall *qall; STaosQall *qall;
SRpcMsg * pRpcMsg, rpcMsg; SRpcMsg *pRpcMsg, rpcMsg;
int type; int type;
qall = taosAllocateQall(); qall = taosAllocateQall();
@ -310,4 +310,4 @@ static void syncIOTickPingFunc(void *param, void *tmrId) {
rpcSendRequest(io->clientRpc, &io->myAddr, &rpcMsg, NULL); rpcSendRequest(io->clientRpc, &io->myAddr, &rpcMsg, NULL);
taosTmrReset(syncIOTickPingFunc, 1000, io, io->ioTimerManager, &io->ioTimerTickPing); taosTmrReset(syncIOTickPingFunc, 1000, io, io->ioTimerManager, &io->ioTimerTickPing);
} }

View File

@ -46,12 +46,25 @@ void syncUtilraftId2EpSet(const SRaftId* raftId, SEpSet* pEpSet) {
uint16_t port; uint16_t port;
syncUtilU642Addr(raftId->addr, host, sizeof(host), &port); syncUtilU642Addr(raftId->addr, host, sizeof(host), &port);
/*
pEpSet->numOfEps = 1;
pEpSet->inUse = 0;
pEpSet->eps[0].port = port;
snprintf(epSet.eps[0].fqdn, sizeof(epSet.eps[0].fqdn), host);
*/
pEpSet->inUse = 0; pEpSet->inUse = 0;
pEpSet->numOfEps = 1;
addEpIntoEpSet(pEpSet, host, port); addEpIntoEpSet(pEpSet, host, port);
} }
void syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId) { void syncUtilnodeInfo2raftId(const SNodeInfo* pNodeInfo, SyncGroupId vgId, SRaftId* raftId) {
raftId->addr = syncUtilAddr2U64(pNodeInfo->nodeFqdn, pNodeInfo->nodePort); uint32_t ipv4 = taosGetIpv4FromFqdn(pNodeInfo->nodeFqdn);
assert(ipv4 != 0xFFFFFFFF);
char ipbuf[128];
tinet_ntoa(ipbuf, ipv4);
raftId->addr = syncUtilAddr2U64(ipbuf, pNodeInfo->nodePort);
raftId->vgId = vgId; raftId->vgId = vgId;
} }