提交 94e50c41 编写于 作者: S Shengliang Guan

[TD-860]

上级 a2e97d8e
......@@ -244,19 +244,26 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
FORCE_INLINE
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
if (code > 0) return;
assert(param);
SSdbOper * pOper = param;
SMnodeMsg *pMsg = pOper->pMsg;
if (code > 0) {
if (pMsg != NULL) {
sdbDebug("app:%p:%p, waiting for slave to confirm this operation", pMsg->rpcMsg.ahandle, pMsg);
}
return;
}
if (pMsg != NULL) {
sdbDebug("app:%p:%p, is confirmed and will do callback func, code:%s", pMsg->rpcMsg.ahandle, pMsg, tstrerror(code));
}
if (pOper->cb != NULL) {
sdbDebug("app:%p:%p, is confirmed and will do callback func", pMsg->rpcMsg.ahandle, pMsg);
pOper->retCode = (*pOper->cb)(pMsg, code);
code = (*pOper->cb)(pMsg, code);
}
dnodeSendRpcMnodeWriteRsp(pMsg, pOper->retCode);
dnodeSendRpcMnodeWriteRsp(pMsg, code);
taosFreeQitem(pOper);
}
......@@ -538,9 +545,7 @@ static int sdbWrite(void *param, void *data, int type) {
}
// forward to peers, even it is WAL/FWD, it shall be called to update version in sync
void *mhandle = NULL;
if (pOper != NULL) mhandle = pOper->pMsg;
int32_t syncCode = syncForwardToPeer(tsSdbObj.sync, pHead, mhandle, TAOS_QTYPE_RPC);
int32_t syncCode = syncForwardToPeer(tsSdbObj.sync, pHead, pOper, TAOS_QTYPE_RPC);
pthread_mutex_unlock(&tsSdbObj.mutex);
if (syncCode < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册