sync integration add error code

This commit is contained in:
Minghao Li 2022-04-20 16:56:00 +08:00
parent bf3fd9b9c3
commit a1a498a19a
3 changed files with 14 additions and 10 deletions

View File

@ -407,6 +407,10 @@ int32_t* taosGetErrno();
#define TSDB_CODE_SYN_INVALID_MSGLEN TAOS_DEF_ERROR_CODE(0, 0x0909)
#define TSDB_CODE_SYN_INVALID_MSGTYPE TAOS_DEF_ERROR_CODE(0, 0x090A)
// sync integration
#define TSDB_CODE_SYN_NOT_LEADER TAOS_DEF_ERROR_CODE(0, 0x0910)
#define TSDB_CODE_SYN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x09FF)
// tq
#define TSDB_CODE_TQ_INVALID_CONFIG TAOS_DEF_ERROR_CODE(0, 0x0A00)
#define TSDB_CODE_TQ_INIT_FAILED TAOS_DEF_ERROR_CODE(0, 0x0A01)

View File

@ -153,10 +153,10 @@ static void vmProcessWriteQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
int32_t ret = syncPropose(vnodeGetSyncHandle(pVnode->pImpl), pRpc, false);
if (ret == TAOS_SYNC_PROPOSE_NOT_LEADER) {
rsp.code = -1;
rsp.code = TSDB_CODE_SYN_NOT_LEADER;
tmsgSendRsp(&rsp);
} else if (ret == TAOS_SYNC_PROPOSE_OTHER_ERROR) {
rsp.code = -2;
rsp.code = TSDB_CODE_SYN_INTERNAL_ERROR;
tmsgSendRsp(&rsp);
} else if (ret == TAOS_SYNC_PROPOSE_SUCCESS) {
// ok

View File

@ -99,7 +99,7 @@ void test6() {
SRpcMsg originalRpcMsg;
syncApplyMsg2OriginalRpcMsg(pMsg2, &originalRpcMsg);
syncRpcMsgLog2((char*)"test6", &originalRpcMsg);
syncRpcMsgLog2((char *)"test6", &originalRpcMsg);
rpcFreeCont(originalRpcMsg.pCont);
rpcFreeCont(rpcMsg.pCont);