[TD-860]
This commit is contained in:
parent
a2e97d8ec2
commit
94e50c413e
|
@ -244,19 +244,26 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
|
||||||
|
|
||||||
FORCE_INLINE
|
FORCE_INLINE
|
||||||
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
||||||
if (code > 0) return;
|
|
||||||
|
|
||||||
assert(param);
|
assert(param);
|
||||||
|
|
||||||
SSdbOper * pOper = param;
|
SSdbOper * pOper = param;
|
||||||
SMnodeMsg *pMsg = pOper->pMsg;
|
SMnodeMsg *pMsg = pOper->pMsg;
|
||||||
|
|
||||||
if (pOper->cb != NULL) {
|
if (code > 0) {
|
||||||
sdbDebug("app:%p:%p, is confirmed and will do callback func", pMsg->rpcMsg.ahandle, pMsg);
|
if (pMsg != NULL) {
|
||||||
pOper->retCode = (*pOper->cb)(pMsg, code);
|
sdbDebug("app:%p:%p, waiting for slave to confirm this operation", pMsg->rpcMsg.ahandle, pMsg);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dnodeSendRpcMnodeWriteRsp(pMsg, pOper->retCode);
|
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) {
|
||||||
|
code = (*pOper->cb)(pMsg, code);
|
||||||
|
}
|
||||||
|
|
||||||
|
dnodeSendRpcMnodeWriteRsp(pMsg, code);
|
||||||
taosFreeQitem(pOper);
|
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
|
// forward to peers, even it is WAL/FWD, it shall be called to update version in sync
|
||||||
void *mhandle = NULL;
|
int32_t syncCode = syncForwardToPeer(tsSdbObj.sync, pHead, pOper, TAOS_QTYPE_RPC);
|
||||||
if (pOper != NULL) mhandle = pOper->pMsg;
|
|
||||||
int32_t syncCode = syncForwardToPeer(tsSdbObj.sync, pHead, mhandle, TAOS_QTYPE_RPC);
|
|
||||||
pthread_mutex_unlock(&tsSdbObj.mutex);
|
pthread_mutex_unlock(&tsSdbObj.mutex);
|
||||||
|
|
||||||
if (syncCode < 0) {
|
if (syncCode < 0) {
|
||||||
|
|
Loading…
Reference in New Issue