ehn/vnode-open-log-fix-review
This commit is contained in:
parent
a7fdabb6d7
commit
246a375cc2
|
@ -104,10 +104,10 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
|
|||
goto _IGNORE;
|
||||
}
|
||||
|
||||
int32_t nRef = atomic_fetch_add_32(&ths->recvCount, 1);
|
||||
if (nRef < 0) {
|
||||
sError("vgId:%d, recv count is %d", ths->vgId, nRef);
|
||||
}
|
||||
int32_t nRef = atomic_add_fetch_32(&ths->recvCount, 1);
|
||||
if (nRef <= 0) {
|
||||
sError("vgId:%d, recv count is %d", ths->vgId, nRef);
|
||||
}
|
||||
|
||||
int32_t code = syncBuildAppendEntriesReply(&rpcRsp, ths->vgId);
|
||||
if (code != 0) {
|
||||
|
|
|
@ -90,16 +90,16 @@ int32_t syncNodeSendAppendEntries(SSyncNode* pSyncNode, const SRaftId* destRaftI
|
|||
|
||||
int32_t nRef = 0;
|
||||
if (pSyncNode != NULL) {
|
||||
nRef = atomic_fetch_add_32(&pSyncNode->sendCount, 1);
|
||||
if (nRef < 0) {
|
||||
nRef = atomic_add_fetch_32(&pSyncNode->sendCount, 1);
|
||||
if (nRef <= 0) {
|
||||
sError("vgId:%d, send count is %d", pSyncNode->vgId, nRef);
|
||||
}
|
||||
}
|
||||
|
||||
SSyncLogReplMgr* mgr = syncNodeGetLogReplMgr(pSyncNode, (SRaftId*)destRaftId);
|
||||
if (mgr != NULL) {
|
||||
nRef = atomic_fetch_add_32(&mgr->sendCount, 1);
|
||||
if (nRef < 0) {
|
||||
nRef = atomic_add_fetch_32(&mgr->sendCount, 1);
|
||||
if (nRef <= 0) {
|
||||
sError("vgId:%d, send count is %d", pSyncNode->vgId, nRef);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue