diff --git a/src/dnode/src/dnodeVRead.c b/src/dnode/src/dnodeVRead.c index f8a31d568e314c0d9dd0def34bcff42f687f8777..85ed194976f71b6f372d52607f81b1e94e78f87d 100644 --- a/src/dnode/src/dnodeVRead.c +++ b/src/dnode/src/dnodeVRead.c @@ -49,7 +49,7 @@ static taos_qset readQset; int32_t dnodeInitVnodeRead() { readQset = taosOpenQset(); - readPool.min = 2; + readPool.min = 4; readPool.max = tsNumOfCores * tsNumOfThreadsPerCore; if (readPool.max <= readPool.min * 2) readPool.max = 2 * readPool.min; readPool.readWorker = (SReadWorker *)calloc(sizeof(SReadWorker), readPool.max); diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index c4142f5d93949e63f466d10b6ba99ec284b2a0bc..6de300400e53de5e0f517bd814700527ab2a187f 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6352,7 +6352,6 @@ bool qTableQuery(qinfo_t qinfo) { pQInfo, pQuery->rec.rows, pQuery->rec.total + pQuery->rec.rows); } -// pQInfo->dataReady = QUERY_RESULT_READY; bool buildRes = false; pthread_mutex_lock(&pQInfo->lock); pQInfo->dataReady = QUERY_RESULT_READY; @@ -6360,8 +6359,9 @@ bool qTableQuery(qinfo_t qinfo) { if (pQInfo->rspContext != NULL) { buildRes = true; } - pthread_mutex_unlock(&pQInfo->lock); + + pthread_mutex_unlock(&pQInfo->lock); return buildRes; // sem_post(&pQInfo->dataReady); } @@ -6387,12 +6387,11 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex qDebug("QInfo:%p retrieve result info, rowsize:%d, rows:%"PRId64", code:%d", pQInfo, pQuery->rowSize, pQuery->rec.rows, pQInfo->code); } else { + qDebug("QInfo:%p retrieve req set query return result after paused", pQInfo); pQInfo->rspContext = pRspContext; } pthread_mutex_unlock(&pQInfo->lock); - -// sem_wait(&pQInfo->dataReady); return pQInfo->code; } diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index 542c132e0340cf23d17529b77f071a8c3bc2181a..5edfcf597cb5143d08c48aa2c764eac5f492d7a4 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -163,18 +163,21 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) { code = TSDB_CODE_QRY_INVALID_QHANDLE; } else { vDebug("vgId:%d, QInfo:%p, dnode continue exec query", pVnode->vgId, (void*) pCont); - code = TSDB_CODE_VND_ACTION_IN_PROGRESS; bool buildRes = qTableQuery(*handle); // do execute query if (buildRes) { // build result rsp + vDebug("vgId:%d, QInfo:%p, start to build result rsp after query paused", pVnode->vgId, *handle); + pRet = &pReadMsg->rspRet; bool continueExec = false; + code = TSDB_CODE_QRY_HAS_RSP; if ((code = qDumpRetrieveResult(*handle, (SRetrieveTableRsp **)&pRet->rsp, &pRet->len, &continueExec)) == TSDB_CODE_SUCCESS) { + if (continueExec) { vnodePutItemIntoReadQueue(pVnode, *handle, pReadMsg->rpcMsg.handle); pRet->qhandle = *handle; - + code = TSDB_CODE_SUCCESS; } } else { // todo handle error }