diff --git a/docs/en/05-get-started/03-package.md b/docs/en/05-get-started/03-package.md index b0400de67388a433355358d827aa41f35598655c..292fa82183b5fb6d8c3449a5282e360f4841710a 100644 --- a/docs/en/05-get-started/03-package.md +++ b/docs/en/05-get-started/03-package.md @@ -111,7 +111,7 @@ Note: TDengine only supports Windows Server 2016/2019 and Windows 10/11 on the W :::info -For information about TDengine releases, see [Release History](../../releases). +For information about TDengine releases, see [Release History](../../releases/tdengine). ::: :::note diff --git a/docs/en/14-reference/03-connector/_linux_install.mdx b/docs/en/14-reference/03-connector/_linux_install.mdx index 07f8fb5c7118d84c53017f44d9811a3357944cfc..97f6cd333961d24bd015a2ebcf7223f89fecca2c 100644 --- a/docs/en/14-reference/03-connector/_linux_install.mdx +++ b/docs/en/14-reference/03-connector/_linux_install.mdx @@ -4,7 +4,7 @@ import PkgListV3 from "/components/PkgListV3"; - [All Downloads](../../releases) + [All Downloads](../../releases/tdengine) 2. Unzip diff --git a/docs/en/14-reference/03-connector/_windows_install.mdx b/docs/en/14-reference/03-connector/_windows_install.mdx index ea638ed1ed6c64c3ec4ceaea436f65dd1f09a27e..81fc5573bb85c6fd1b501f1ff4ec072df8f23db1 100644 --- a/docs/en/14-reference/03-connector/_windows_install.mdx +++ b/docs/en/14-reference/03-connector/_windows_install.mdx @@ -4,7 +4,7 @@ import PkgListV3 from "/components/PkgListV3"; - [All Downloads](../../releases) + [All Downloads](../../releases/tdengine) 2. Execute the installer, select the default value as prompted, and complete the installation 3. Installation path diff --git a/docs/en/14-reference/04-taosadapter.md b/docs/en/14-reference/04-taosadapter.md index e7ea620d0bed3aee3ff0acf8063120acca33c335..78c4febb92f11225ad2aa82630f4892f6e786a4d 100644 --- a/docs/en/14-reference/04-taosadapter.md +++ b/docs/en/14-reference/04-taosadapter.md @@ -30,7 +30,7 @@ taosAdapter provides the following features. ### Install taosAdapter -If you use the TDengine server, you don't need additional steps to install taosAdapter. You can download taosAdapter from [TDengine 3.0 released versions](../../releases) to download the TDengine server installation package. If you need to deploy taosAdapter separately on another server other than the TDengine server, you should install the full TDengine server package on that server to install taosAdapter. If you need to build taosAdapter from source code, you can refer to the [Building taosAdapter]( https://github.com/taosdata/taosadapter/blob/3.0/BUILD.md) documentation. +If you use the TDengine server, you don't need additional steps to install taosAdapter. You can download taosAdapter from [TDengine 3.0 released versions](../../releases/tdengine) to download the TDengine server installation package. If you need to deploy taosAdapter separately on another server other than the TDengine server, you should install the full TDengine server package on that server to install taosAdapter. If you need to build taosAdapter from source code, you can refer to the [Building taosAdapter]( https://github.com/taosdata/taosadapter/blob/3.0/BUILD.md) documentation. ### Start/Stop taosAdapter diff --git a/docs/en/28-releases.md b/docs/en/28-releases.md deleted file mode 100644 index a0c9eb119999571fb973b5e2243f237b8833b167..0000000000000000000000000000000000000000 --- a/docs/en/28-releases.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_label: Releases -title: Released Versions ---- - -import Release from "/components/ReleaseV3"; - - - diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md new file mode 100644 index 0000000000000000000000000000000000000000..e3901114d3271d040934f0a211135beecbdc2f7f --- /dev/null +++ b/docs/en/28-releases/01-tdengine.md @@ -0,0 +1,17 @@ +--- +sidebar_label: TDengine +title: TDengine +description: TDengine release history, Release Notes and download links. +--- + +import Release from "/components/ReleaseV3"; + + +## 3.0.1.1 + + + +## 3.0.1.0 + + + diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md new file mode 100644 index 0000000000000000000000000000000000000000..228990df3b15bf7ee111433994813dbb171843ab --- /dev/null +++ b/docs/en/28-releases/02-tools.md @@ -0,0 +1,15 @@ +--- +sidebar_label: taosTools +title: taosTools +description: taosTools release history, Release Notes, download links. +--- + +import Release from "/components/ReleaseV3"; + +## 2.2.0 + + + +## 2.1.3 + + diff --git a/docs/en/28-releases/_category_.yml b/docs/en/28-releases/_category_.yml new file mode 100644 index 0000000000000000000000000000000000000000..c1638352061f083c3b283d7517466fef5abdc9ea --- /dev/null +++ b/docs/en/28-releases/_category_.yml @@ -0,0 +1 @@ +label: Releases \ No newline at end of file diff --git a/docs/zh/05-get-started/03-package.md b/docs/zh/05-get-started/03-package.md index 66863d1bd9419e6d8fc78cf1536e1efac38885d6..2c857d37f3a8591316949f9a7440a115740a8e2d 100644 --- a/docs/zh/05-get-started/03-package.md +++ b/docs/zh/05-get-started/03-package.md @@ -73,6 +73,7 @@ install.sh 安装脚本在执行过程中,会通过命令行交互界面询问 + 可以使用 `apt-get` 工具从官方仓库安装。 **配置包仓库** diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 063b33f3a915af2f370f56371698769271cf906d..817089f23796ba218988205e939adae8cdc97d37 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -285,8 +285,8 @@ int32_t tsdbDelFReaderClose(SDelFReader **ppReader); int32_t tsdbReadDelData(SDelFReader *pReader, SDelIdx *pDelIdx, SArray *aDelData); int32_t tsdbReadDelIdx(SDelFReader *pReader, SArray *aDelIdx); // tsdbRead.c ============================================================================================== -int32_t tsdbTakeReadSnap(STsdb *pTsdb, STsdbReadSnap **ppSnap); -void tsdbUntakeReadSnap(STsdb *pTsdb, STsdbReadSnap *pSnap); +int32_t tsdbTakeReadSnap(STsdb *pTsdb, STsdbReadSnap **ppSnap, const char* id); +void tsdbUntakeReadSnap(STsdb *pTsdb, STsdbReadSnap *pSnap, const char* id); // tsdbMerge.c ============================================================================================== int32_t tsdbMerge(STsdb *pTsdb); diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 8da783a5bd82ccd23fe051e76396489cc6516058..8452d14c869f1a41c81b904b90e13a49169f8f1e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -847,7 +847,7 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs tb_uid_t suid = getTableSuidByUid(uid, pTsdb); - tsdbTakeReadSnap(pTsdb, &pIter->pReadSnap); + tsdbTakeReadSnap(pTsdb, &pIter->pReadSnap, NULL); STbData *pMem = NULL; if (pIter->pReadSnap->pMem) { @@ -941,7 +941,7 @@ static int32_t nextRowIterClose(CacheNextRowIter *pIter) { taosArrayDestroy(pIter->pSkyline); } - tsdbUntakeReadSnap(pIter->pTsdb, pIter->pReadSnap); + tsdbUntakeReadSnap(pIter->pTsdb, pIter->pReadSnap, NULL); _err: return code; diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index e94cdfde37fc9f6ff3f0006947e39e48c5cd9065..14dbfbd63e9019ee06fd2b70e412fb4dad277f5b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2096,8 +2096,10 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { // it is a clean block, load it directly if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pBlockScanInfo, keyInBuf, pLastBlockReader)) { - copyBlockDataToSDataBlock(pReader, pBlockScanInfo); - goto _end; + if (pReader->order == TSDB_ORDER_ASC || (pReader->order == TSDB_ORDER_DESC && (!hasDataInLastBlock(pLastBlockReader)))) { + copyBlockDataToSDataBlock(pReader, pBlockScanInfo); + goto _end; + } } } else { // file blocks not exist pBlockScanInfo = pReader->status.pTableIter; @@ -3360,7 +3362,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl goto _err; } - code = tsdbTakeReadSnap(pReader->pTsdb, &pReader->pReadSnap); + code = tsdbTakeReadSnap(pReader->pTsdb, &pReader->pReadSnap, pReader->idStr); if (code != TSDB_CODE_SUCCESS) { goto _err; } @@ -3384,7 +3386,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl STsdbReader* pPrevReader = pReader->innerReader[0]; SDataBlockIter* pBlockIter = &pPrevReader->status.blockIter; - code = tsdbTakeReadSnap(pPrevReader->pTsdb, &pPrevReader->pReadSnap); + code = tsdbTakeReadSnap(pPrevReader->pTsdb, &pPrevReader->pReadSnap, pReader->idStr); if (code != TSDB_CODE_SUCCESS) { goto _err; } @@ -3441,7 +3443,7 @@ void tsdbReaderClose(STsdbReader* pReader) { tsdbDataFReaderClose(&pReader->pFileReader); } - tsdbUntakeReadSnap(pReader->pTsdb, pReader->pReadSnap); + tsdbUntakeReadSnap(pReader->pTsdb, pReader->pReadSnap, pReader->idStr); taosMemoryFree(pReader->status.uidCheckInfo.tableUidList); SIOCostSummary* pCost = &pReader->cost; @@ -3717,8 +3719,8 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) { } } - tsdbDebug("%p reset reader, suid:%" PRIu64 ", numOfTables:%d, query range:%" PRId64 " - %" PRId64 " in query %s", - pReader, pReader->suid, numOfTables, pReader->window.skey, pReader->window.ekey, pReader->idStr); + tsdbDebug("%p reset reader, suid:%" PRIu64 ", numOfTables:%d, skey:%"PRId64", query range:%" PRId64 " - %" PRId64 " in query %s", + pReader, pReader->suid, numOfTables, pCond->twindows.skey, pReader->window.skey, pReader->window.ekey, pReader->idStr); return code; } @@ -3863,7 +3865,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6 return TSDB_CODE_SUCCESS; } -int32_t tsdbTakeReadSnap(STsdb* pTsdb, STsdbReadSnap** ppSnap) { +int32_t tsdbTakeReadSnap(STsdb* pTsdb, STsdbReadSnap** ppSnap, const char* idStr) { int32_t code = 0; // alloc @@ -3906,12 +3908,12 @@ int32_t tsdbTakeReadSnap(STsdb* pTsdb, STsdbReadSnap** ppSnap) { goto _exit; } - tsdbTrace("vgId:%d, take read snapshot", TD_VID(pTsdb->pVnode)); + tsdbTrace("vgId:%d, take read snapshot, %s", TD_VID(pTsdb->pVnode), idStr); _exit: return code; } -void tsdbUntakeReadSnap(STsdb* pTsdb, STsdbReadSnap* pSnap) { +void tsdbUntakeReadSnap(STsdb* pTsdb, STsdbReadSnap* pSnap, const char* idStr) { if (pSnap) { if (pSnap->pMem) { tsdbUnrefMemTable(pSnap->pMem); @@ -3924,6 +3926,5 @@ void tsdbUntakeReadSnap(STsdb* pTsdb, STsdbReadSnap* pSnap) { tsdbFSUnref(pTsdb, &pSnap->fs); taosMemoryFree(pSnap); } - - tsdbTrace("vgId:%d, untake read snapshot", TD_VID(pTsdb->pVnode)); + tsdbTrace("vgId:%d, untake read snapshot, %s", TD_VID(pTsdb->pVnode), idStr); } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 51d83d8eedf6845e67a5ee81ff96debe52275bd1..6e9eba306a68ad91c22e5adb16e8ce5048b23903 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -533,6 +533,7 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR taosArrayPush(rsp.pArray, &cRsp); } + vDebug("vgId:%d, add %d new created tables into query table list", TD_VID(pVnode), (int32_t)taosArrayGetSize(tbUids)); tqUpdateTbUidList(pVnode->pTq, tbUids, true); if (tdUpdateTbUidList(pVnode->pSma, pStore, true) < 0) { goto _exit; @@ -885,8 +886,9 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq if (NULL != submitBlkRsp.pMeta) { vnodeUpdateMetaRsp(pVnode, submitBlkRsp.pMeta); } + + taosArrayPush(newTbUids, &createTbReq.uid); } - taosArrayPush(newTbUids, &createTbReq.uid); submitBlkRsp.uid = createTbReq.uid; submitBlkRsp.tblFName = taosMemoryMalloc(strlen(pVnode->config.dbname) + strlen(createTbReq.name) + 2); @@ -917,6 +919,11 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq submitRsp.affectedRows += submitBlkRsp.affectedRows; taosArrayPush(submitRsp.pArray, &submitBlkRsp); } + + if (taosArrayGetSize(newTbUids) > 0) { + vDebug("vgId:%d, add %d table into query table list in handling submit", TD_VID(pVnode), (int32_t)taosArrayGetSize(newTbUids)); + } + tqUpdateTbUidList(pVnode->pTq, newTbUids, true); _exit: diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 95415e1113f0fe807157ac5a0e6509caef97def6..a2bcca9545a97c10554cb201655efea6c92c5d1f 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -265,6 +265,15 @@ static SArray* filterUnqualifiedTables(const SStreamScanInfo* pScanInfo, const S int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bool isAdd) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; + STableListInfo* pListInfo = &pTaskInfo->tableqinfoList; + + if (isAdd) { + qDebug("add %d tables id into query list, %s", (int32_t) taosArrayGetSize(tableIdList), pTaskInfo->id.str); + } + + if (pListInfo->map == NULL) { + pListInfo->map = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + } // traverse to the stream scanner node to add this table id SOperatorInfo* pInfo = pTaskInfo->pRoot; @@ -311,13 +320,19 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo } } - taosArrayPush(pTaskInfo->tableqinfoList.pTableList, &keyInfo); - if (pTaskInfo->tableqinfoList.map == NULL) { - pTaskInfo->tableqinfoList.map = - taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + bool exists = false; + for (int32_t k = 0; k < taosArrayGetSize(pListInfo->pTableList); ++k) { + STableKeyInfo* pKeyInfo = taosArrayGet(pListInfo->pTableList, k); + if (pKeyInfo->uid == keyInfo.uid) { + qWarn("ignore duplicated query table uid:%" PRIu64 " added, %s", pKeyInfo->uid, pTaskInfo->id.str); + exists = true; + } } - taosHashPut(pTaskInfo->tableqinfoList.map, uid, sizeof(uid), &keyInfo.groupId, sizeof(keyInfo.groupId)); + if (!exists) { + taosArrayPush(pTaskInfo->tableqinfoList.pTableList, &keyInfo); + taosHashPut(pTaskInfo->tableqinfoList.map, uid, sizeof(uid), &keyInfo.groupId, sizeof(keyInfo.groupId)); + } } if (keyBuf != NULL) { @@ -480,6 +495,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) { if (ret != TSDB_CODE_SUCCESS) { pTaskInfo->code = ret; cleanUpUdfs(); + qDebug("%s task abort due to error/cancel occurs, code:%s", GET_TASKID(pTaskInfo), tstrerror(pTaskInfo->code)); atomic_store_64(&pTaskInfo->owner, 0); @@ -512,8 +528,8 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) { } cleanUpUdfs(); - uint64_t total = pTaskInfo->pRoot->resultInfo.totalRows; + uint64_t total = pTaskInfo->pRoot->resultInfo.totalRows; qDebug("%s task suspended, %d rows in %d blocks returned, total:%" PRId64 " rows, in sinkNode:%d, elapsed:%.2f ms", GET_TASKID(pTaskInfo), current, (int32_t)taosArrayGetSize(pResList), total, 0, el / 1000.0); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index ad9cd1ffe7909c9a67e5af2e98193995757a05c2..a6d718bafac17df1c2314cdd13efb482c4c2eb01 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -617,19 +617,28 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { // if scan table by table if (pInfo->scanMode == TABLE_SCAN__TABLE_ORDER) { - if (pInfo->noTable) return NULL; + if (pInfo->noTable) { + return NULL; + } + + int32_t numOfTables = taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList); + while (1) { SSDataBlock* result = doTableScanGroup(pOperator); if (result) { return result; } + // if no data, switch to next table and continue scan pInfo->currentTable++; - if (pInfo->currentTable >= taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList)) { + if (pInfo->currentTable >= numOfTables) { return NULL; } + STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, pInfo->currentTable); tsdbSetTableId(pInfo->dataReader, pTableInfo->uid); + qDebug("set uid:%" PRIu64 " into scanner, total tables:%d, index:%d %s", pTableInfo->uid, numOfTables, pInfo->currentTable, pTaskInfo->id.str); + tsdbReaderReset(pInfo->dataReader, &pInfo->cond); pInfo->scanTimes = 0; } diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 61c38f59db2d08e960100e1b615bdf8f0a104127..4dcc06b4706b6c85b626bb03877c578e3fe2f8fe 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -9,6 +9,7 @@ #include "tcommon.h" #include "tmsg.h" #include "tname.h" +#include "tdatablock.h" SQWorkerMgmt gQwMgmt = { .lock = 0, @@ -16,6 +17,11 @@ SQWorkerMgmt gQwMgmt = { .qwNum = 0, }; +static void freeBlock(void* param) { + SSDataBlock* pBlock = *(SSDataBlock**)param; + blockDataDestroy(pBlock); +} + int32_t qwProcessHbLinkBroken(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *req) { int32_t code = 0; SSchedulerHbRsp rsp = {0}; @@ -88,6 +94,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { // if *taskHandle is NULL, it's killed right now if (taskHandle) { qwDbgSimulateSleep(); + code = qExecTaskOpt(taskHandle, pResList, &useconds); if (code) { if (code != TSDB_CODE_OPS_NOT_SUPPORT) { @@ -150,8 +157,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { } _return: - - taosArrayDestroy(pResList); + taosArrayDestroyEx(pResList, freeBlock); QW_RET(code); } @@ -915,13 +921,13 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { void *pIter = taosHashIterate(mgmt->schHash, NULL); while (pIter) { - SQWSchStatus *sch = (SQWSchStatus *)pIter; - if (NULL == sch->hbConnInfo.handle) { + SQWSchStatus *sch1 = (SQWSchStatus *)pIter; + if (NULL == sch1->hbConnInfo.handle) { uint64_t *sId = taosHashGetKey(pIter, NULL); QW_TLOG("cancel send hb to sch %" PRIx64 " cause of no connection handle", *sId); - if (sch->hbBrokenTs > 0 && ((currentMs - sch->hbBrokenTs) > QW_SCH_TIMEOUT_MSEC) && - taosHashGetSize(sch->tasksHash) <= 0) { + if (sch1->hbBrokenTs > 0 && ((currentMs - sch1->hbBrokenTs) > QW_SCH_TIMEOUT_MSEC) && + taosHashGetSize(sch1->tasksHash) <= 0) { taosArrayPush(pExpiredSch, sId); }