refactor(sync): add trace log
This commit is contained in:
parent
b25840ebd4
commit
b60fde8f73
|
@ -561,8 +561,8 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, const SRpcMsg* pMsg, bool isWeak)
|
||||||
stub.createTime = taosGetTimestampMs();
|
stub.createTime = taosGetTimestampMs();
|
||||||
stub.rpcMsg = *pMsg;
|
stub.rpcMsg = *pMsg;
|
||||||
uint64_t seqNum = syncRespMgrAdd(pSyncNode->pSyncRespMgr, &stub);
|
uint64_t seqNum = syncRespMgrAdd(pSyncNode->pSyncRespMgr, &stub);
|
||||||
sDebug("vgId:%d sync event propose, type:%s seq:%" PRIu64 " handle:%p", pSyncNode->vgId, TMSG_INFO(pMsg->msgType),
|
sDebug("vgId:%d sync event resp mgr add, type:%s seq:%" PRIu64 " handle:%p", pSyncNode->vgId,
|
||||||
seqNum, pMsg->info.handle);
|
TMSG_INFO(pMsg->msgType), seqNum, pMsg->info.handle);
|
||||||
|
|
||||||
SyncClientRequest* pSyncMsg = syncClientRequestBuild2(pMsg, seqNum, isWeak, pSyncNode->vgId);
|
SyncClientRequest* pSyncMsg = syncClientRequestBuild2(pMsg, seqNum, isWeak, pSyncNode->vgId);
|
||||||
SRpcMsg rpcMsg;
|
SRpcMsg rpcMsg;
|
||||||
|
@ -771,7 +771,7 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
pSyncNode->pSyncRespMgr = syncRespMgrCreate(NULL, 0);
|
pSyncNode->pSyncRespMgr = syncRespMgrCreate(pSyncNode, 0);
|
||||||
assert(pSyncNode->pSyncRespMgr != NULL);
|
assert(pSyncNode->pSyncRespMgr != NULL);
|
||||||
|
|
||||||
// restore state
|
// restore state
|
||||||
|
|
|
@ -63,6 +63,11 @@ int32_t syncRespMgrGet(SSyncRespMgr *pObj, uint64_t index, SRespStub *pStub) {
|
||||||
void *pTmp = taosHashGet(pObj->pRespHash, &index, sizeof(index));
|
void *pTmp = taosHashGet(pObj->pRespHash, &index, sizeof(index));
|
||||||
if (pTmp != NULL) {
|
if (pTmp != NULL) {
|
||||||
memcpy(pStub, pTmp, sizeof(SRespStub));
|
memcpy(pStub, pTmp, sizeof(SRespStub));
|
||||||
|
|
||||||
|
SSyncNode *pSyncNode = pObj->data;
|
||||||
|
sDebug("vgId:%d sync event resp mgr get, type:%s seq:%lu handle:%p", pSyncNode->vgId,
|
||||||
|
TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle);
|
||||||
|
|
||||||
taosThreadMutexUnlock(&(pObj->mutex));
|
taosThreadMutexUnlock(&(pObj->mutex));
|
||||||
return 1; // get one object
|
return 1; // get one object
|
||||||
}
|
}
|
||||||
|
@ -76,6 +81,11 @@ int32_t syncRespMgrGetAndDel(SSyncRespMgr *pObj, uint64_t index, SRespStub *pStu
|
||||||
void *pTmp = taosHashGet(pObj->pRespHash, &index, sizeof(index));
|
void *pTmp = taosHashGet(pObj->pRespHash, &index, sizeof(index));
|
||||||
if (pTmp != NULL) {
|
if (pTmp != NULL) {
|
||||||
memcpy(pStub, pTmp, sizeof(SRespStub));
|
memcpy(pStub, pTmp, sizeof(SRespStub));
|
||||||
|
|
||||||
|
SSyncNode *pSyncNode = pObj->data;
|
||||||
|
sDebug("vgId:%d sync event resp mgr get and del, type:%s seq:%lu handle:%p", pSyncNode->vgId,
|
||||||
|
TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle);
|
||||||
|
|
||||||
taosHashRemove(pObj->pRespHash, &index, sizeof(index));
|
taosHashRemove(pObj->pRespHash, &index, sizeof(index));
|
||||||
taosThreadMutexUnlock(&(pObj->mutex));
|
taosThreadMutexUnlock(&(pObj->mutex));
|
||||||
return 1; // get one object
|
return 1; // get one object
|
||||||
|
|
Loading…
Reference in New Issue