Merge pull request #27409 from taosdata/fix/TD-31612-3.0

fix: use correct error code
This commit is contained in:
Hongze Cheng 2024-08-23 13:59:41 +08:00 committed by GitHub
commit 56045c23c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View File

@ -785,7 +785,7 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
int32_t code = syncProcessMsg(pMgmt->sync, pMsg); int32_t code = syncProcessMsg(pMgmt->sync, pMsg);
if (code != 0) { if (code != 0) {
mGError("vgId:1, failed to process sync msg:%p type:%s, errno: %s, code:0x%x", pMsg, TMSG_INFO(pMsg->msgType), mGError("vgId:1, failed to process sync msg:%p type:%s, reason: %s, code:0x%x", pMsg, TMSG_INFO(pMsg->msgType),
tstrerror(code), code); tstrerror(code), code);
} }

View File

@ -373,8 +373,8 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
int32_t code = syncProcessMsg(pVnode->sync, pMsg); int32_t code = syncProcessMsg(pVnode->sync, pMsg);
if (code != 0) { if (code != 0) {
vGError("vgId:%d, failed to process sync msg:%p type:%s, errno: %s, code:0x%x", pVnode->config.vgId, pMsg, vGError("vgId:%d, failed to process sync msg:%p type:%s, reason: %s", pVnode->config.vgId, pMsg,
TMSG_INFO(pMsg->msgType), terrstr(), code); TMSG_INFO(pMsg->msgType), tstrerror(code));
} }
return code; return code;

View File

@ -269,8 +269,8 @@ int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg) {
syncNodeRelease(pSyncNode); syncNodeRelease(pSyncNode);
if (code != 0) { if (code != 0) {
sDebug("vgId:%d, failed to process sync msg:%p type:%s since 0x%x", pSyncNode->vgId, pMsg, TMSG_INFO(pMsg->msgType), sDebug("vgId:%d, failed to process sync msg:%p type:%s since %s", pSyncNode->vgId, pMsg, TMSG_INFO(pMsg->msgType),
code); tstrerror(code));
} }
TAOS_RETURN(code); TAOS_RETURN(code);
} }

View File

@ -95,7 +95,7 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
if (!syncNodeInRaftGroup(ths, &pMsg->srcId)) { if (!syncNodeInRaftGroup(ths, &pMsg->srcId)) {
syncLogRecvRequestVote(ths, pMsg, -1, "not in my config"); syncLogRecvRequestVote(ths, pMsg, -1, "not in my config");
TAOS_RETURN(TSDB_CODE_FAILED); TAOS_RETURN(TSDB_CODE_SYN_MISMATCHED_SIGNATURE);
} }
bool logOK = syncNodeOnRequestVoteLogOK(ths, pMsg); bool logOK = syncNodeOnRequestVoteLogOK(ths, pMsg);

View File

@ -46,7 +46,7 @@ int32_t syncNodeOnRequestVoteReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
if (!syncNodeInRaftGroup(ths, &(pMsg->srcId))) { if (!syncNodeInRaftGroup(ths, &(pMsg->srcId))) {
syncLogRecvRequestVoteReply(ths, pMsg, "not in my config"); syncLogRecvRequestVoteReply(ths, pMsg, "not in my config");
TAOS_RETURN(TSDB_CODE_FAILED); TAOS_RETURN(TSDB_CODE_SYN_MISMATCHED_SIGNATURE);
} }
SyncTerm currentTerm = raftStoreGetTerm(ths); SyncTerm currentTerm = raftStoreGetTerm(ths);
// drop stale response // drop stale response