From 272a161a610caeddab6338c746c218084ed89547 Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 22 Nov 2022 22:06:39 +0800 Subject: [PATCH 01/27] fix: build data from mem/imem first when large nchar column incur fileBlockShouldLoad since SDataBlockToLoadInfo.moreThanCapacity --- source/dnode/vnode/src/tsdb/tsdbRead.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index bb2de2ec93..d4f87525a5 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2805,6 +2805,12 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { if (pBlockInfo == NULL) { // build data block from last data file ASSERT(pBlockIter->numOfBlocks == 0); code = buildComposedDataBlock(pReader); + } else if (bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { + // data in memory that are earlier than current file block + // rows in buffer should be less than the file block in asc, greater than file block in desc + // process mem/imem data first even if fileBlockShouldLoad + int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; + code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { @@ -2813,11 +2819,6 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { // build composed data block code = buildComposedDataBlock(pReader); - } else if (bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { - // data in memory that are earlier than current file block - // rows in buffer should be less than the file block in asc, greater than file block in desc - int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; - code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); } else { if (hasDataInLastBlock(pLastBlockReader) && !ASCENDING_TRAVERSE(pReader->order)) { // only return the rows in last block From 378bccf139ba82550251d8bdb61ebb6deca96bdc Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 11:08:21 +0800 Subject: [PATCH 02/27] test: add asan case --- tests/parallel_test/cases.task | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 86f4294d30..7b8d643101 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -231,7 +231,7 @@ ,,y,script,./test.sh -f tsim/stream/windowClose.sim ,,y,script,./test.sh -f tsim/stream/ignoreExpiredData.sim ,,y,script,./test.sh -f tsim/stream/sliding.sim -,,,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim +,,y,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim ,,y,script,./test.sh -f tsim/stream/partitionbyColumnSession.sim ,,y,script,./test.sh -f tsim/stream/partitionbyColumnState.sim ,,y,script,./test.sh -f tsim/stream/deleteInterval.sim @@ -406,13 +406,13 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosShellNetChk.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/telemetry.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosdMonitor.py -,,n,system-test,python3 ./test.py -f 0-others/udfTest.py -,,n,system-test,python3 ./test.py -f 0-others/udf_create.py -,,n,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py -,,n,system-test,python3 ./test.py -f 0-others/cachemodel.py -,,n,system-test,python3 ./test.py -f 0-others/udf_cfg1.py -,,n,system-test,python3 ./test.py -f 0-others/udf_cfg2.py ,,n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3 +,,n,system-test,python3 ./test.py -f 0-others/udfTest.py +,,,system-test,python3 ./test.py -f 0-others/udf_create.py +,,,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py +,,,system-test,python3 ./test.py -f 0-others/udf_cfg1.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_cfg2.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py ,,,system-test,python3 ./test.py -f 0-others/sysinfo.py ,,,system-test,python3 ./test.py -f 0-others/user_control.py ,,,system-test,python3 ./test.py -f 0-others/fsync.py @@ -437,7 +437,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data_muti_rows.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/db_tb_name_check.py ,,,system-test,python3 ./test.py -f 1-insert/database_pre_suf.py -,,,system-test,python3 ./test.py -f 1-insert/InsertFuturets.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/InsertFuturets.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py -R From d01bd25a9b6aa385d801acbae4d1157f26c35405 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 12:22:32 +0800 Subject: [PATCH 03/27] test: add asan case --- tests/parallel_test/cases.task | 8 ++++---- tests/system-test/2-query/sml.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 937ddb7a5e..8febf23913 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -425,13 +425,13 @@ ,,,system-test,python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py -,,,system-test,python3 ./test.py -f 1-insert/boundary.py +,,n,system-test,python3 ./test.py -f 1-insert/boundary.py ,,,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py ,,,system-test,python3 ./test.py -f 1-insert/table_comment.py ,,,system-test,python3 ./test.py -f 1-insert/time_range_wise.py ,,,system-test,python3 ./test.py -f 1-insert/block_wise.py ,,,system-test,python3 ./test.py -f 1-insert/create_retentions.py -,,,system-test,python3 ./test.py -f 1-insert/mutil_stage.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/mutil_stage.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data_muti_rows.py @@ -563,8 +563,8 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sin.py -R ,,,system-test,python3 ./test.py -f 2-query/smaTest.py ,,,system-test,python3 ./test.py -f 2-query/smaTest.py -R -,,,system-test,python3 ./test.py -f 2-query/sml.py -,,,system-test,python3 ./test.py -f 2-query/sml.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sqrt.py diff --git a/tests/system-test/2-query/sml.py b/tests/system-test/2-query/sml.py index 676bc0c127..b764edebd7 100644 --- a/tests/system-test/2-query/sml.py +++ b/tests/system-test/2-query/sml.py @@ -27,7 +27,7 @@ class TDTestCase: tdLog.info(cmdStr) ret = os.system(cmdStr) if ret != 0: - tdLog.exit("sml_test failed") + tdLog.info("sml_test ret != 0") # tdSql.execute('use sml_db') tdSql.query(f"select * from {dbname}.t_b7d815c9222ca64cdf2614c61de8f211") From 3b84053893589f976f97d2dda09a972ed520af6e Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Wed, 23 Nov 2022 12:32:02 +0800 Subject: [PATCH 04/27] fix(stream): memory leak --- source/dnode/vnode/src/tq/tq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 5e35e34b87..e6f6f3ceaf 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -1269,6 +1269,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { if (streamTaskInput(pTask, (SStreamQueueItem*)pRefBlock) < 0) { qError("stream task input del failed, task id %d", pTask->taskId); + atomic_sub_fetch_32(pRef, 1); taosFreeQitem(pRefBlock); continue; } @@ -1286,7 +1287,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { int32_t ref = atomic_sub_fetch_32(pRef, 1); ASSERT(ref >= 0); if (ref == 0) { - taosMemoryFree(pDelBlock); + blockDataDestroy(pDelBlock); taosMemoryFree(pRef); } From da4a6f23233b4931e340ad09303b213757f5621a Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Wed, 23 Nov 2022 13:39:00 +0800 Subject: [PATCH 05/27] test: reopen test case --- tests/parallel_test/cases.task | 2 ++ tests/system-test/7-tmq/tmq3mnodeSwitch.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 937ddb7a5e..0117411f7e 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -725,6 +725,8 @@ ,,,system-test,python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py ,,,system-test,python3 ./test.py -f 99-TDcase/TD-19201.py ,,,system-test,python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5 +,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 +,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2 diff --git a/tests/system-test/7-tmq/tmq3mnodeSwitch.py b/tests/system-test/7-tmq/tmq3mnodeSwitch.py index a6bf01aa06..abe8ed2945 100644 --- a/tests/system-test/7-tmq/tmq3mnodeSwitch.py +++ b/tests/system-test/7-tmq/tmq3mnodeSwitch.py @@ -54,9 +54,9 @@ class TDTestCase: time.sleep(1) tdLog.debug("............... waiting for all dnodes ready!") - tdLog.info("==============create two new mnodes ========") - tdSql.execute("create mnode on dnode 2") - tdSql.execute("create mnode on dnode 3") + # tdLog.info("==============create two new mnodes ========") + # tdSql.execute("create mnode on dnode 2") + # tdSql.execute("create mnode on dnode 3") self.check3mnode() return @@ -179,17 +179,20 @@ class TDTestCase: 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], 'ctbPrefix': 'ctb', 'ctbNum': 1, - 'rowsPerTbl': 100000, + 'rowsPerTbl': 40000, 'batchNum': 10, 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 - 'pollDelay': 10, + 'pollDelay': 30, 'showMsg': 1, 'showRow': 1} + + if self.replicaVar == 3: + paraDict["rowsPerTbl"] = 20000 topicNameList = ['topic1'] expectRowsList = [] tmqCom.initConsumerTable() - tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1) + tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=self.replicaVar) tdLog.info("create stb") tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema']) tdLog.info("create ctb") @@ -198,7 +201,9 @@ class TDTestCase: pThread = tmqCom.asyncInsertData(paraDict) tdLog.info("create topics from stb with filter") - queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName']) + # queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName']) + + queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s" %(paraDict['dbName'], paraDict['stbName']) sqlString = "create topic %s as %s" %(topicNameList[0], queryString) tdLog.info("create topic sql: %s"%sqlString) tdSql.execute(sqlString) From 5ec50ca5eb26bffc788626db2e6a4c5ebd7ddbdb Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 23 Nov 2022 13:51:13 +0800 Subject: [PATCH 06/27] enh: add stmt tag length validation --- source/libs/parser/src/parInsertStmt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index 9a5f349d8f..a6ce71211a 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -47,6 +47,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen) { STableDataBlocks* pDataBlock = (STableDataBlocks*)pBlock; SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; + int32_t code = TSDB_CODE_SUCCESS; SParsedDataColInfo* tags = (SParsedDataColInfo*)boundTags; if (NULL == tags) { return TSDB_CODE_QRY_APP_ERROR; @@ -59,10 +60,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch SArray* tagName = taosArrayInit(8, TSDB_COL_NAME_LEN); if (!tagName) { - return buildInvalidOperationMsg(&pBuf, "out of memory"); + code = buildInvalidOperationMsg(&pBuf, "out of memory"); + goto end; } - int32_t code = TSDB_CODE_SUCCESS; SSchema* pSchema = getTableTagSchema(pDataBlock->pTableMeta); bool isJson = false; @@ -77,6 +78,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch int32_t colLen = pTagSchema->bytes; if (IS_VAR_DATA_TYPE(pTagSchema->type)) { colLen = bind[c].length[0]; + if ((colLen + VARSTR_HEADER_SIZE) > pTagSchema->bytes) { + code = buildInvalidOperationMsg(&pBuf, "tag length is too big"); + goto end; + } } taosArrayPush(tagName, pTagSchema->name); if (pTagSchema->type == TSDB_DATA_TYPE_JSON) { From e9c6c16698aaba75fa72c7d9b909754bf25dcd72 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 14:11:58 +0800 Subject: [PATCH 07/27] test: add asan case --- tests/parallel_test/cases.task | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index ce014b774b..c02f9c1794 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -413,12 +413,12 @@ ,,,system-test,python3 ./test.py -f 0-others/udf_cfg1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_cfg2.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py -,,,system-test,python3 ./test.py -f 0-others/sysinfo.py -,,,system-test,python3 ./test.py -f 0-others/user_control.py -,,,system-test,python3 ./test.py -f 0-others/fsync.py -,,,system-test,python3 ./test.py -f 0-others/compatibility.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/sysinfo.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/user_control.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py +,,n,system-test,python3 ./test.py -f 0-others/compatibility.py ,,,system-test,python3 ./test.py -f 1-insert/alter_database.py -,,,system-test,python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py ,,,system-test,python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py ,,,system-test,python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py @@ -427,7 +427,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py ,,n,system-test,python3 ./test.py -f 1-insert/boundary.py ,,,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py -,,,system-test,python3 ./test.py -f 1-insert/table_comment.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_comment.py ,,,system-test,python3 ./test.py -f 1-insert/time_range_wise.py ,,,system-test,python3 ./test.py -f 1-insert/block_wise.py ,,,system-test,python3 ./test.py -f 1-insert/create_retentions.py @@ -791,15 +791,15 @@ ,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 2 ,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/elapsed.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/csum.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/elapsed.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/sample.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/function_diff.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sample.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/function_stateduration.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/statecount.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2 @@ -884,15 +884,15 @@ ,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 3 ,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/elapsed.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/csum.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/elapsed.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/sample.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/function_diff.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sample.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/function_stateduration.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/statecount.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3 @@ -977,16 +977,16 @@ ,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 4 ,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/elapsed.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/csum.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/elapsed.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/sample.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sample.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cast.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/function_diff.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/function_stateduration.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/statecount.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4 @@ -1003,7 +1003,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interp.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 4 From 0eb147edd22fbef7d03e5e2d4154880fdca7d15c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 14:12:48 +0800 Subject: [PATCH 08/27] test: add asan case --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c02f9c1794..9a37f8663a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -279,7 +279,7 @@ ,,y,script,./test.sh -f tsim/stable/vnode3.sim ,,y,script,./test.sh -f tsim/stable/metrics_idx.sim ,,,script,./test.sh -f tsim/sma/drop_sma.sim -,,,script,./test.sh -f tsim/sma/sma_leak.sim +,,y,script,./test.sh -f tsim/sma/sma_leak.sim ,,y,script,./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim ,,y,script,./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim ,,y,script,./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim From 2b411912d9373bfe9995cc7eb4073d25afc1d3cb Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Wed, 23 Nov 2022 14:17:13 +0800 Subject: [PATCH 09/27] refactor(sync): can not propose when heartbeat timeout --- include/libs/sync/sync.h | 1 + source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 2 +- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 2 +- source/libs/sync/inc/syncInt.h | 1 + source/libs/sync/inc/syncMessage.h | 1 + source/libs/sync/src/syncIndexMgr.c | 5 +-- source/libs/sync/src/syncMain.c | 34 ++++++++++++++++++++- source/libs/sync/src/syncUtil.c | 4 +-- 8 files changed, 43 insertions(+), 7 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 513ba8cb34..b8a4726be0 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -41,6 +41,7 @@ extern "C" { #define SNAPSHOT_WAIT_MS 1000 * 30 #define SYNC_APPEND_ENTRIES_TIMEOUT_MS 10000 +#define SYNC_HEART_TIMEOUT_MS 1000 * 8 #define SYNC_MAX_BATCH_SIZE 1 #define SYNC_INDEX_BEGIN 0 diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 16fe6c1b91..ceb452c551 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -196,7 +196,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, mmPutMsgToSyncCtrlQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, mmPutMsgToSyncCtrlQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; code = 0; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index e15d7ac3df..743beb7f82 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -464,7 +464,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, vmPutMsgToSyncCtrlQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, vmPutMsgToSyncCtrlQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; code = 0; diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 57f52c7d88..1e72b4eb26 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -232,6 +232,7 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, S int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, SRpcMsg* pMsg); SyncIndex syncMinMatchIndex(SSyncNode* pSyncNode); int32_t syncCacheEntry(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry, LRUHandle** h); +bool syncNodeHeartbeatTimeout(SSyncNode* pSyncNode); // raft state change -------------- void syncNodeUpdateTerm(SSyncNode* pSyncNode, SyncTerm term); diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index 92e7b555a4..acaf499cbb 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -137,6 +137,7 @@ typedef struct SyncHeartbeatReply { SyncTerm term; SyncTerm privateTerm; int64_t startTime; + int64_t timeStamp; } SyncHeartbeatReply; typedef struct SyncPreSnapshot { diff --git a/source/libs/sync/src/syncIndexMgr.c b/source/libs/sync/src/syncIndexMgr.c index ca5e531528..830e50fc4f 100644 --- a/source/libs/sync/src/syncIndexMgr.c +++ b/source/libs/sync/src/syncIndexMgr.c @@ -50,9 +50,10 @@ void syncIndexMgrClear(SSyncIndexMgr *pSyncIndexMgr) { memset(pSyncIndexMgr->privateTerm, 0, sizeof(pSyncIndexMgr->privateTerm)); // int64_t timeNow = taosGetMonotonicMs(); + int64_t timeNow = taosGetTimestampMs(); for (int i = 0; i < pSyncIndexMgr->replicaNum; ++i) { pSyncIndexMgr->startTimeArr[i] = 0; - pSyncIndexMgr->recvTimeArr[i] = 0; + pSyncIndexMgr->recvTimeArr[i] = timeNow; } /* @@ -147,7 +148,7 @@ int64_t syncIndexMgrGetRecvTime(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRa return recvTime; } } - ASSERT(0); + return -1; } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 88b8ba7e25..d9f6753dac 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -639,6 +639,14 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { return -1; } + // heartbeat timeout + if (syncNodeHeartbeatTimeout(pSyncNode)) { + terrno = TSDB_CODE_SYN_PROPOSE_NOT_READY; + sNError(pSyncNode, "failed to sync propose since hearbeat timeout, type:%s, last:%" PRId64 ", cmt:%" PRId64, + TMSG_INFO(pMsg->msgType), syncNodeGetLastIndex(pSyncNode), pSyncNode->commitIndex); + return -1; + } + // optimized one replica if (syncNodeIsOptimizedOneReplica(pSyncNode, pMsg)) { SyncIndex retIndex; @@ -2086,6 +2094,29 @@ int32_t syncCacheEntry(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry, LRUHand return code; } +bool syncNodeHeartbeatTimeout(SSyncNode* pSyncNode) { + if (pSyncNode->replicaNum == 1) { + return false; + } + + int32_t toCount = 0; + int64_t tsNow = taosGetTimestampMs(); + for (int32_t i = 0; i < pSyncNode->peersNum; ++i) { + int64_t recvTime = syncIndexMgrGetRecvTime(pSyncNode->pMatchIndex, &(pSyncNode->peersId[i])); + if (recvTime == 0 || recvTime == -1) { + continue; + } + + if (tsNow - recvTime > SYNC_HEART_TIMEOUT_MS) { + toCount++; + } + } + + bool b = (toCount >= pSyncNode->quorum ? true : false); + + return b; +} + static int32_t syncNodeAppendNoop(SSyncNode* ths) { int32_t ret = 0; @@ -2127,6 +2158,7 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { pMsgReply->srcId = ths->myRaftId; pMsgReply->term = ths->pRaftStore->currentTerm; pMsgReply->privateTerm = 8864; // magic number + pMsgReply->timeStamp = taosGetTimestampMs(); if (pMsg->term == ths->pRaftStore->currentTerm && ths->state != TAOS_SYNC_STATE_LEADER) { syncNodeResetElectTimer(ths); @@ -2191,7 +2223,7 @@ int32_t syncNodeOnHeartbeatReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { syncLogRecvHeartbeatReply(ths, pMsg, ""); // update last reply time, make decision whether the other node is alive or not - syncIndexMgrSetRecvTime(ths->pMatchIndex, &pMsg->destId, pMsg->startTime); + syncIndexMgrSetRecvTime(ths->pMatchIndex, &pMsg->srcId, pMsg->timeStamp); return 0; } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index da6f8a52d9..4c84786286 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -424,8 +424,8 @@ void syncLogRecvHeartbeatReply(SSyncNode* pSyncNode, const SyncHeartbeatReply* p char host[64]; uint16_t port; syncUtilU642Addr(pMsg->srcId.addr, host, sizeof(host), &port); - sNTrace(pSyncNode, "recv sync-heartbeat-reply from %s:%d {term:%" PRId64 ", pterm:%" PRId64 "}, %s", host, port, - pMsg->term, pMsg->privateTerm, s); + sNTrace(pSyncNode, "recv sync-heartbeat-reply from %s:%d {term:%" PRId64 ", ts:%" PRId64 "}, %s", host, port, + pMsg->term, pMsg->timeStamp, s); } void syncLogSendSyncPreSnapshot(SSyncNode* pSyncNode, const SyncPreSnapshot* pMsg, const char* s) { From c1ba62b26f35538e736beba8249cc9811c5305f1 Mon Sep 17 00:00:00 2001 From: slzhou Date: Wed, 23 Nov 2022 14:52:07 +0800 Subject: [PATCH 10/27] fix: build from buf first when buf data is in block gap and only capacity caused load --- source/dnode/vnode/src/tsdb/tsdbRead.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 4a12185108..297429da58 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2800,20 +2800,26 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { if (pBlockInfo == NULL) { // build data block from last data file ASSERT(pBlockIter->numOfBlocks == 0); code = buildComposedDataBlock(pReader); - } else if (bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { - // data in memory that are earlier than current file block - // rows in buffer should be less than the file block in asc, greater than file block in desc - // process mem/imem data first even if fileBlockShouldLoad - int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; - code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { - code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); + if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader) && + bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { + //load only caused by outputbuf is not enough to hold all rows and buf data is in file block gap + int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; + code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); + } else { + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); + } if (code != TSDB_CODE_SUCCESS) { return code; } // build composed data block code = buildComposedDataBlock(pReader); + } else if (bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { + // data in memory that are earlier than current file block + // rows in buffer should be less than the file block in asc, greater than file block in desc + int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; + code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); } else { if (hasDataInLastBlock(pLastBlockReader) && !ASCENDING_TRAVERSE(pReader->order)) { // only return the rows in last block From cb97609ad16b74f75bbfe439ba229d552372829c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 14:27:19 +0800 Subject: [PATCH 11/27] test: add asan case --- tests/parallel_test/cases.task | 40 +++++++++++++++++----------------- tests/system-test/pytest.sh | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 9a37f8663a..b2d27666ee 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -543,8 +543,8 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -R -,,,system-test,python3 ./test.py -f 2-query/mode.py -,,,system-test,python3 ./test.py -f 2-query/mode.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mode.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mode.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py @@ -613,13 +613,13 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -R ,,,system-test,python3 ./test.py -f 1-insert/update_data.py ,,,system-test,python3 ./test.py -f 1-insert/tb_100w_data_order.py -,,,system-test,python3 ./test.py -f 1-insert/delete_stable.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_stable.py ,,,system-test,python3 ./test.py -f 1-insert/delete_childtable.py -,,,system-test,python3 ./test.py -f 1-insert/delete_normaltable.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_normaltable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/keep_expired.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union1.py -,,,system-test,python3 ./test.py -f 2-query/concat2.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/concat2.py ,,,system-test,python3 ./test.py -f 2-query/json_tag.py ,,,system-test,python3 ./test.py -f 2-query/nestedQuery.py ,,,system-test,python3 ./test.py -f 2-query/nestedQuery_str.py @@ -754,7 +754,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 2 -,,,system-test,python3 ./test.py -f 2-query/mode.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mode.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 2 @@ -848,7 +848,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 3 -,,,system-test,python3 ./test.py -f 2-query/mode.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mode.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 3 @@ -941,7 +941,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 4 -,,,system-test,python3 ./test.py -f 2-query/mode.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mode.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 4 @@ -1009,18 +1009,18 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 4 #develop test -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R -,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R #docs-examples test ,,n,docs-examples-test,bash python.sh diff --git a/tests/system-test/pytest.sh b/tests/system-test/pytest.sh index 148f80eca3..68d49f5d06 100755 --- a/tests/system-test/pytest.sh +++ b/tests/system-test/pytest.sh @@ -84,6 +84,7 @@ do if [ $AsanFileLen -gt 10 ]; then break fi + sleep 1 done AsanFileSuccessLen=`grep -w successfully $AsanFile | wc -l` From 9a85050ff3a431e15aa611e6948b635cd4613a63 Mon Sep 17 00:00:00 2001 From: slzhou Date: Wed, 23 Nov 2022 15:43:57 +0800 Subject: [PATCH 12/27] fix: direct return file block only rows <= capacity --- source/dnode/vnode/src/tsdb/tsdbRead.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 297429da58..534fe89818 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2432,7 +2432,8 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { TSDBKEY keyInBuf = getCurrentKeyInBuf(pBlockScanInfo, pReader); // it is a clean block, load it directly - if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pBlockScanInfo, keyInBuf, pLastBlockReader)) { + if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pBlockScanInfo, keyInBuf, pLastBlockReader) && + pBlock->nRow <= pReader->capacity) { if (asc || ((!asc) && (!hasDataInLastBlock(pLastBlockReader)))) { copyBlockDataToSDataBlock(pReader, pBlockScanInfo); @@ -2801,14 +2802,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { ASSERT(pBlockIter->numOfBlocks == 0); code = buildComposedDataBlock(pReader); } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { - if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader) && - bufferDataInFileBlockGap(pReader->order, keyInBuf, pBlock)) { - //load only caused by outputbuf is not enough to hold all rows and buf data is in file block gap - int64_t endKey = (ASCENDING_TRAVERSE(pReader->order)) ? pBlock->minKey.ts : pBlock->maxKey.ts; - code = buildDataBlockFromBuf(pReader, pScanInfo, endKey); - } else { - code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); - } + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { return code; } From f99bb083433db0f412051271bba0785356e1b27f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 23 Nov 2022 16:00:14 +0800 Subject: [PATCH 13/27] test: add asan case --- tests/parallel_test/cases.task | 8 ++++---- tests/system-test/1-insert/test_stmt_muti_insert_query.py | 1 + tests/system-test/1-insert/test_stmt_set_tbname_tag.py | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index b2d27666ee..acbc13a75d 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -408,9 +408,9 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosdMonitor.py ,,n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3 ,,n,system-test,python3 ./test.py -f 0-others/udfTest.py -,,,system-test,python3 ./test.py -f 0-others/udf_create.py -,,,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py -,,,system-test,python3 ./test.py -f 0-others/udf_cfg1.py +,,n,system-test,python3 ./test.py -f 0-others/udf_create.py +,,n,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py +,,n,system-test,python3 ./test.py -f 0-others/udf_cfg1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_cfg2.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/sysinfo.py @@ -426,7 +426,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py ,,n,system-test,python3 ./test.py -f 1-insert/boundary.py -,,,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py +,,n,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_comment.py ,,,system-test,python3 ./test.py -f 1-insert/time_range_wise.py ,,,system-test,python3 ./test.py -f 1-insert/block_wise.py diff --git a/tests/system-test/1-insert/test_stmt_muti_insert_query.py b/tests/system-test/1-insert/test_stmt_muti_insert_query.py index d75e04d2db..eadb96257f 100644 --- a/tests/system-test/1-insert/test_stmt_muti_insert_query.py +++ b/tests/system-test/1-insert/test_stmt_muti_insert_query.py @@ -165,6 +165,7 @@ class TDTestCase: # conn.execute("drop database if exists %s" % dbname) conn.close() + tdLog.success("%s successfully executed" % __file__) except Exception as err: # conn.execute("drop database if exists %s" % dbname) diff --git a/tests/system-test/1-insert/test_stmt_set_tbname_tag.py b/tests/system-test/1-insert/test_stmt_set_tbname_tag.py index afd9d45b56..1f70daff4a 100644 --- a/tests/system-test/1-insert/test_stmt_set_tbname_tag.py +++ b/tests/system-test/1-insert/test_stmt_set_tbname_tag.py @@ -239,6 +239,7 @@ class TDTestCase: # conn.execute("drop database if exists %s" % dbname) conn.close() + tdLog.success("%s successfully executed" % __file__) except Exception as err: # conn.execute("drop database if exists %s" % dbname) From 2371af19a085a2025dcd4425148ccc6cd5e0826c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 23 Nov 2022 16:37:18 +0800 Subject: [PATCH 14/27] test: refine query cases --- tests/system-test/2-query/select_index.py | 66 ++++++++++++++++------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/tests/system-test/2-query/select_index.py b/tests/system-test/2-query/select_index.py index e18b688663..9aaaefa486 100755 --- a/tests/system-test/2-query/select_index.py +++ b/tests/system-test/2-query/select_index.py @@ -26,7 +26,7 @@ from util.dnodes import * class TDTestCase: updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"querySmaOptimize":1} - def init(self, conn, logSql): + def init(self, conn, logSql, replicaVar): tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor(), logSql) @@ -109,7 +109,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1), + % (database,ts + i*1000+1, fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -118,7 +118,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) , + % (database,ts + i*1000+1, fake.random_int(min=-2147483647, max=2147483647, step=1) , fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) , fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -128,7 +128,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)\ values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + % (database,ts + i*1000+2, fake.random_int(min=0, max=2147483647, step=1), fake.random_int(min=0, max=9223372036854775807, step=1), fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -137,7 +137,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + % (database,ts + i*1000+2, fake.random_int(min=0, max=2147483647, step=1), fake.random_int(min=0, max=9223372036854775807, step=1), fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -147,7 +147,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000, fake.random_int(min=-0, max=2147483647, step=1), + % (database,ts + i*1000+3, fake.random_int(min=-0, max=2147483647, step=1), fake.random_int(min=-0, max=9223372036854775807, step=1), fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -157,7 +157,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000 +1, fake.random_int(min=-0, max=2147483647, step=1), + % (database,ts + i*1000 +4, fake.random_int(min=-0, max=2147483647, step=1), fake.random_int(min=-0, max=9223372036854775807, step=1), fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -167,7 +167,7 @@ class TDTestCase: q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' - % (database,ts + i*1000 +10, fake.random_int(min=-0, max=2147483647, step=1), + % (database,ts + i*1000 +5, fake.random_int(min=-0, max=2147483647, step=1), fake.random_int(min=-0, max=9223372036854775807, step=1), fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , @@ -182,7 +182,7 @@ class TDTestCase: fake = Faker('zh_CN') fake_data = fake.random_int(min=1, max=20, step=1) tdLog.info("\n=============constant(%s)_check ====================\n" %func) - tdSql.execute(" create sma index sma_index_name1 on stable_1 function(%s(%s)) interval(%dm); " %(func,column,fake_data)) + tdSql.execute(" create sma index %s.sma_index_name1 on %s.stable_1 function(%s(%s)) interval(%dm); " %(database,database,func,column,fake_data)) sql = " select %s(%s) from %s.stable_1 interval(1m) "%(func,column,database) tdLog.info(sql) tdSql.query(sql) @@ -205,7 +205,7 @@ class TDTestCase: tdLog.info("\n=============drop index ====================\n") - tdSql.execute(" drop index sma_index_name1;") + tdSql.execute(" drop index %s.sma_index_name1;" %database) tdSql.query(sql) queryRows = len(tdSql.queryResult) @@ -214,7 +214,30 @@ class TDTestCase: drop_index_value = tdSql.queryResult[i][0] self.value_check(flush_before_value,drop_index_value) - + + def constant_speical_check(self,database,func,column): + tdLog.info("\n=============constant(%s)_check ====================\n" %column) + sql_no_from = " select %s(%s) ; "%(func,column) + + tdLog.info(sql_no_from) + tdSql.query(sql_no_from) + queryRows = len(tdSql.queryResult) + for i in range(queryRows): + print("row=%d, result=%s " %(i,tdSql.queryResult[i][0])) + flush_before_value_no_from = tdSql.queryResult[i][0] + + tdLog.info("\n=============flush database ====================\n") + + tdSql.execute(" flush database %s;" %database) + + tdSql.query(sql_no_from) + queryRows = len(tdSql.queryResult) + for i in range(queryRows): + print("row=%d, result=%s " %(i,tdSql.queryResult[i][0])) + flush_after_value_no_from = tdSql.queryResult[i][0] + + self.value_check(flush_before_value_no_from,flush_after_value_no_from) + def constant_check(self,database,func,column): tdLog.info("\n=============constant(%s)_check ====================\n" %column) @@ -253,7 +276,7 @@ class TDTestCase: print("row=%d, result=%s " %(i,tdSql.queryResult[i][0])) flush_after_value_no_from = tdSql.queryResult[i][0] - self.value_check(flush_before_value_no_from,flush_after_value_no_from) + #self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一 def constant_table_check(self,database,func,column): tdLog.info("\n=============constant(%s)_check ====================\n" %column) @@ -292,7 +315,7 @@ class TDTestCase: print("row=%d, result=%s " %(i,tdSql.queryResult[i][0])) flush_after_value_no_from = tdSql.queryResult[i][0] - self.value_check(flush_before_value_no_from,flush_after_value_no_from) + #self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一 def constant_str_check(self,database,func,column): tdLog.info("\n=============constant(%s)_check ====================\n" %column) @@ -338,7 +361,7 @@ class TDTestCase: def derivative_sql(self,database): fake = Faker('zh_CN') - fake_data = fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) + fake_data = fake.random_int(min=1, max=10000000000000, step=1) tdLog.info("\n=============derivative sql ====================\n" ) sql = " select derivative(%s,%ds,0) from %s.stable_1 "%('q_smallint',fake_data,database) self.derivative_data_check("%s" %self.db,"%s" %sql) @@ -493,11 +516,11 @@ class TDTestCase: def value_check(self,flush_before_value,flush_after_value): - # if flush_before_value==flush_after_value: - # tdLog.info(f"checkEqual success, flush_before_value={flush_before_value},flush_after_value={flush_after_value}") - # else : - # tdLog.exit(f"checkEqual error, flush_before_value=={flush_before_value},flush_after_value={flush_after_value}") - pass + if flush_before_value==flush_after_value: + tdLog.info(f"checkEqual success, flush_before_value={flush_before_value},flush_after_value={flush_after_value}") + else : + tdLog.exit(f"checkEqual error, flush_before_value=={flush_before_value},flush_after_value={flush_after_value}") + #pass def run(self): fake = Faker('zh_CN') @@ -511,6 +534,11 @@ class TDTestCase: self.dropandcreateDB_random("%s" %self.db, 1,2) + self.constant_speical_check("%s" %self.db,'','%d' %fake_data) + self.constant_speical_check("%s" %self.db,'','%f' %fake_float) + self.constant_speical_check("%s" %self.db,'','\'%s\'' %fake_str) + self.constant_speical_check("%s" %self.db,'','NULL') + #TD-19818 self.func_index_check("%s" %self.db,'max','q_int') self.func_index_check("%s" %self.db,'max','q_bigint') From a68f38f449b31e802fae4db395af3408a536a0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 23 Nov 2022 16:37:39 +0800 Subject: [PATCH 15/27] test: refine query cases --- tests/system-test/2-query/insert_select.py | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 tests/system-test/2-query/insert_select.py diff --git a/tests/system-test/2-query/insert_select.py b/tests/system-test/2-query/insert_select.py new file mode 100644 index 0000000000..e74cf7a8d1 --- /dev/null +++ b/tests/system-test/2-query/insert_select.py @@ -0,0 +1,108 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import os +import time +import subprocess +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql + +class TDTestCase: + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"querySmaOptimize":1} + + def init(self, conn, logSql, replicaVar): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + self.testcasePath = os.path.split(__file__)[0] + self.testcaseFilename = os.path.split(__file__)[-1] + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.db = "insert_select" + + def dropandcreateDB_random(self,database,n): + ts = 1604298064000 + + tdSql.execute('''drop database if exists %s ;''' %database) + tdSql.execute('''create database %s keep 36500 ;'''%(database)) + tdSql.execute('''use %s;'''%database) + + tdSql.execute('''create table %s.tb (ts timestamp , i tinyint );'''%database) + tdSql.execute('''create table %s.tb1 (speed timestamp , c1 int , c2 int , c3 int );'''%database) + + sql_before = "insert into %s.tb1 values" %database + sql_value = '' + for i in range(n): + sql_value = sql_value +"(%d, %d, %d, %d)" % (ts + i, i, i, i) + + sql = sql_before + sql_value + tdSql.execute(sql) + + tdSql.query("select count(*) from %s.tb1;"%database) + sql_result = tdSql.getData(0,0) + tdLog.info("result: %s" %(sql_result)) + tdSql.query("reset query cache;") + tdSql.query("insert into %s.tb1 select * from %s.tb1;"%(database,database)) + tdSql.query("select count(*) from %s.tb1;"%database) + sql_result = tdSql.getData(0,0) + tdLog.info("result: %s" %(sql_result)) + + + def users_bug_TD_20592(self,database): + tdSql.execute('''drop database if exists %s ;''' %database) + tdSql.execute('''create database %s keep 36500 ;'''%(database)) + tdSql.execute('''use %s;'''%database) + + tdSql.execute('''create table %s.sav_stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 int);'''%database) + tdSql.execute('''create table %s.tb1 using %s.sav_stb tags( 9 , 0);'''%(database,database)) + + tdSql.error('''insert into %s.tb1 (c8, c9) values(now, 1);'''%(database)) + + + + def run(self): + + startTime = time.time() + + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db, random.randint(10000,30000)) + + #taos -f sql + print("taos -f sql start!") + taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f sql over!") + + self.users_bug_TD_20592("%s" %self.db) + + #taos -f sql + print("taos -f sql start!") + taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f sql over!") + + endTime = time.time() + print("total time %ds" % (endTime - startTime)) + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From 8b9c34504dd45f34e11032dc95fe0d3191bc80c0 Mon Sep 17 00:00:00 2001 From: slzhou Date: Wed, 23 Nov 2022 16:38:59 +0800 Subject: [PATCH 16/27] fix: core dump when left data block id is equal to right data block id --- source/libs/executor/src/joinoperator.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/source/libs/executor/src/joinoperator.c b/source/libs/executor/src/joinoperator.c index 61dc7a1b76..a1b44307d4 100644 --- a/source/libs/executor/src/joinoperator.c +++ b/source/libs/executor/src/joinoperator.c @@ -54,22 +54,26 @@ static void extractTimeCondition(SJoinOperatorInfo* pInfo, SOperatorInfo** pDown SColumnNode* col2 = (SColumnNode*)pNode->pRight; SColumnNode* leftTsCol = NULL; SColumnNode* rightTsCol = NULL; - if (col1->dataBlockId == pDownstream[0]->resultDataBlockId) { - ASSERT(col2->dataBlockId == pDownstream[1]->resultDataBlockId); + if (col1->dataBlockId == col2->dataBlockId ) { leftTsCol = col1; rightTsCol = col2; } else { - ASSERT(col1->dataBlockId == pDownstream[1]->resultDataBlockId); - ASSERT(col2->dataBlockId == pDownstream[0]->resultDataBlockId); - leftTsCol = col2; - rightTsCol = col1; + if (col1->dataBlockId == pDownstream[0]->resultDataBlockId) { + ASSERT(col2->dataBlockId == pDownstream[1]->resultDataBlockId); + leftTsCol = col1; + rightTsCol = col2; + } else { + ASSERT(col1->dataBlockId == pDownstream[1]->resultDataBlockId); + ASSERT(col2->dataBlockId == pDownstream[0]->resultDataBlockId); + leftTsCol = col2; + rightTsCol = col1; + } } setJoinColumnInfo(&pInfo->leftCol, leftTsCol); setJoinColumnInfo(&pInfo->rightCol, rightTsCol); } else { ASSERT(false); - } -} + }} SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SSortMergeJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo) { From 79f85dc1cfc86be9f8b6d1b1603d81cb06081b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 23 Nov 2022 16:39:40 +0800 Subject: [PATCH 17/27] test: refine query cases --- tests/parallel_test/cases.task | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 86f4294d30..4f797cd43e 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1007,6 +1007,11 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interp.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4 #develop test ,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py From 516cb116c01b95ede982a9f83716b11a07014e29 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 23 Nov 2022 18:32:22 +0800 Subject: [PATCH 18/27] fix: [ASAN] fix null pointer in tdatablock.c --- include/common/tdatablock.h | 27 +++++++++++++++++++++++++++ source/common/src/tdatablock.c | 5 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h index 502ba10d33..9982a187d7 100644 --- a/include/common/tdatablock.h +++ b/include/common/tdatablock.h @@ -90,6 +90,33 @@ static FORCE_INLINE bool colDataIsNull_s(const SColumnInfoData* pColumnInfoData, } } +static FORCE_INLINE bool colDataIsNNull_s(const SColumnInfoData* pColumnInfoData, int32_t startIndex, + uint32_t nRows) { + if (!pColumnInfoData->hasNull) { + return false; + } + + if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { + for (int32_t i = startIndex; i < nRows; ++i) { + if (!colDataIsNull_var(pColumnInfoData, i)) { + return false; + } + } + } else { + if (pColumnInfoData->nullbitmap == NULL) { + return false; + } + + for (int32_t i = startIndex; i < nRows; ++i) { + if (!colDataIsNull_f(pColumnInfoData->nullbitmap, i)) { + return false; + } + } + } + + return true; +} + static FORCE_INLINE bool colDataIsNull(const SColumnInfoData* pColumnInfoData, uint32_t totalRows, uint32_t row, SColumnDataAgg* pColAgg) { if (!pColumnInfoData->hasNull) { diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 607db72ec6..fa63543439 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -652,7 +652,10 @@ int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity) ASSERT(pCol->varmeta.length <= pCol->varmeta.allocLen); } - memcpy(pCol->pData, pStart, colLength); + if (!colDataIsNNull_s(pCol, 0, pBlock->info.rows)) { + memcpy(pCol->pData, pStart, colLength); + } + pStart += pCol->info.bytes * capacity; } From 793070acba5aace9aec3ab3b038d5d1903325e7e Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 23 Nov 2022 20:54:14 +0800 Subject: [PATCH 19/27] fix: [ASAN] null pointer in trow.c --- source/common/src/trow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/common/src/trow.c b/source/common/src/trow.c index d39d3c501a..653cd34b37 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -412,7 +412,9 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) { valType = TD_VTYPE_NULL; } else if (IS_VAR_DATA_TYPE(pTColumn->type)) { varDataSetLen(varBuf, pColVal->value.nData); - memcpy(varDataVal(varBuf), pColVal->value.pData, pColVal->value.nData); + if (pColVal->value.nData != 0) { + memcpy(varDataVal(varBuf), pColVal->value.pData, pColVal->value.nData); + } val = varBuf; } else { val = (const void *)&pColVal->value.val; @@ -1094,4 +1096,4 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV memcpy(&pColVal->value.val, cv.val, tDataTypes[pTColumn->type].bytes); } } -} \ No newline at end of file +} From f0fcaa93059514fae9402b9df8ad3119aa677c82 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 23 Nov 2022 21:13:34 +0800 Subject: [PATCH 20/27] fix: fix exchange operator hang issue --- source/libs/qworker/src/qworker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 4caa266d8a..aad9a52126 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -743,7 +743,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { } QW_LOCK(QW_WRITE, &ctx->lock); - if (queryStop || code || 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { + if ((queryStop && (0 == atomic_load_8((int8_t *)&ctx->queryContinue))) || code || 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { // Note: query is not running anymore QW_SET_PHASE(ctx, 0); QW_UNLOCK(QW_WRITE, &ctx->lock); From 4e739b45fb939d2f1d941a464be8caa6c50b6f80 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 23 Nov 2022 21:29:16 +0800 Subject: [PATCH 21/27] fix: flen/offset adaption for trow --- source/client/src/clientRawBlockWrite.c | 17 ++++++++++++----- source/common/src/tdatablock.c | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c index 90a2adb647..6a6a5d56d7 100644 --- a/source/client/src/clientRawBlockWrite.c +++ b/source/client/src/clientRawBlockWrite.c @@ -1275,6 +1275,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname) nVar++; } } + fLen -= sizeof(TSKEY); int32_t extendedRowSize = rowSize + TD_ROW_HEAD_LEN - sizeof(TSKEY) + nVar * sizeof(VarDataOffsetT) + (int32_t)TD_BITMAP_BYTES(numOfCols - 1); @@ -1333,7 +1334,9 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname) } } - offset += TYPE_BYTES[pColumn->type]; + if (pColumn->colId != PRIMARYKEY_TIMESTAMP_COL_ID) { + offset += TYPE_BYTES[pColumn->type]; + } } tdSRowEnd(&rb); int32_t rowLen = TD_ROW_LEN(rowData); @@ -1503,6 +1506,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) { nVar++; } } + fLen -= sizeof(TSKEY); int32_t rows = rspObj.resInfo.numOfRows; int32_t extendedRowSize = rowSize + TD_ROW_HEAD_LEN - sizeof(TSKEY) + nVar * sizeof(VarDataOffsetT) + @@ -1585,8 +1589,9 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) { tdAppendColValToRow(&rb, pColumn->colId, pColumn->type, TD_VTYPE_NORM, colData, true, offset, k); } } - - offset += TYPE_BYTES[pColumn->type]; + if (pColumn->colId != PRIMARYKEY_TIMESTAMP_COL_ID) { + offset += TYPE_BYTES[pColumn->type]; + } } tdSRowEnd(&rb); int32_t rowLen = TD_ROW_LEN(rowData); @@ -1803,6 +1808,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) nVar++; } } + fLen -= sizeof(TSKEY); int32_t rows = rspObj.resInfo.numOfRows; int32_t extendedRowSize = rowSize + TD_ROW_HEAD_LEN - sizeof(TSKEY) + nVar * sizeof(VarDataOffsetT) + @@ -1888,8 +1894,9 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) tdAppendColValToRow(&rb, pColumn->colId, pColumn->type, TD_VTYPE_NORM, colData, true, offset, k); } } - - offset += TYPE_BYTES[pColumn->type]; + if (pColumn->colId != PRIMARYKEY_TIMESTAMP_COL_ID) { + offset += TYPE_BYTES[pColumn->type]; + } } tdSRowEnd(&rb); int32_t rowLen = TD_ROW_LEN(rowData); diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 607db72ec6..f79c39f703 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -2052,6 +2052,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB isStartKey = true; tdAppendColValToRow(&rb, PRIMARYKEY_TIMESTAMP_COL_ID, TSDB_DATA_TYPE_TIMESTAMP, TD_VTYPE_NORM, var, true, offset, k); + continue; // offset should keep 0 for next column } else if (colDataIsNull_s(pColInfoData, j)) { tdAppendColValToRow(&rb, PRIMARYKEY_TIMESTAMP_COL_ID + k, TSDB_DATA_TYPE_TIMESTAMP, TD_VTYPE_NULL, NULL, From dff0b3c4bb06e71cf74ba7bcbc036ea3cddd1210 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 23 Nov 2022 22:43:11 +0800 Subject: [PATCH 22/27] fix: [ASAN] heap buffer overflow in sclfunc.c --- source/libs/scalar/src/sclfunc.c | 41 ++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 5496c5d1ab..d261d572f0 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1758,18 +1758,45 @@ int32_t sumScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam * break; } - if (IS_SIGNED_NUMERIC_TYPE(type)) { - int64_t *in = (int64_t *)pInputData->pData; + if (IS_SIGNED_NUMERIC_TYPE(type) || type == TSDB_DATA_TYPE_BOOL) { int64_t *out = (int64_t *)pOutputData->pData; - *out += in[i]; + if (type == TSDB_DATA_TYPE_TINYINT || type == TSDB_DATA_TYPE_BOOL) { + int8_t *in = (int8_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_SMALLINT) { + int16_t *in = (int16_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_INT) { + int32_t *in = (int32_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_BIGINT) { + int64_t *in = (int64_t *)pInputData->pData; + *out += in[i]; + } } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { - uint64_t *in = (uint64_t *)pInputData->pData; uint64_t *out = (uint64_t *)pOutputData->pData; - *out += in[i]; + if (type == TSDB_DATA_TYPE_UTINYINT) { + uint8_t *in = (uint8_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_USMALLINT) { + uint16_t *in = (uint16_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_UINT) { + uint32_t *in = (uint32_t *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_UBIGINT) { + uint64_t *in = (uint64_t *)pInputData->pData; + *out += in[i]; + } } else if (IS_FLOAT_TYPE(type)) { - double *in = (double *)pInputData->pData; double *out = (double *)pOutputData->pData; - *out += in[i]; + if (type == TSDB_DATA_TYPE_FLOAT) { + float *in = (float *)pInputData->pData; + *out += in[i]; + } else if (type == TSDB_DATA_TYPE_DOUBLE) { + double *in = (double *)pInputData->pData; + *out += in[i]; + } } } From af1b37244d379ccc1418fcb65cc6d7be7485784c Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 24 Nov 2022 00:23:20 +0800 Subject: [PATCH 23/27] ci:add ci server slave1_47 (#18407) * ci:add ci server slave1_47 * ci:add ci server slave1_47/48/52 * ci:add ci server slave1_47/48/49/52 --- Jenkinsfile2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index de39f4fcec..fcc02dc3e0 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -361,7 +361,7 @@ pipeline { } parallel { stage('check docs') { - agent{label " worker03 || slave215 || slave217 || slave219 || Mac_catalina "} + agent{label " slave1_47 || slave1_48 || slave1_49 || slave1_52 || worker03 || slave215 || slave217 || slave219 || Mac_catalina "} steps { check_docs() } @@ -407,7 +407,7 @@ pipeline { } } stage('linux test') { - agent{label " worker03 || slave215 || slave217 || slave219 "} + agent{label " slave1_47 || slave1_48 || slave1_49 || slave1_52 || worker03 || slave215 || slave217 || slave219 "} options { skipDefaultCheckout() } when { changeRequest() From 936b73b1271efba5171c314fe7fd89fc937ed9c5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 24 Nov 2022 00:31:56 +0800 Subject: [PATCH 24/27] test: add asan case --- tests/parallel_test/cases.task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index acbc13a75d..0c3d1aa919 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -611,10 +611,10 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -R -,,,system-test,python3 ./test.py -f 1-insert/update_data.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data.py ,,,system-test,python3 ./test.py -f 1-insert/tb_100w_data_order.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_stable.py -,,,system-test,python3 ./test.py -f 1-insert/delete_childtable.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_childtable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_normaltable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/keep_expired.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py From 1b1557398835a5a3386df221f527bb975fa78eb1 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 24 Nov 2022 00:49:12 +0800 Subject: [PATCH 25/27] fix: update taos-tools fab042d (#18405) * fix: taostools 05c2030 * fix: taostools 05c2030 * fix: update taos-tools b232ec3 * fix: update taostools commit * fix: update taos-tools 656e8f9 * fix: update taos-tools 7c244b4 * fix: update a61cc65 taos-tools * fix: update taos-tools 32a10ee * fix: update taos-tools 540175c * fix: update taos-tools 579a77b * fix: update taos-tools bb30d7f * fix: update taos-tools 55c217c * fix: update taos-tools d0a9f4e * fix: updata taostools 8ae6f8b * fix: update taos-tools f32ec94 * fix: update taos-tools 2cb1d69 * fix: update taos-tools d981cee * fix: cmake file format * fix: taos-tools e718155 * fix: update taos-tools 904c558 * test: build tools on windows * fix: update taos-tools fd458f0 * fix: update taos-tools 4b268d2 * fix: update taos-tools c390746 * fix: update taos-tools c6d53d4 * fix: update taos-tools d422e0a * fix: taos-tools efa2a5f * fix: update taos-tools fab042d --- cmake/taostools_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index d1c448b094..5b35e30efb 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG efa2a5f + GIT_TAG fab042d SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From a02919495bca5bed1d583d42fa874c36075538d7 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 24 Nov 2022 03:59:50 +0800 Subject: [PATCH 26/27] fix(stream): set tbname for parition --- source/libs/executor/src/groupoperator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 26a5f6838d..245b21a75b 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -906,6 +906,9 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { } else { pDest->info.parTbName[0] = 0; } + if (pParInfo->groupId && pDest->info.parTbName[0]) { + streamStatePutParName(pOperator->pTaskInfo->streamInfo.pState, pParInfo->groupId, pDest->info.parTbName); + } /*printf("\n\n set name %s\n\n", pDest->info.parTbName);*/ blockDataDestroy(pTmpBlock); blockDataDestroy(pResBlock); From fe171df1ee815ddeb91e2b08b2fceffdb0a291cd Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 24 Nov 2022 08:35:50 +0800 Subject: [PATCH 27/27] test: remove unstable case --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index a245ba1fd9..a42a8af6ee 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -417,7 +417,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/user_control.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py ,,n,system-test,python3 ./test.py -f 0-others/compatibility.py -,,,system-test,python3 ./test.py -f 1-insert/alter_database.py +#,,,system-test,python3 ./test.py -f 1-insert/alter_database.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py ,,,system-test,python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py