From 6f6fc46b0df5338df6ac6a19ff3b6c20ec36a7ed Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 7 Dec 2020 10:53:21 +0800 Subject: [PATCH] [TD-2165]: fix bugs in cancel query. --- src/dnode/src/dnodeVRead.c | 1 + src/vnode/src/vnodeRead.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dnode/src/dnodeVRead.c b/src/dnode/src/dnodeVRead.c index b42a627a3a..85d6d204fc 100644 --- a/src/dnode/src/dnodeVRead.c +++ b/src/dnode/src/dnodeVRead.c @@ -92,6 +92,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) { pHead->vgId = htonl(pHead->vgId); pHead->contLen = htonl(pHead->contLen); + assert(pHead->contLen > 0); void *pVnode = vnodeAcquire(pHead->vgId); if (pVnode != NULL) { int32_t code = vnodeWriteToRQueue(pVnode, pCont, pHead->contLen, TAOS_QTYPE_RPC, pMsg); diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index af67e24b90..9f205da042 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -415,7 +415,7 @@ int32_t vnodeNotifyCurrentQhandle(void *handle, void *qhandle, int32_t vgId) { pCancelMsg->header.contLen = htonl(sizeof(SCancelQueryMsg)); vDebug("QInfo:%p register qhandle to connect:%p", qhandle, handle); - return rpcReportProgress(handle, (char *)pCancelMsg, sizeof(SRetrieveTableMsg)); + return rpcReportProgress(handle, (char *)pCancelMsg, sizeof(SCancelQueryMsg)); } int32_t vnodeProcessCancelMsg(SVnodeObj *pVnode, SVReadMsg *pRead) { @@ -451,6 +451,5 @@ int32_t vnodeProcessCancelMsg(SVnodeObj *pVnode, SVReadMsg *pRead) { qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true); vnodeBuildNoResultQueryRsp(pRet); - code = TSDB_CODE_TSC_QUERY_CANCELLED; - return code; + return TSDB_CODE_TSC_QUERY_CANCELLED; } -- GitLab