add version check in rpc
This commit is contained in:
parent
79f01ad655
commit
af053ec75b
|
@ -77,6 +77,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
||||||
int32_t svrVer = 0;
|
int32_t svrVer = 0;
|
||||||
taosVersionStrToInt(version, &svrVer);
|
taosVersionStrToInt(version, &svrVer);
|
||||||
if (0 != taosCheckVersionCompatible(pRpc->info.cliVer, svrVer, 3)) {
|
if (0 != taosCheckVersionCompatible(pRpc->info.cliVer, svrVer, 3)) {
|
||||||
|
dError("msg ver: %d, curr ver: %d", pRpc->info.cliVer, svrVer);
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -391,6 +391,7 @@ void cliHandleResp(SCliConn* conn) {
|
||||||
transMsg.info.ahandle = NULL;
|
transMsg.info.ahandle = NULL;
|
||||||
transMsg.info.traceId = pHead->traceId;
|
transMsg.info.traceId = pHead->traceId;
|
||||||
transMsg.info.hasEpSet = pHead->hasEpSet;
|
transMsg.info.hasEpSet = pHead->hasEpSet;
|
||||||
|
transMsg.info.cliVer = pHead->compatibilityVer;
|
||||||
|
|
||||||
SCliMsg* pMsg = NULL;
|
SCliMsg* pMsg = NULL;
|
||||||
STransConnCtx* pCtx = NULL;
|
STransConnCtx* pCtx = NULL;
|
||||||
|
|
|
@ -196,6 +196,7 @@ static bool uvHandleReq(SSvrConn* pConn) {
|
||||||
tError("%s conn %p recv invalid packet, failed to decompress", transLabel(pTransInst), pConn);
|
tError("%s conn %p recv invalid packet, failed to decompress", transLabel(pTransInst), pConn);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
tDebug("head version: %d 2", pHead->version);
|
||||||
|
|
||||||
pHead->code = htonl(pHead->code);
|
pHead->code = htonl(pHead->code);
|
||||||
pHead->msgLen = htonl(pHead->msgLen);
|
pHead->msgLen = htonl(pHead->msgLen);
|
||||||
|
@ -411,7 +412,7 @@ static int uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
|
||||||
pHead->traceId = pMsg->info.traceId;
|
pHead->traceId = pMsg->info.traceId;
|
||||||
pHead->hasEpSet = pMsg->info.hasEpSet;
|
pHead->hasEpSet = pMsg->info.hasEpSet;
|
||||||
pHead->magicNum = htonl(TRANS_MAGIC_NUM);
|
pHead->magicNum = htonl(TRANS_MAGIC_NUM);
|
||||||
pHead->compatibilityVer = 0;
|
pHead->compatibilityVer = ((STrans*)pConn->pTransInst)->compatibilityVer;
|
||||||
pHead->version = TRANS_VER;
|
pHead->version = TRANS_VER;
|
||||||
|
|
||||||
// handle invalid drop_task resp, TD-20098
|
// handle invalid drop_task resp, TD-20098
|
||||||
|
|
Loading…
Reference in New Issue