提交 a701451a 编写于 作者: M Minghao Li

refactor(sync): add trace log

上级 9786ba2f
......@@ -1455,6 +1455,17 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde
isAdd = false;
}
// log begin config change
do {
char eventLog[256];
char* pOldCfgStr = syncCfg2SimpleStr(&oldConfig);
char* pNewCfgStr = syncCfg2SimpleStr(pNewConfig);
snprintf(eventLog, sizeof(eventLog), "begin do config change, from %s to %s", pOldCfgStr, pNewCfgStr);
syncNodeEventLog(pSyncNode, eventLog);
taosMemoryFree(pOldCfgStr);
taosMemoryFree(pNewCfgStr);
} while (0);
if (IamInNew) {
pSyncNode->pRaftCfg->isStandBy = 0; // change isStandBy to normal
}
......@@ -1613,6 +1624,17 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde
}
_END:
// log end config change
do {
char eventLog[256];
char* pOldCfgStr = syncCfg2SimpleStr(&oldConfig);
char* pNewCfgStr = syncCfg2SimpleStr(pNewConfig);
snprintf(eventLog, sizeof(eventLog), "end do config change, from %s to %s", pOldCfgStr, pNewCfgStr);
syncNodeEventLog(pSyncNode, eventLog);
taosMemoryFree(pOldCfgStr);
taosMemoryFree(pNewCfgStr);
} while (0);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册