From 3dd70ea24a72b0637c22a6e89dd6dadc8679de22 Mon Sep 17 00:00:00 2001 From: Zhixiao Bao <62235797+xiao-77@users.noreply.github.com> Date: Mon, 17 Mar 2025 22:31:42 +0800 Subject: [PATCH 1/5] docs: fix some config docs' errors. (#30215) --- docs/zh/14-reference/01-components/01-taosd.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/zh/14-reference/01-components/01-taosd.md b/docs/zh/14-reference/01-components/01-taosd.md index 9a4e5ec1af..6bcc7bd69b 100644 --- a/docs/zh/14-reference/01-components/01-taosd.md +++ b/docs/zh/14-reference/01-components/01-taosd.md @@ -686,7 +686,7 @@ charset 的有效值是 UTF-8。 #### numOfMnodeReadThreads - 说明:mnode 的 Read 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 1 不超过 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -695,7 +695,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeQueryThreads - 说明:vnode 的 Query 线程数目 - 类型:整数 -- 默认值:CPU 核数的两倍(不超过 16) +- 默认值:CPU 核数的两倍(不低于 16) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -704,7 +704,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeFetchThreads - 说明:vnode 的 Fetch 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -713,7 +713,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeRsmaThreads - 说明:vnode 的 Rsma 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -722,7 +722,7 @@ charset 的有效值是 UTF-8。 #### numOfQnodeQueryThreads - 说明:qnode 的 Query 线程数目 - 类型:整数 -- 默认值:CPU 核数的两倍(不超过 16) +- 默认值:CPU 核数的两倍(不低于 16) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -1007,13 +1007,13 @@ charset 的有效值是 UTF-8。 #### udfdResFuncs - 说明:用于统计用量 **`内部参数`** -- 类型:整数 +- 类型:字符串 - 动态修改:支持通过 SQL 修改,重启生效。 - 支持版本:从 v3.1.0.0 版本开始引入 #### udfdLdLibPath - 说明:用于统计用量 **`内部参数`** -- 类型:整数 +- 类型:字符串 - 动态修改:支持通过 SQL 修改,重启生效。 - 支持版本:从 v3.1.0.0 版本开始引入 From 3b36b485517cac91097ecb62ef3477ab6dd38b55 Mon Sep 17 00:00:00 2001 From: yanyuxing Date: Tue, 18 Mar 2025 09:59:47 +0800 Subject: [PATCH 2/5] docs: fix the spelling error in the 'Building' section of the README (#30229) --- README-CN.md | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README-CN.md b/README-CN.md index 40e97de2ba..9b8ae8a167 100644 --- a/README-CN.md +++ b/README-CN.md @@ -157,7 +157,7 @@ make 如果你想要编译 taosAdapter,需要添加 `-DBUILD_HTTP=false` 选项。 -如果你想要编译 taosKeeper,需要添加 `--DBUILD_KEEPER=true` 选项。 +如果你想要编译 taosKeeper,需要添加 `-DBUILD_KEEPER=true` 选项。 可以使用Jemalloc作为内存分配器,而不是使用glibc: @@ -188,7 +188,7 @@ cmake .. && cmake --build . 如果你想要编译 taosAdapter,需要添加 `-DBUILD_HTTP=false` 选项。 -如果你想要编译 taosKeeper,需要添加 `--DBUILD_KEEPER=true` 选项。 +如果你想要编译 taosKeeper,需要添加 `-DBUILD_KEEPER=true` 选项。 diff --git a/README.md b/README.md index d532046ce7..42538519bc 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ make If you want to compile taosAdapter, you need to add the `-DBUILD_HTTP=false` option. -If you want to compile taosKeeper, you need to add the `--DBUILD_KEEPER=true` option. +If you want to compile taosKeeper, you need to add the `-DBUILD_KEEPER=true` option. You can use Jemalloc as memory allocator instead of glibc: @@ -204,7 +204,7 @@ cmake .. && cmake --build . If you want to compile taosAdapter, you need to add the `-DBUILD_HTTP=false` option. -If you want to compile taosKeeper, you need to add the `--DBUILD_KEEPER=true` option. +If you want to compile taosKeeper, you need to add the `-DBUILD_KEEPER=true` option. From 83c403805bbd1e1e69b2a9d350d72d61690273c7 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Tue, 18 Mar 2025 10:03:35 +0800 Subject: [PATCH 3/5] ci: fix concurrency issue for manual mode --- .github/workflows/tdengine-test.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tdengine-test.yml b/.github/workflows/tdengine-test.yml index 086ca4a6b8..9c7a35f8dc 100644 --- a/.github/workflows/tdengine-test.yml +++ b/.github/workflows/tdengine-test.yml @@ -33,7 +33,9 @@ on: type: string concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ github.event.inputs.specified_target_branch }}-${{ github.event.inputs.specified_pr_number }}-TDengine + group: ${{ github.workflow }}-${{ github.event_name }}- + ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || inputs.specified_target_branch }}- + ${{ github.event_name == 'pull_request' && github.event.pull_request.number || inputs.specified_pr_number }}-TDengine cancel-in-progress: true env: @@ -45,24 +47,24 @@ jobs: if: ${{ github.event_name == 'pull_request' }} with: tdinternal: false - specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_pr_number }} + specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_source_branch }} + specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_target_branch }} + specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_pr_number }} run-tests-on-mac: uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main if: ${{ github.event_name == 'pull_request' }} with: tdinternal: false - specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_pr_number }} + specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_source_branch }} + specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_target_branch }} + specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_pr_number }} run-tests-on-windows: uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main if: ${{ github.event_name == 'pull_request' }} with: tdinternal: false - specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_pr_number }} + specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_source_branch }} + specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_target_branch }} + specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || inputs.specified_pr_number }} From a3b042c078fcf0ddc2c4d5d301f6060b1db44eda Mon Sep 17 00:00:00 2001 From: Mario Peng <48949600+Pengrongkun@users.noreply.github.com> Date: Tue, 18 Mar 2025 13:45:20 +0800 Subject: [PATCH 4/5] fix: on windows, closing a JDBC PreparedStatement while writing data may cause the JVM to crash. --- source/client/src/clientStmt.c | 20 ++++++++++---------- source/client/src/clientStmt2.c | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index 165c7b8bfb..7c9a38679c 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -1630,20 +1630,20 @@ int stmtClose(TAOS_STMT* stmt) { STMT_DLOG_E("start to free stmt"); - pStmt->queue.stopQueue = true; - - (void)taosThreadMutexLock(&pStmt->queue.mutex); - (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); - (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); - (void)taosThreadMutexUnlock(&pStmt->queue.mutex); - if (pStmt->bindThreadInUse) { + pStmt->queue.stopQueue = true; + + (void)taosThreadMutexLock(&pStmt->queue.mutex); + (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); + (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); + (void)taosThreadMutexUnlock(&pStmt->queue.mutex); + (void)taosThreadJoin(pStmt->bindThread, NULL); pStmt->bindThreadInUse = false; - } - (void)taosThreadCondDestroy(&pStmt->queue.waitCond); - (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + (void)taosThreadCondDestroy(&pStmt->queue.waitCond); + (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + } STMT_DLOG("stmt %p closed, stbInterlaceMode: %d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64 ", parseSqlNum=>%" PRId64 ", pStmt->stat.bindDataNum=>%" PRId64 diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index 75d763ec71..18e3a10c3b 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1768,18 +1768,18 @@ int stmtClose2(TAOS_STMT2* stmt) { pStmt->queue.stopQueue = true; - (void)taosThreadMutexLock(&pStmt->queue.mutex); - (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); - (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); - (void)taosThreadMutexUnlock(&pStmt->queue.mutex); - if (pStmt->bindThreadInUse) { + (void)taosThreadMutexLock(&pStmt->queue.mutex); + (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); + (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); + (void)taosThreadMutexUnlock(&pStmt->queue.mutex); + (void)taosThreadJoin(pStmt->bindThread, NULL); pStmt->bindThreadInUse = false; - } - (void)taosThreadCondDestroy(&pStmt->queue.waitCond); - (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + (void)taosThreadCondDestroy(&pStmt->queue.waitCond); + (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + } if (pStmt->options.asyncExecFn && !pStmt->semWaited) { if (tsem_wait(&pStmt->asyncQuerySem) != 0) { From 84537260804e1ab83663883fd6361b36cb1597fa Mon Sep 17 00:00:00 2001 From: xinsheng Ren <285808407@qq.com> Date: Tue, 18 Mar 2025 13:58:30 +0800 Subject: [PATCH 5/5] fix: when querying super table, using ORDER BY and LIMIT together may return an unexpected record. * fix: limit error * fix: limit error, test case. --- source/libs/executor/src/scanoperator.c | 2 +- tests/system-test/2-query/large_data.py | 46 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index ce2a5019a6..da723e4343 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -6546,7 +6546,7 @@ int32_t createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SR pInfo->mergeLimit = -1; bool hasLimit = pInfo->limitInfo.limit.limit != -1 || pInfo->limitInfo.limit.offset != -1; if (hasLimit) { - pInfo->mergeLimit = pInfo->limitInfo.limit.limit + pInfo->limitInfo.limit.offset; + pInfo->mergeLimit = pInfo->limitInfo.limit.offset != -1 ? pInfo->limitInfo.limit.limit + pInfo->limitInfo.limit.offset : pInfo->limitInfo.limit.limit; pInfo->mSkipTables = NULL; } diff --git a/tests/system-test/2-query/large_data.py b/tests/system-test/2-query/large_data.py index 2279c3ce70..70353fc2d6 100644 --- a/tests/system-test/2-query/large_data.py +++ b/tests/system-test/2-query/large_data.py @@ -43,10 +43,56 @@ class TDTestCase: tdSql.query("select d0.ts from test.d0 left join test.d1 on d0.ts=d1.ts limit 1000000;") tdSql.checkRows(num1) + + def ts6136(self): + start = 1500000000000 + tdSql.execute("drop database if exists test1;") + + tdCases.taosBenchmarkExec(f"-d test1 -t 3 -n 1000000 -s {start} -y") + + while True: + tdSql.query("select count(*) from test1.meters;") + tdSql.checkRowCol(0, 0) + if tdSql.queryResult[0][0] == 3000000: + tdLog.info(f"ts6136 data ready, sum: {tdSql.queryResult[0][0]}") + break + tdLog.info(f"waiting for data ready, sum: {tdSql.queryResult[0][0]}") + time.sleep(1) + + tdSql.query(f"insert into test1.d0 values({start + 962000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 961000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 960000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 602000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d1 values({start + 602000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 302000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 2000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 0}, 1, 1, 1);") + + # Query with limit 20 and store the results + tdSql.query("select tbname, ts, current from test1.meters where current = 1 and voltage = 1 and phase = 1 order by ts desc limit 8;") + tdSql.checkRows(8) + + tbname_list = [row[0] for row in tdSql.queryResult] + ts_list = [row[1] for row in tdSql.queryResult] + + # Test with different limits + for limit in range(1, 10): + row = min(8, limit) + tdSql.query(f"select tbname, ts, current from test1.meters where current = 1 and voltage = 1 and phase = 1 order by ts desc limit {limit};") + tdSql.checkRows(row) + result = tdSql.queryResult[:row] + + for i in range(min(10, len(result))): + tdSql.checkData(i, 0, tbname_list[i]) + tdSql.checkData(i, 1, ts_list[i]) + + tdLog.info("All tests passed for ts6136") + def run(self): self.prepare_data() self.ts5803() + self.ts6136() def stop(self): tdSql.close()