refactor(sync): add debug log
This commit is contained in:
parent
aad288ab17
commit
34c906a1e1
|
@ -219,15 +219,22 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) {
|
||||||
SRaftId newId;
|
SRaftId newId;
|
||||||
newId.addr = syncUtilAddr2U64((pNewCfg->nodeInfo)[i].nodeFqdn, (pNewCfg->nodeInfo)[i].nodePort);
|
newId.addr = syncUtilAddr2U64((pNewCfg->nodeInfo)[i].nodeFqdn, (pNewCfg->nodeInfo)[i].nodePort);
|
||||||
newId.vgId = pSyncNode->vgId;
|
newId.vgId = pSyncNode->vgId;
|
||||||
|
|
||||||
|
sTrace("new[%d]: %lu, %d, my: %lu, %d", i, newId.addr, newId.vgId, pSyncNode->myRaftId.addr, pSyncNode->myRaftId.vgId);
|
||||||
|
|
||||||
if (syncUtilSameId(&(pSyncNode->myRaftId), &newId)) {
|
if (syncUtilSameId(&(pSyncNode->myRaftId), &newId)) {
|
||||||
IamInNew = true;
|
IamInNew = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!IamInNew) {
|
if (!IamInNew) {
|
||||||
|
sError("sync reconfig error, not in new config");
|
||||||
taosReleaseRef(tsNodeRefId, pSyncNode->rid);
|
taosReleaseRef(tsNodeRefId, pSyncNode->rid);
|
||||||
return TAOS_SYNC_NOT_IN_NEW_CONFIG;
|
return TAOS_SYNC_NOT_IN_NEW_CONFIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char* newconfig = syncCfg2Str((SSyncCfg*)pNewCfg);
|
char* newconfig = syncCfg2Str((SSyncCfg*)pNewCfg);
|
||||||
if (gRaftDetailLog) {
|
if (gRaftDetailLog) {
|
||||||
sInfo("==syncReconfig== newconfig:%s", newconfig);
|
sInfo("==syncReconfig== newconfig:%s", newconfig);
|
||||||
|
|
Loading…
Reference in New Issue