From 13e0134040d64063f5f0d18aa194154864b2251d Mon Sep 17 00:00:00 2001 From: huohong <346479823@qq.com> Date: Fri, 14 Mar 2025 15:23:18 +0800 Subject: [PATCH 1/7] feat: change package tar file name feat: change package tar file name --- tools/tdgpt/script/release.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/tdgpt/script/release.sh b/tools/tdgpt/script/release.sh index 0114d60ecd..c720de35c7 100755 --- a/tools/tdgpt/script/release.sh +++ b/tools/tdgpt/script/release.sh @@ -21,7 +21,7 @@ if [ "$edition" == "enterprise" ]; then fi if [ "$edition" == "community" ]; then - productName="TDengine-community-anode" + productName="TDengine-anode" fi echo start to build release package, edition: ${edition}, version: ${version} @@ -98,7 +98,13 @@ chmod a+x ${install_dir}/install.sh # exit 1 cd ${release_dir} -pkg_name=${install_dir} +platform=`uname` +if uname -m | grep -q "x86_64"; then + arch=x64 +elif uname -m | grep -q "arm64\|aarch64"; then + arch=arm64 +fi +pkg_name=${install_dir}-${platform}-${arch} echo -e "pkg_name is: ${pkg_name}" if [ "$osType" != "Darwin" ]; then From 60498503b23594796787bb27e57b308f8ca98236 Mon Sep 17 00:00:00 2001 From: Simon Guan Date: Mon, 17 Mar 2025 13:39:00 +0800 Subject: [PATCH 2/7] tests: add tdb ut (#30093) * fix: compile warnings * tests: add tdb ut * test(tdb): fix return code * test: recover ut * fix: minor changes * fix: enable test * fix: ut errors --------- Co-authored-by: Minglei Jin --- CMakeLists.txt | 1 + include/common/tcommon.h | 2 +- source/libs/tdb/test/CMakeLists.txt | 40 +++++++++++++++++++++----- source/libs/tdb/test/tdbExOVFLTest.cpp | 4 +-- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07760e923b..7813a49a62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ include(${TD_SUPPORT_DIR}/cmake.options) include(${TD_SUPPORT_DIR}/cmake.define) include(${TD_SUPPORT_DIR}/cmake.version) include(${TD_SUPPORT_DIR}/cmake.install) +enable_testing() set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF) add_subdirectory(contrib) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 13e3bbcee3..204bc30db3 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -124,7 +124,7 @@ enum { TMQ_MSG_TYPE__POLL_RAW_DATA_RSP, }; -static const char* tmqMsgTypeStr[] = { +static const char* const tmqMsgTypeStr[] = { "data", "meta", "ask ep", "meta data", "wal info", "batch meta", "raw data" }; diff --git a/source/libs/tdb/test/CMakeLists.txt b/source/libs/tdb/test/CMakeLists.txt index 6319fce86b..fbc9b38424 100644 --- a/source/libs/tdb/test/CMakeLists.txt +++ b/source/libs/tdb/test/CMakeLists.txt @@ -1,23 +1,49 @@ # tdbTest -add_executable(tdbTest "tdbTest.cpp") -target_link_libraries(tdbTest tdb gtest gtest_main) +if(${TD_LINUX}) + add_executable(tdbTest "tdbTest.cpp") + target_link_libraries(tdbTest tdb gtest_main) + add_test( + NAME tdbTest + COMMAND tdbTest + ) +endif() # tdbUtilTest add_executable(tdbUtilTest "tdbUtilTest.cpp") -target_link_libraries(tdbUtilTest tdb gtest gtest_main) +target_link_libraries(tdbUtilTest tdb gtest_main) +add_test( + NAME tdbUtilTest + COMMAND tdbUtilTest +) # overflow pages testing add_executable(tdbExOVFLTest "tdbExOVFLTest.cpp") -target_link_libraries(tdbExOVFLTest tdb gtest gtest_main) +target_link_libraries(tdbExOVFLTest tdb gtest_main) +add_test( + NAME tdbExOVFLTest + COMMAND tdbExOVFLTest +) # page defragment testing add_executable(tdbPageDefragmentTest "tdbPageDefragmentTest.cpp") -target_link_libraries(tdbPageDefragmentTest tdb gtest gtest_main) +target_link_libraries(tdbPageDefragmentTest tdb gtest_main) +add_test( + NAME tdbPageDefragmentTest + COMMAND tdbPageDefragmentTest +) # page recycling testing add_executable(tdbPageRecycleTest "tdbPageRecycleTest.cpp") -target_link_libraries(tdbPageRecycleTest tdb gtest gtest_main) +target_link_libraries(tdbPageRecycleTest tdb gtest_main) +add_test( + NAME tdbPageRecycleTest + COMMAND tdbPageRecycleTest +) # page flush testing add_executable(tdbPageFlushTest "tdbPageFlushTest.cpp") -target_link_libraries(tdbPageFlushTest tdb gtest gtest_main) +target_link_libraries(tdbPageFlushTest tdb gtest_main) +add_test( + NAME tdbPageFlushTest + COMMAND tdbPageFlushTest +) diff --git a/source/libs/tdb/test/tdbExOVFLTest.cpp b/source/libs/tdb/test/tdbExOVFLTest.cpp index 388a812ff5..e936eef07a 100644 --- a/source/libs/tdb/test/tdbExOVFLTest.cpp +++ b/source/libs/tdb/test/tdbExOVFLTest.cpp @@ -336,8 +336,8 @@ tdbBegin(pEnv, &txn); int vLen = -1; ret = tdbTbGet(pDb, "key1", strlen("key1"), &pVal, &vLen); - ASSERT(ret == -1); - GTEST_ASSERT_EQ(ret, -1); + ASSERT(ret == TSDB_CODE_NOT_FOUND); + GTEST_ASSERT_EQ(ret, TSDB_CODE_NOT_FOUND); GTEST_ASSERT_EQ(vLen, -1); GTEST_ASSERT_EQ(pVal, nullptr); From ed98b27db85118183daabd67391d4f53253e49de Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 17 Mar 2025 13:46:19 +0800 Subject: [PATCH 3/7] update workflow to handle the two mode with different step --- .github/workflows/tdengine-test.yml | 57 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tdengine-test.yml b/.github/workflows/tdengine-test.yml index 1178e393e9..3aeb1368f9 100644 --- a/.github/workflows/tdengine-test.yml +++ b/.github/workflows/tdengine-test.yml @@ -17,9 +17,23 @@ on: - 'tests/parallel/tdgpt_cases.task' - 'tests/script/tsim/analytics' - '**/*.md' + workflow_dispatch: + inputs: + specified_source_branch: + description: 'Enter the source branch name of TDengine' + required: true + type: string + specified_target_branch: + description: 'Enter the target branch name of TDengine' + required: true + type: string + specified_pr_number: + description: 'Enter the PR number of TDengine' + required: true + type: string concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-TDengine + group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ github.event.inputs.specified_target_branch }}-${{ github.event.inputs.specified_pr_number }}-TDengine cancel-in-progress: true env: @@ -28,17 +42,54 @@ env: jobs: run-tests-on-linux: uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main + if: ${{ github.event_name == 'pull_request' }} with: tdinternal: false - run_function_test: true - run_tdgpt_test: false + specified_source_branch: 'unavailable' + specified_target_branch: 'unavailable' + specified_pr_number: 'unavailable' + + run-tests-on-linux-manually: + uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main + if: ${{ github.event_name == 'workflow_dispatch' }} + with: + tdinternal: false + specified_source_branch: ${{ github.event.inputs.specified_source_branch }} + specified_target_branch: ${{ github.event.inputs.specified_target_branch }} + specified_pr_number: ${{ github.event.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: 'unavailable' + specified_target_branch: 'unavailable' + specified_pr_number: 'unavailable' + + run-tests-on-mac-munually: + uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main + if: ${{ github.event_name == 'workflow_dispatch' }} + with: + tdinternal: false + specified_source_branch: ${{ github.event.inputs.specified_source_branch }} + specified_target_branch: ${{ github.event.inputs.specified_target_branch }} + specified_pr_number: ${{ github.event.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: 'unavailable' + specified_target_branch: 'unavailable' + specified_pr_number: 'unavailable' + + run-tests-on-windows-manually: + uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main + if: ${{ github.event_name == 'workflow_dispatch' }} + with: + tdinternal: false + specified_source_branch: ${{ github.event.inputs.specified_source_branch }} + specified_target_branch: ${{ github.event.inputs.specified_target_branch }} + specified_pr_number: ${{ github.event.inputs.specified_pr_number }} From 7b193d515a310f71b1131eca07bbc05615f491b2 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 17 Mar 2025 15:47:46 +0800 Subject: [PATCH 4/7] ci: remove manual workflow --- .github/workflows/tdengine-test-manual.yml | 54 ---------------------- 1 file changed, 54 deletions(-) delete mode 100644 .github/workflows/tdengine-test-manual.yml diff --git a/.github/workflows/tdengine-test-manual.yml b/.github/workflows/tdengine-test-manual.yml deleted file mode 100644 index be14a6e908..0000000000 --- a/.github/workflows/tdengine-test-manual.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: TDengine Test (Manual) - -on: - workflow_dispatch: - inputs: - specified_source_branch: - description: 'Enter the source branch name of TDengine' - required: false - default: 'unavailable' - type: string - specified_target_branch: - description: 'Enter the target branch name of TDengine' - required: false - default: 'unavailable' - type: string - specified_pr_number: - description: 'Enter the PR number of TDengine' - required: false - default: 'unavailable' - type: string - -concurrency: - group: ${{ github.event.inputs.specified_target_branch }}-${{ github.event.inputs.specified_pr_number }}-TDengine - cancel-in-progress: true - -env: - WKC: '/var/lib/jenkins/workspace/TDinternal/community' - -jobs: - run-tests-on-linux: - uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@ci/test/workflow - with: - tdinternal: false - run_function_test: true - run_tdgpt_test: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} - - run-tests-on-mac: - uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@ci/test/workflow - with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} - - run-tests-on-windows: - uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@ci/test/workflow - with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} From 3b6173e4f3ef1abd4feda8f8b71aa2375f18df25 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 17 Mar 2025 16:32:25 +0800 Subject: [PATCH 5/7] ci: udpate input parameters and remove unusable step --- .github/workflows/tdengine-test.yml | 47 ++++++----------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/.github/workflows/tdengine-test.yml b/.github/workflows/tdengine-test.yml index 3aeb1368f9..97f2638e28 100644 --- a/.github/workflows/tdengine-test.yml +++ b/.github/workflows/tdengine-test.yml @@ -42,54 +42,27 @@ env: jobs: run-tests-on-linux: uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'}} with: tdinternal: false - specified_source_branch: 'unavailable' - specified_target_branch: 'unavailable' - specified_pr_number: 'unavailable' - - run-tests-on-linux-manually: - uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main - if: ${{ github.event_name == 'workflow_dispatch' }} - with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} + 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 }} 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: 'unavailable' - specified_target_branch: 'unavailable' - specified_pr_number: 'unavailable' - - run-tests-on-mac-munually: - uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main - if: ${{ github.event_name == 'workflow_dispatch' }} - with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} + 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 }} 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: 'unavailable' - specified_target_branch: 'unavailable' - specified_pr_number: 'unavailable' - - run-tests-on-windows-manually: - uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main - if: ${{ github.event_name == 'workflow_dispatch' }} - with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} + 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 }} From ca9436e21b6379075acce76197224957a624c362 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Mon, 17 Mar 2025 21:42:01 +0800 Subject: [PATCH 6/7] feat: add inspect tool to installation and removal scripts in packaging (#30212) * feat: add inspect tool to installation and removal scripts in packaging * feat: add taosinspect configuration and cleanup for client installation --- packaging/tools/install.sh | 76 ++++++++++++++++++++----------- packaging/tools/install_client.sh | 38 +++++++++++++--- packaging/tools/remove.sh | 6 ++- packaging/tools/remove_client.sh | 7 ++- 4 files changed, 93 insertions(+), 34 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 5e554bb7d8..d844ce876e 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -37,6 +37,7 @@ demoName="${PREFIX}demo" xname="${PREFIX}x" explorerName="${PREFIX}-explorer" keeperName="${PREFIX}keeper" +inspect_name="${PREFIX}inspect" bin_link_dir="/usr/bin" lib_link_dir="/usr/lib" @@ -156,12 +157,13 @@ done #echo "verType=${verType} interactiveFqdn=${interactiveFqdn}" -tools=(${clientName} ${benchmarkName} ${dumpName} ${demoName} remove.sh taosudf set_core.sh TDinsight.sh start_pre.sh start-all.sh stop-all.sh) +tools=(${clientName} ${benchmarkName} ${dumpName} ${demoName} ${inspect_name} remove.sh taosudf set_core.sh TDinsight.sh start_pre.sh start-all.sh stop-all.sh) if [ "${verMode}" == "cluster" ]; then services=(${serverName} ${adapterName} ${xname} ${explorerName} ${keeperName}) elif [ "${verMode}" == "edge" ]; then if [ "${pagMode}" == "full" ]; then services=(${serverName} ${adapterName} ${keeperName} ${explorerName}) + tools=(${clientName} ${benchmarkName} ${dumpName} ${demoName} remove.sh taosudf set_core.sh TDinsight.sh start_pre.sh start-all.sh stop-all.sh) else services=(${serverName}) tools=(${clientName} ${benchmarkName} remove.sh start_pre.sh) @@ -225,6 +227,7 @@ function install_bin() { ${csudo}cp -r ${script_dir}/bin/${clientName} ${install_main_dir}/bin ${csudo}cp -r ${script_dir}/bin/${benchmarkName} ${install_main_dir}/bin ${csudo}cp -r ${script_dir}/bin/${dumpName} ${install_main_dir}/bin + ${csudo}cp -r ${script_dir}/bin/${inspect_name} ${install_main_dir}/bin ${csudo}cp -r ${script_dir}/bin/remove.sh ${install_main_dir}/bin else ${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin @@ -521,14 +524,14 @@ function local_fqdn_check() { function install_taosx_config() { [ ! -z $1 ] && return 0 || : # only install client - fileName="${script_dir}/${xname}/etc/${PREFIX}/${xname}.toml" - if [ -f ${fileName} ]; then - ${csudo}sed -i -r "s/#*\s*(fqdn\s*=\s*).*/\1\"${serverFqdn}\"/" ${fileName} + file_name="${script_dir}/${xname}/etc/${PREFIX}/${xname}.toml" + if [ -f ${file_name} ]; then + ${csudo}sed -i -r "s/#*\s*(fqdn\s*=\s*).*/\1\"${serverFqdn}\"/" ${file_name} if [ -f "${configDir}/${xname}.toml" ]; then - ${csudo}cp ${fileName} ${configDir}/${xname}.toml.new + ${csudo}cp ${file_name} ${configDir}/${xname}.toml.new else - ${csudo}cp ${fileName} ${configDir}/${xname}.toml + ${csudo}cp ${file_name} ${configDir}/${xname}.toml fi fi } @@ -538,18 +541,18 @@ function install_explorer_config() { [ ! -z $1 ] && return 0 || : # only install client if [ "$verMode" == "cluster" ]; then - fileName="${script_dir}/${xname}/etc/${PREFIX}/explorer.toml" + file_name="${script_dir}/${xname}/etc/${PREFIX}/explorer.toml" else - fileName="${script_dir}/cfg/explorer.toml" + file_name="${script_dir}/cfg/explorer.toml" fi - if [ -f ${fileName} ]; then - ${csudo}sed -i "s/localhost/${serverFqdn}/g" ${fileName} + if [ -f ${file_name} ]; then + ${csudo}sed -i "s/localhost/${serverFqdn}/g" ${file_name} if [ -f "${configDir}/explorer.toml" ]; then - ${csudo}cp ${fileName} ${configDir}/explorer.toml.new + ${csudo}cp ${file_name} ${configDir}/explorer.toml.new else - ${csudo}cp ${fileName} ${configDir}/explorer.toml + ${csudo}cp ${file_name} ${configDir}/explorer.toml fi fi } @@ -557,14 +560,14 @@ function install_explorer_config() { function install_adapter_config() { [ ! -z $1 ] && return 0 || : # only install client - fileName="${script_dir}/cfg/${adapterName}.toml" - if [ -f ${fileName} ]; then - ${csudo}sed -i -r "s/localhost/${serverFqdn}/g" ${fileName} + file_name="${script_dir}/cfg/${adapterName}.toml" + if [ -f ${file_name} ]; then + ${csudo}sed -i -r "s/localhost/${serverFqdn}/g" ${file_name} if [ -f "${configDir}/${adapterName}.toml" ]; then - ${csudo}cp ${fileName} ${configDir}/${adapterName}.toml.new + ${csudo}cp ${file_name} ${configDir}/${adapterName}.toml.new else - ${csudo}cp ${fileName} ${configDir}/${adapterName}.toml + ${csudo}cp ${file_name} ${configDir}/${adapterName}.toml fi fi } @@ -572,21 +575,21 @@ function install_adapter_config() { function install_keeper_config() { [ ! -z $1 ] && return 0 || : # only install client - fileName="${script_dir}/cfg/${keeperName}.toml" - if [ -f ${fileName} ]; then - ${csudo}sed -i -r "s/127.0.0.1/${serverFqdn}/g" ${fileName} + file_name="${script_dir}/cfg/${keeperName}.toml" + if [ -f ${file_name} ]; then + ${csudo}sed -i -r "s/127.0.0.1/${serverFqdn}/g" ${file_name} if [ -f "${configDir}/${keeperName}.toml" ]; then - ${csudo}cp ${fileName} ${configDir}/${keeperName}.toml.new + ${csudo}cp ${file_name} ${configDir}/${keeperName}.toml.new else - ${csudo}cp ${fileName} ${configDir}/${keeperName}.toml + ${csudo}cp ${file_name} ${configDir}/${keeperName}.toml fi fi } function install_taosd_config() { - fileName="${script_dir}/cfg/${configFile}" - if [ -f ${fileName} ]; then + file_name="${script_dir}/cfg/${configFile}" + if [ -f ${file_name} ]; then ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$serverFqdn/" ${script_dir}/cfg/${configFile} ${csudo}echo "monitor 1" >>${script_dir}/cfg/${configFile} ${csudo}echo "monitorFQDN ${serverFqdn}" >>${script_dir}/cfg/${configFile} @@ -595,15 +598,27 @@ function install_taosd_config() { fi if [ -f "${configDir}/${configFile}" ]; then - ${csudo}cp ${fileName} ${configDir}/${configFile}.new + ${csudo}cp ${file_name} ${configDir}/${configFile}.new else - ${csudo}cp ${fileName} ${configDir}/${configFile} + ${csudo}cp ${file_name} ${configDir}/${configFile} fi fi ${csudo}ln -sf ${configDir}/${configFile} ${install_main_dir}/cfg } +function install_taosinspect_config() { + file_name="${script_dir}/cfg/inspect.cfg" + if [ -f ${file_name} ]; then + if [ -f "${configDir}/inspect.cfg" ]; then + ${csudo}cp ${file_name} ${configDir}/inspect.cfg.new + else + ${csudo}cp ${file_name} ${configDir}/inspect.cfg + fi + fi + + ${csudo}ln -sf ${configDir}/inspect.cfg ${install_main_dir}/cfg +} function install_config() { @@ -915,6 +930,10 @@ function updateProduct() { install_adapter_config install_taosx_config install_explorer_config + if [ "${verMode}" == "cluster" ]; then + install_taosinspect_config + fi + if [ "${verMode}" != "cloud" ]; then install_keeper_config fi @@ -1007,6 +1026,11 @@ function installProduct() { install_adapter_config install_taosx_config install_explorer_config + + if [ "${verMode}" == "cluster" ]; then + install_taosinspect_config + fi + if [ "${verMode}" != "cloud" ]; then install_keeper_config fi diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh index 9ba9529146..532838fd2b 100755 --- a/packaging/tools/install_client.sh +++ b/packaging/tools/install_client.sh @@ -32,6 +32,8 @@ benchmarkName2="${clientName2}Benchmark" dumpName2="${clientName2}dump" demoName2="${clientName2}demo" uninstallScript2="rm${clientName2}" +inspect_name="${clientName2}inspect" + if [ "$osType" != "Darwin" ]; then script_dir=$(dirname $(readlink -f "$0")) @@ -106,12 +108,15 @@ function install_main_path() { function install_bin() { # Remove links - ${csudo}rm -f ${bin_link_dir}/${clientName} || : + ${csudo}rm -f ${bin_link_dir}/${clientName} || : if [ "$osType" != "Darwin" ]; then ${csudo}rm -f ${bin_link_dir}/taosdemo || : + ${csudo}rm -f ${bin_link_dir}/${inspect_name} || : fi - ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : - ${csudo}rm -f ${bin_link_dir}/set_core || : + ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : + ${csudo}rm -f ${bin_link_dir}/set_core || : + ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || : + ${csudo}rm -f ${bin_link_dir}/${dumpName2} || : ${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/* @@ -119,6 +124,7 @@ function install_bin() { [ -x ${install_main_dir}/bin/${clientName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName2} ${bin_link_dir}/${clientName2} || : if [ "$osType" != "Darwin" ]; then [ -x ${install_main_dir}/bin/${demoName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${demoName2} ${bin_link_dir}/${demoName2} || : + [ -x ${install_main_dir}/bin/${inspect_name} ] && ${csudo}ln -s ${install_main_dir}/bin/${inspect_name} ${bin_link_dir}/${inspect_name} || : fi [ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : @@ -237,16 +243,34 @@ function install_jemalloc() { } function install_config() { - if [ ! -f ${cfg_install_dir}/${configFile} ]; then + file_name=${cfg_install_dir}/${configFile} + if [ -f ${file_name} ]; then + echo "The configuration file ${file_name} already exists" + ${csudo}cp ${file_name} ${cfg_install_dir}/${configFile}.new + else ${csudo}mkdir -p ${cfg_install_dir} [ -f ${script_dir}/cfg/${configFile} ] && ${csudo}cp ${script_dir}/cfg/${configFile} ${cfg_install_dir} ${csudo}chmod 644 ${cfg_install_dir}/* + ${csudo}ln -s ${cfg_install_dir}/${configFile} ${install_main_dir}/cfg fi - ${csudo}cp -f ${script_dir}/cfg/${configFile} ${install_main_dir}/cfg/${configFile}.org - ${csudo}ln -s ${cfg_install_dir}/${configFile} ${install_main_dir}/cfg + } +function install_taosinspect_config() { + file_name="${script_dir}/cfg/inspect.cfg" + if [ -f ${file_name} ]; then + if [ -f "${cfg_install_dir}/inspect.cfg" ]; then + ${csudo}cp ${file_name} ${cfg_install_dir}/inspect.cfg.new + else + ${csudo}mkdir -p ${cfg_install_dir} + ${csudo}cp ${file_name} ${cfg_install_dir}/inspect.cfg + fi + ${csudo}ln -sf ${cfg_install_dir}/inspect.cfg ${install_main_dir}/cfg + fi + + +} function install_log() { ${csudo}rm -rf ${log_dir} || : @@ -293,6 +317,7 @@ function update_TDengine() { install_jemalloc if [ "$verMode" == "cluster" ]; then install_connector + install_taosinspect_config fi install_examples install_bin @@ -320,6 +345,7 @@ function install_TDengine() { install_jemalloc if [ "$verMode" == "cluster" ]; then install_connector + install_taosinspect_config fi install_examples install_bin diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index b7bda31e13..621ed7f2a9 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -44,6 +44,7 @@ dumpName="${PREFIX}dump" keeperName="${PREFIX}keeper" xName="${PREFIX}x" explorerName="${PREFIX}-explorer" +inspect_name="${PREFIX}inspect" tarbitratorName="tarbitratord" productName="TDengine" @@ -58,10 +59,13 @@ config_dir="/etc/${PREFIX}" if [ "${verMode}" == "cluster" ]; then services=(${PREFIX}"d" ${PREFIX}"adapter" ${PREFIX}"keeper") + tools=(${PREFIX} ${PREFIX}"Benchmark" ${PREFIX}"dump" ${PREFIX}"demo" ${PREFIX}"inspect" taosudf set_core.sh TDinsight.sh $uninstallScript start-all.sh stop-all.sh) else + tools=(${PREFIX} ${PREFIX}"Benchmark" ${PREFIX}"dump" ${PREFIX}"demo" taosudf set_core.sh TDinsight.sh $uninstallScript start-all.sh stop-all.sh) + services=(${PREFIX}"d" ${PREFIX}"adapter" ${PREFIX}"keeper" ${PREFIX}"-explorer") fi -tools=(${PREFIX} ${PREFIX}"Benchmark" ${PREFIX}"dump" ${PREFIX}"demo" taosudf set_core.sh TDinsight.sh $uninstallScript start-all.sh stop-all.sh) + csudo="" if command -v sudo >/dev/null; then diff --git a/packaging/tools/remove_client.sh b/packaging/tools/remove_client.sh index 1d2965f66b..33454d7512 100755 --- a/packaging/tools/remove_client.sh +++ b/packaging/tools/remove_client.sh @@ -7,6 +7,7 @@ set -e RED='\033[0;31m' GREEN='\033[1;32m' NC='\033[0m' +verMode=edge installDir="/usr/local/taos" clientName="taos" @@ -18,8 +19,10 @@ productName2="TDengine" benchmarkName2="${clientName2}Benchmark" demoName2="${clientName2}demo" dumpName2="${clientName2}dump" +inspect_name="${clientName2}inspect" uninstallScript2="rm${clientName2}" + installDir="/usr/local/${clientName2}" #install main path @@ -52,8 +55,9 @@ function clean_bin() { ${csudo}rm -f ${bin_link_dir}/${demoName2} || : ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || : ${csudo}rm -f ${bin_link_dir}/${dumpName2} || : - ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : + ${csudo}rm -f ${bin_link_dir}/${uninstallScript2} || : ${csudo}rm -f ${bin_link_dir}/set_core || : + [ -f ${bin_link_dir}/${inspect_name} ] && ${csudo}rm -f ${bin_link_dir}/${inspect_name} || : if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then ${csudo}rm -f ${bin_link_dir}/${clientName2} || : @@ -61,6 +65,7 @@ function clean_bin() { ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || : ${csudo}rm -f ${bin_link_dir}/${dumpName2} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript2} || : + [ -f ${bin_link_dir}/${inspect_name} ] && ${csudo}rm -f ${bin_link_dir}/${inspect_name} || : fi } From a2fd1ee68ff8d06a92aa42dafd8101ccf05c44a6 Mon Sep 17 00:00:00 2001 From: Jing Sima Date: Mon, 17 Mar 2025 22:27:56 +0800 Subject: [PATCH 7/7] fix: [TD-34074] fix compile error. (#30221) --- source/libs/catalog/src/catalog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 8d38827af8..1673e9977e 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -235,9 +235,10 @@ int32_t ctgGetTbMeta(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgTbMetaCtx* ctx TAOS_MEMCPY(output->tbMeta, output->vctbMeta, sizeof(SVCTableMeta)); output->tbMeta->colRef = (SColRef *)((char *)output->tbMeta + metaSize + schemaExtSize); TAOS_MEMCPY(output->tbMeta->colRef, output->vctbMeta->colRef, colRefSize); - } else { - TAOS_MEMCPY(output->tbMeta, output->vctbMeta, sizeof(SVCTableMeta) + colRefSize); - output->tbMeta->colRef = (SColRef *)((char *)output->tbMeta + sizeof(SVCTableMeta)); + } else { + ctgError("tb:%s, tbmeta got, but tbMeta is NULL", output->tbName); + taosMemoryFreeClear(output->vctbMeta); + CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR); } output->tbMeta->numOfColRefs = output->vctbMeta->numOfColRefs; taosMemoryFreeClear(output->vctbMeta);