From 74f8a252c629ec14f395607d59f893cf2ebbd2bf Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 8 Feb 2025 14:14:58 +0800 Subject: [PATCH 01/45] enh: solve conflict during process log file --- source/dnode/mnode/impl/inc/mndDef.h | 2 +- source/util/src/tlog.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 90f1bd9b8e..7c82b08e3c 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -205,7 +205,7 @@ typedef struct { typedef struct { int64_t id; - char name[TSDB_CLUSTER_ID_LEN]; + char nameX[TSDB_CLUSTER_ID_LEN]; int64_t createdTime; int64_t updateTime; int32_t upTime; diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 4f5ca8d789..0803040211 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -385,13 +385,21 @@ static void taosReserveOldLog(char *oldName, char *keepName) { static void taosKeepOldLog(char *oldName) { if (oldName[0] != 0) { - char compressFileName[PATH_MAX + 20]; - snprintf(compressFileName, PATH_MAX + 20, "%s.gz", oldName); - if (taosCompressFile(oldName, compressFileName) == 0) { - int32_t code = taosRemoveFile(oldName); - if (code != 0) { - TAOS_UNUSED(printf("failed to remove file:%s, reason:%s\n", oldName, tstrerror(code))); - } + int32_t code = 0, lino = 0; + TdFilePtr oldFile = NULL; + if ((oldFile = taosOpenFile(oldName, TD_FILE_READ))) { + TAOS_CHECK_GOTO(taosLockFile(oldFile), &lino, _exit2); + char compressFileName[PATH_MAX + 20]; + snprintf(compressFileName, PATH_MAX + 20, "%s.gz", oldName); + TAOS_CHECK_GOTO(taosCompressFile(oldName, compressFileName), &lino, _exit1); + TAOS_CHECK_GOTO(taosRemoveFile(oldName), &lino, _exit1); + } + _exit1: + TAOS_UNUSED(taosUnLockFile(oldFile)); + _exit2: + TAOS_UNUSED(taosCloseFile(&oldFile)); + if (code != 0) { + uWarn("failed at line %d to keep old log file:%s, reason:%s\n", oldName, lino, tstrerror(code)); } } } @@ -1041,7 +1049,7 @@ static void taosWriteLog(SLogBuff *pLogBuf) { } #define LOG_ROTATE_INTERVAL 3600 -#if !defined(TD_ENTERPRISE) || defined(ASSERT_NOT_CORE) +#if !defined(TD_ENTERPRISE) || defined(ASSERT_NOT_CORE) || defined(GRANTS_CFG) #define LOG_INACTIVE_TIME 7200 #define LOG_ROTATE_BOOT 900 #else From 34896f15e44e91bfaf8c6e1ab3e8756a6a201b71 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 8 Feb 2025 14:17:00 +0800 Subject: [PATCH 02/45] enh: solve conflict during process log file --- source/dnode/mnode/impl/inc/mndDef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 7c82b08e3c..90f1bd9b8e 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -205,7 +205,7 @@ typedef struct { typedef struct { int64_t id; - char nameX[TSDB_CLUSTER_ID_LEN]; + char name[TSDB_CLUSTER_ID_LEN]; int64_t createdTime; int64_t updateTime; int32_t upTime; From fea6148c968b8d36b9a049639feeb9c7854858f8 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 8 Feb 2025 14:19:06 +0800 Subject: [PATCH 03/45] enh: solve conflict during process log file --- source/util/src/tlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 0803040211..eb4b4de863 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -399,7 +399,7 @@ static void taosKeepOldLog(char *oldName) { _exit2: TAOS_UNUSED(taosCloseFile(&oldFile)); if (code != 0) { - uWarn("failed at line %d to keep old log file:%s, reason:%s\n", oldName, lino, tstrerror(code)); + uWarn("failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); } } } From f9dc305e3583771739a5370fd8c1ec3715c6f9fd Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 8 Feb 2025 16:08:40 +0800 Subject: [PATCH 04/45] enh: print err msg only in embedded log mode --- source/util/src/tlog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index eb4b4de863..94b6b67018 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -398,8 +398,9 @@ static void taosKeepOldLog(char *oldName) { TAOS_UNUSED(taosUnLockFile(oldFile)); _exit2: TAOS_UNUSED(taosCloseFile(&oldFile)); - if (code != 0) { - uWarn("failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); + if (code != 0 && tsLogEmbedded == 1) { // only print error message in embedded log mode + // don't use uWarn or uError, because it may open new log file and cause dead lock + fprintf(stderr, "failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); } } } From 3edb8ae41c0565199f483a3a8876c182ed1091a6 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sun, 9 Feb 2025 09:31:41 +0800 Subject: [PATCH 05/45] chore: logic optimization --- source/util/src/tlog.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 94b6b67018..8537f35095 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -393,13 +393,15 @@ static void taosKeepOldLog(char *oldName) { snprintf(compressFileName, PATH_MAX + 20, "%s.gz", oldName); TAOS_CHECK_GOTO(taosCompressFile(oldName, compressFileName), &lino, _exit1); TAOS_CHECK_GOTO(taosRemoveFile(oldName), &lino, _exit1); + _exit1: + TAOS_UNUSED(taosUnLockFile(oldFile)); + _exit2: + TAOS_UNUSED(taosCloseFile(&oldFile)); + } else { + code = terrno; } - _exit1: - TAOS_UNUSED(taosUnLockFile(oldFile)); - _exit2: - TAOS_UNUSED(taosCloseFile(&oldFile)); - if (code != 0 && tsLogEmbedded == 1) { // only print error message in embedded log mode - // don't use uWarn or uError, because it may open new log file and cause dead lock + if (code != 0 && tsLogEmbedded == 1) { // print error messages only in embedded log mode + // avoid using uWarn or uError, as they may open a new log file and potentially cause a deadlock. fprintf(stderr, "failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); } } From 64eada9324f7662d84579663a9527d3bc152b1cd Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 10 Feb 2025 21:39:10 +0800 Subject: [PATCH 06/45] fix: change commit id for taos-tools --- tools/taos-tools/src/CMakeLists.txt | 95 +++-------------------------- 1 file changed, 10 insertions(+), 85 deletions(-) diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index 7b3b487917..c2598d56b0 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -38,63 +38,17 @@ ENDIF () FIND_PACKAGE(Git) IF(GIT_FOUND) - IF (EXISTS "${CMAKE_CURRENT_LIST_DIR}/../VERSION") - MESSAGE("Found VERSION file") - EXECUTE_PROCESS( - COMMAND grep "^taosdump" "${CMAKE_CURRENT_LIST_DIR}/../VERSION" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSDUMP_FULLTAG - ) - EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. log --pretty=oneline -n 1 HEAD" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSDUMP_COMMIT_SHA1 - ) - EXECUTE_PROCESS( - COMMAND grep "^taosbenchmark" "${CMAKE_CURRENT_LIST_DIR}/../VERSION" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_FULLTAG - ) - EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. log --pretty=oneline -n 1 HEAD" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_SHA1 - ) - ELSE () - MESSAGE("Use git tag") - EXECUTE_PROCESS( - COMMAND sh -c "git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags|grep taosdump|tail -1" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE TAG_RESULT - OUTPUT_VARIABLE TAOSDUMP_FULLTAG - ) - EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. log --pretty=oneline -n 1 ${TAOSDUMP_FULLTAG}" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSDUMP_COMMIT_SHA1 - ) - EXECUTE_PROCESS( - COMMAND sh -c "git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags|grep taosbenchmark|tail -1" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE TAG_RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_FULLTAG - ) - EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. log --pretty=oneline -n 1 ${TAOSBENCHMARK_FULLTAG}" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_SHA1 - ) - ENDIF () + #commit id EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. status -z -s ${CMAKE_CURRENT_LIST_DIR}/taosdump.c" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSDUMP_STATUS - ERROR_QUIET - ) + COMMAND git log -1 --format=%H + WORKING_DIRECTORY ${TD_COMMUNITY_DIR} + OUTPUT_VARIABLE GIT_COMMIT_ID + ) + + SET(TAOSBENCHMARK_COMMIT_SHA1, ${GIT_COMMIT_ID}) + SET(TAOSDUMP_COMMIT_SHA1, ${GIT_COMMIT_ID}) + MESSAGE("taosBenchmark commid_id:${TAOSBENCHMARK_COMMIT_SHA1}") + MESSAGE("taosdump commid_id:${TAOSDUMP_COMMIT_SHA1}") # version IF (DEFINED TD_VER_NUMBER) @@ -118,35 +72,6 @@ IF(GIT_FOUND) MESSAGE(STATUS "taosBenchmark use origin version: " ${TAOSBENCHMARK_TAG}) ENDIF () - EXECUTE_PROCESS( - COMMAND sh -c "git --git-dir=${CMAKE_CURRENT_LIST_DIR}/../.git --work-tree=${CMAKE_CURRENT_LIST_DIR}/.. status -z -s ${CMAKE_CURRENT_LIST_DIR}/bench*.c" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_STATUS - ERROR_QUIET - ) - IF ("${TAOSDUMP_COMMIT_SHA1}" STREQUAL "") - SET(TAOSDUMP_COMMIT_SHA1 "unknown") - ELSE () - STRING(SUBSTRING "${TAOSDUMP_COMMIT_SHA1}" 0 40 TAOSDUMP_COMMIT_SHA1) - STRING(STRIP "${TAOSDUMP_COMMIT_SHA1}" TAOSDUMP_COMMIT_SHA1) - ENDIF () - IF ("${TAOSDUMP_TAG}" STREQUAL "") - SET(TAOSDUMP_TAG "0.1.0") - ELSE () - STRING(STRIP "${TAOSDUMP_TAG}" TAOSDUMP_TAG) - ENDIF () - - IF ("${TAOSBENCHMARK_COMMIT_SHA1}" STREQUAL "") - SET(TAOSBENCHMARK_COMMIT_SHA1 "unknown") - ELSE () - STRING(SUBSTRING "${TAOSBENCHMARK_COMMIT_SHA1}" 0 40 TAOSBENCHMARK_COMMIT_SHA1) - STRING(STRIP "${TAOSBENCHMARK_COMMIT_SHA1}" TAOSBENCHMARK_COMMIT_SHA1) - ENDIF () - IF ("${TAOSBENCHMARK_TAG}" STREQUAL "") - SET(TAOSBENCHMARK_TAG "0.1.0") - ELSE () - STRING(STRIP "${TAOSBENCHMARK_TAG}" TAOSBENCHMARK_TAG) - ENDIF () ELSE() MESSAGE("Git not found") SET(TAOSDUMP_COMMIT_SHA1 "unknown") From 3fef8682e798ae92c6fc0998c487bb7853241642 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 10 Feb 2025 21:49:20 +0800 Subject: [PATCH 07/45] fix: get for split taosbenchmark --- tools/taos-tools/src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index c2598d56b0..c98c7487a1 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -42,11 +42,13 @@ IF(GIT_FOUND) EXECUTE_PROCESS( COMMAND git log -1 --format=%H WORKING_DIRECTORY ${TD_COMMUNITY_DIR} - OUTPUT_VARIABLE GIT_COMMIT_ID + OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_SHA1 ) - - SET(TAOSBENCHMARK_COMMIT_SHA1, ${GIT_COMMIT_ID}) - SET(TAOSDUMP_COMMIT_SHA1, ${GIT_COMMIT_ID}) + EXECUTE_PROCESS( + COMMAND git log -1 --format=%H + WORKING_DIRECTORY ${TD_COMMUNITY_DIR} + OUTPUT_VARIABLE TAOSDUMP_COMMIT_SHA1 + ) MESSAGE("taosBenchmark commid_id:${TAOSBENCHMARK_COMMIT_SHA1}") MESSAGE("taosdump commid_id:${TAOSDUMP_COMMIT_SHA1}") From 8bbc64aa25f37a8e397520ef8a22d6493d907728 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 09:55:36 +0800 Subject: [PATCH 08/45] fix: rebuild printVersion module --- tools/taos-tools/src/CMakeLists.txt | 101 ++++++++++--------------- tools/taos-tools/src/benchCommandOpt.c | 28 +------ tools/taos-tools/src/taosdump.c | 25 ++---- 3 files changed, 50 insertions(+), 104 deletions(-) diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index c98c7487a1..072baee219 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -36,85 +36,57 @@ ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64") MESSAGE(STATUS "Set CPUTYPE to loongarch64") ENDIF () +# +# collect --version information +# + +MESSAGE("collect --version show info:") +# version +IF (DEFINED TD_VER_NUMBER) + ADD_DEFINITIONS(-DTD_VER_NUMBER="${TD_VER_NUMBER}") + MESSAGE("version:${TD_VER_NUMBER}") +ELSE () + # abort build + MESSAGE(FATAL_ERROR "build taos-tools not found TD_VER_NUMBER define.") +ENDIF () + +# commit id FIND_PACKAGE(Git) IF(GIT_FOUND) - #commit id + # get EXECUTE_PROCESS( COMMAND git log -1 --format=%H WORKING_DIRECTORY ${TD_COMMUNITY_DIR} - OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_SHA1 + OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_ID ) EXECUTE_PROCESS( COMMAND git log -1 --format=%H WORKING_DIRECTORY ${TD_COMMUNITY_DIR} - OUTPUT_VARIABLE TAOSDUMP_COMMIT_SHA1 - ) - MESSAGE("taosBenchmark commid_id:${TAOSBENCHMARK_COMMIT_SHA1}") - MESSAGE("taosdump commid_id:${TAOSDUMP_COMMIT_SHA1}") - - # version - IF (DEFINED TD_VER_NUMBER) - # use tdengine version - SET(TAOSBENCHMARK_TAG ${TD_VER_NUMBER}) - SET(TAOSDUMP_TAG ${TD_VER_NUMBER}) - MESSAGE(STATUS "use TD_VER_NUMBER version: " ${TD_VER_NUMBER}) - ELSE () - # use internal version - EXECUTE_PROCESS( - COMMAND sh "-c" "echo '${TAOSDUMP_FULLTAG}' | awk -F '-' '{print $2}'" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSDUMP_TAG - ) - MESSAGE(STATUS "taosdump use origin version: " ${TAOSDUMP_TAG}) - EXECUTE_PROCESS( - COMMAND sh "-c" "echo '${TAOSBENCHMARK_FULLTAG}' | awk -F '-' '{print $2}'" - RESULT_VARIABLE RESULT - OUTPUT_VARIABLE TAOSBENCHMARK_TAG - ) - MESSAGE(STATUS "taosBenchmark use origin version: " ${TAOSBENCHMARK_TAG}) - ENDIF () + OUTPUT_VARIABLE TAOSDUMP_COMMIT_ID + ) + + # show + MESSAGE("") + MESSAGE("taosdump commit id: ${TAOSDUMP_COMMIT_ID}") + MESSAGE("taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") + MESSAGE("") + # define + ADD_DEFINITIONS(-DTAOSDUMP_COMMIT_ID="${TAOSDUMP_COMMIT_ID}") + ADD_DEFINITIONS(-DTAOSBENCHMARK_COMMIT_ID="${TAOSBENCHMARK_COMMIT_ID}") ELSE() - MESSAGE("Git not found") - SET(TAOSDUMP_COMMIT_SHA1 "unknown") - SET(TAOSBENCHMARK_COMMIT_SHA1 "unknown") - SET(TAOSDUMP_TAG "0.1.0") - SET(TAOSDUMP_STATUS "unknown") - SET(TAOSBENCHMARK_STATUS "unknown") + MESSAGE(FATAL_ERROR "build taos-tools FIND_PACKAGE(Git) failed.") ENDIF (GIT_FOUND) -STRING(STRIP "${TAOSDUMP_STATUS}" TAOSDUMP_STATUS) -STRING(STRIP "${TAOSBENCHMARK_STATUS}" TAOSBENCHMARK_STATUS) +# build date +ADD_DEFINITIONS(-DBUILD_DATA="${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") +MESSAGE("build:${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") -IF (TAOSDUMP_STATUS MATCHES "M") - SET(TAOSDUMP_STATUS "modified") -ELSE() - SET(TAOSDUMP_STATUS "") -ENDIF () -IF (TAOSBENCHMARK_STATUS MATCHES "M") - SET(TAOSBENCHMARK_STATUS "modified") -ELSE() - SET(TAOSBENCHMARK_STATUS "") -ENDIF () - -MESSAGE("") -MESSAGE("taosdump last tag: ${TAOSDUMP_TAG}") -MESSAGE("taosdump commit: ${TAOSDUMP_COMMIT_SHA1}") -MESSAGE("taosdump status: ${TAOSDUMP_STATUS}") -MESSAGE("") -MESSAGE("taosBenchmark last tag: ${TAOSBENCHMARK_TAG}") -MESSAGE("taosBenchmark commit: ${TAOSBENCHMARK_COMMIT_SHA1}") -MESSAGE("taosBenchmark status: ${TAOSBENCHMARK_STATUS}") -MESSAGE("") - -ADD_DEFINITIONS(-DTAOSDUMP_TAG="${TAOSDUMP_TAG}") -ADD_DEFINITIONS(-DTAOSDUMP_COMMIT_SHA1="${TAOSDUMP_COMMIT_SHA1}") -ADD_DEFINITIONS(-DTAOSDUMP_STATUS="${TAOSDUMP_STATUS}") -ADD_DEFINITIONS(-DTAOSBENCHMARK_TAG="${TAOSBENCHMARK_TAG}") -ADD_DEFINITIONS(-DTAOSBENCHMARK_COMMIT_SHA1="${TAOSBENCHMARK_COMMIT_SHA1}") -ADD_DEFINITIONS(-DTAOSBENCHMARK_STATUS="${TAOSBENCHMARK_STATUS}") +# +# build proj +# LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/build/lib ${CMAKE_BINARY_DIR}/build/lib64) LINK_DIRECTORIES(/usr/lib /usr/lib64) INCLUDE_DIRECTORIES(/usr/local/taos/include) @@ -179,6 +151,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin ENDIF() ENDIF () + # websocket IF (${WEBSOCKET}) ADD_DEFINITIONS(-DWEBSOCKET) INCLUDE_DIRECTORIES(/usr/local/include/) @@ -204,6 +177,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin SET(GCC_COVERAGE_LINK_FLAGS "-lgcov --coverage") ENDIF () + # sanitizer IF (${BUILD_SANITIZER}) MESSAGE("${Yellow} Enable memory sanitize by BUILD_SANITIZER ${ColourReset}") IF (${OS_ID} MATCHES "Darwin") @@ -215,6 +189,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin SET(TOOLS_SANITIZE_FLAG "") ENDIF () + # TOOLS_BUILD_TYPE IF (${TOOLS_BUILD_TYPE} MATCHES "Debug") IF ((${TOOLS_SANITIZE} MATCHES "true") OR (${BUILD_SANITIZER})) MESSAGE("${Yellow} Enable memory sanitize by TOOLS_SANITIZE ${ColourReset}") diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index b868e19bae..d38ee25525 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -16,20 +16,6 @@ extern char g_configDir[MAX_PATH_LEN]; -// get taosBenchmark commit number version -#ifndef TAOSBENCHMARK_COMMIT_SHA1 -#define TAOSBENCHMARK_COMMIT_SHA1 "unknown" -#endif - -#ifndef TAOSBENCHMARK_TAG -#define TAOSBENCHMARK_TAG "0.1.0" -#endif - -#ifndef TAOSBENCHMARK_STATUS -#define TAOSBENCHMARK_STATUS "unknown" -#endif - - char *g_aggreFuncDemo[] = {"*", "count(*)", "avg(current)", @@ -42,16 +28,10 @@ char *g_aggreFunc[] = {"*", "count(*)", "avg(C0)", "sum(C0)", "max(C0)", "min(C0)", "first(C0)", "last(C0)"}; void printVersion() { - char taosBenchmark_ver[] = TAOSBENCHMARK_TAG; - char taosBenchmark_commit[] = TAOSBENCHMARK_COMMIT_SHA1; - char taosBenchmark_status[] = TAOSBENCHMARK_STATUS; - - // version - printf("taosBenchmark version: %s\ngit: %s\n", taosBenchmark_ver, taosBenchmark_commit); - printf("build: %s\n", getBuildInfo()); - if (strlen(taosBenchmark_status) > 0) { - printf("status: %s\n", taosBenchmark_status); - } + // version, macro define in src/CMakeLists.txt + printf("taosBenchmark version: %s\n", TD_VER_NUMBER); + printf("git: %s\n", TAOSBENCHMARK_COMMIT_ID); + printf("build: %s\n", BUILD_DATA); } void parseFieldDatatype(char *dataType, BArray *fields, bool isTag) { diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index 7a7b890168..6a2cffe407 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -236,8 +236,6 @@ struct arguments g_args = { 1000 // retrySleepMs }; - - static uint64_t getUniqueIDFromEpoch() { struct timeval tv; @@ -256,24 +254,17 @@ static uint64_t getUniqueIDFromEpoch() { return id; } - +// --version -V static void printVersion(FILE *file) { - char taostools_longver[] = TAOSDUMP_TAG; - char taosdump_status[] = TAOSDUMP_STATUS; - - char *dupSeq = strdup(taostools_longver); - char *running = dupSeq; - char *taostools_ver = strsep(&running, "-"); - - char taosdump_commit[] = TAOSDUMP_COMMIT_SHA1; - - fprintf(file,"taosdump version: %s\ngit: %s\n", taostools_ver, taosdump_commit); - printf("build: %s\n", getBuildInfo()); - if (strlen(taosdump_status) > 0) { - fprintf(file, "status:%s\n", taosdump_status); + if (file == NULL) { + printf("fail, printVersion file is null.\n"); + return ; } - free(dupSeq); + // version, macro define in src/CMakeLists.txt + fprintf(file, "taosBenchmark version: %s\n", TD_VER_NUMBER); + fprintf(file, "git: %s\n", TAOSDUMP_COMMIT_ID); + fprintf(file, "build: %s\n", BUILD_DATA); } static char *typeToStr(int type) { From a165043d13ef7b6b4f827d2ff5a69635eca29c4d Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 10:44:49 +0800 Subject: [PATCH 09/45] docs(node):fix node.js wsconfig case --- docs/zh/14-reference/05-connector/35-node.mdx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index cb5d69d137..d15a7a5a63 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -130,16 +130,20 @@ Node.js 连接器(`@tdengine/websocket`), 其通过 taosAdapter 提供的 We 除了通过指定的 URL 获取连接,还可以使用 WSConfig 指定建立连接时的参数。 ```js -try { - let url = 'ws://127.0.0.1:6041' - let conf = WsSql.NewConfig(url) - conf.setUser('root') - conf.setPwd('taosdata') - conf.setDb('db') - conf.setTimeOut(500) - let wsSql = await WsSql.open(conf); -} catch (e) { - console.error(e); +const taos = require("@tdengine/websocket"); + +async function createConnect() { + try { + let url = 'ws://127.0.0.1:6041' + let conf = WsSql.NewConfig(url) + conf.setUser('root') + conf.setPwd('taosdata') + conf.setDb('db') + conf.setTimeOut(500) + let wsSql = await taos.sqlConnect(conf) + } catch (e) { + console.error(e); + } } ``` From d0d97ce892023767cd75ab7b29d025250d5370dd Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 10:49:37 +0800 Subject: [PATCH 10/45] fix: rename BUILD_INFO macro define --- tools/taos-tools/src/CMakeLists.txt | 19 ++++++++----------- tools/taos-tools/src/benchCommandOpt.c | 2 +- tools/taos-tools/src/taosdump.c | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index 072baee219..c25d319cbf 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -39,12 +39,11 @@ ENDIF () # # collect --version information # - MESSAGE("collect --version show info:") # version IF (DEFINED TD_VER_NUMBER) ADD_DEFINITIONS(-DTD_VER_NUMBER="${TD_VER_NUMBER}") - MESSAGE("version:${TD_VER_NUMBER}") + MESSAGE("-- version:${TD_VER_NUMBER}") ELSE () # abort build MESSAGE(FATAL_ERROR "build taos-tools not found TD_VER_NUMBER define.") @@ -66,11 +65,8 @@ IF(GIT_FOUND) ) # show - MESSAGE("") - MESSAGE("taosdump commit id: ${TAOSDUMP_COMMIT_ID}") - MESSAGE("taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") - MESSAGE("") - + MESSAGE("-- taosdump commit id: ${TAOSDUMP_COMMIT_ID}") + MESSAGE("-- taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") # define ADD_DEFINITIONS(-DTAOSDUMP_COMMIT_ID="${TAOSDUMP_COMMIT_ID}") ADD_DEFINITIONS(-DTAOSBENCHMARK_COMMIT_ID="${TAOSBENCHMARK_COMMIT_ID}") @@ -78,10 +74,11 @@ ELSE() MESSAGE(FATAL_ERROR "build taos-tools FIND_PACKAGE(Git) failed.") ENDIF (GIT_FOUND) -# build date -ADD_DEFINITIONS(-DBUILD_DATA="${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") -MESSAGE("build:${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") - +# build info +SET(BUILD_INFO, "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") +ADD_DEFINITIONS(-DBUILD_INFO="${BUILD_INFO}") +MESSAGE("-- build:${BUILD_INFO}") +MESSAGE("") # diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index d38ee25525..1968a731f5 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -31,7 +31,7 @@ void printVersion() { // version, macro define in src/CMakeLists.txt printf("taosBenchmark version: %s\n", TD_VER_NUMBER); printf("git: %s\n", TAOSBENCHMARK_COMMIT_ID); - printf("build: %s\n", BUILD_DATA); + printf("build: %s\n", BUILD_INFO); } void parseFieldDatatype(char *dataType, BArray *fields, bool isTag) { diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index 6a2cffe407..c4c5f34b91 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -264,7 +264,7 @@ static void printVersion(FILE *file) { // version, macro define in src/CMakeLists.txt fprintf(file, "taosBenchmark version: %s\n", TD_VER_NUMBER); fprintf(file, "git: %s\n", TAOSDUMP_COMMIT_ID); - fprintf(file, "build: %s\n", BUILD_DATA); + fprintf(file, "build: %s\n", BUILD_INFO); } static char *typeToStr(int type) { From 6df1d5ad05298b8289ec911fa6db09757e34d84b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 11:26:24 +0800 Subject: [PATCH 11/45] fix: commit id string have return line --- tools/taos-tools/inc/dump.h | 12 ------------ tools/taos-tools/src/CMakeLists.txt | 12 +++++------- tools/taos-tools/src/benchCommandOpt.c | 2 +- tools/taos-tools/src/taosdump.c | 6 +++--- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/tools/taos-tools/inc/dump.h b/tools/taos-tools/inc/dump.h index 4f4beb97aa..1050676af3 100644 --- a/tools/taos-tools/inc/dump.h +++ b/tools/taos-tools/inc/dump.h @@ -65,18 +65,6 @@ #endif #endif -// get taosdump commit number version -#ifndef TAOSDUMP_COMMIT_SHA1 -#define TAOSDUMP_COMMIT_SHA1 "unknown" -#endif - -#ifndef TAOSDUMP_TAG -#define TAOSDUMP_TAG "0.1.0" -#endif - -#ifndef TAOSDUMP_STATUS -#define TAOSDUMP_STATUS "unknown" -#endif // use 256 as normal buffer length #define BUFFER_LEN 256 diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index c25d319cbf..105e714502 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -56,14 +56,12 @@ IF(GIT_FOUND) EXECUTE_PROCESS( COMMAND git log -1 --format=%H WORKING_DIRECTORY ${TD_COMMUNITY_DIR} - OUTPUT_VARIABLE TAOSBENCHMARK_COMMIT_ID + OUTPUT_VARIABLE GIT_COMMIT_ID ) - EXECUTE_PROCESS( - COMMAND git log -1 --format=%H - WORKING_DIRECTORY ${TD_COMMUNITY_DIR} - OUTPUT_VARIABLE TAOSDUMP_COMMIT_ID - ) - + + STRING(SUBSTRING "${TAOSBENCHMARK_COMMIT_ID}" 0 40 GIT_COMMIT_ID) + STRING(SUBSTRING "${TAOSDUMP_COMMIT_ID}" 0 40 GIT_COMMIT_ID) + # show MESSAGE("-- taosdump commit id: ${TAOSDUMP_COMMIT_ID}") MESSAGE("-- taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index 1968a731f5..52f403a75f 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -30,7 +30,7 @@ char *g_aggreFunc[] = {"*", "count(*)", "avg(C0)", "sum(C0)", void printVersion() { // version, macro define in src/CMakeLists.txt printf("taosBenchmark version: %s\n", TD_VER_NUMBER); - printf("git: %s\n", TAOSBENCHMARK_COMMIT_ID); + printf("git: %s\n", TAOSBENCHMAR_COMMIT_ID); printf("build: %s\n", BUILD_INFO); } diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index c4c5f34b91..c7b9010f75 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -8919,8 +8919,8 @@ static int dumpExtraInfoHead(void *taos, FILE *fp) { errno, strerror(errno)); } - char taostools_ver[] = TAOSDUMP_TAG; - char taosdump_commit[] = TAOSDUMP_COMMIT_SHA1; + char taostools_ver[] = TD_VER_NUMBER; + char taosdump_commit[] = TAOSDUMP_COMMIT_ID; snprintf(buffer, BUFFER_LEN, "#!"CUS_PROMPT"dump_ver: %s_%s\n", taostools_ver, taosdump_commit); @@ -9439,7 +9439,7 @@ static int dumpInDbs(const char *dbPath) { } #endif - int taosToolsMajorVer = atoi(TAOSDUMP_TAG); + int taosToolsMajorVer = atoi(TD_VER_NUMBER); if ((g_dumpInDataMajorVer > 1) && (1 == taosToolsMajorVer)) { errorPrint("\tThe data file was generated by version %d\n" "\tCannot be restored by current version: %d\n\n" From f3e3d7d74cad87b438106f9c0342c401c6a4587c Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 11:45:09 +0800 Subject: [PATCH 12/45] fix: SET function no dot error --- tools/taos-tools/src/CMakeLists.txt | 14 +++++++------- tools/taos-tools/src/benchCommandOpt.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/taos-tools/src/CMakeLists.txt b/tools/taos-tools/src/CMakeLists.txt index 105e714502..da05133f89 100644 --- a/tools/taos-tools/src/CMakeLists.txt +++ b/tools/taos-tools/src/CMakeLists.txt @@ -43,7 +43,7 @@ MESSAGE("collect --version show info:") # version IF (DEFINED TD_VER_NUMBER) ADD_DEFINITIONS(-DTD_VER_NUMBER="${TD_VER_NUMBER}") - MESSAGE("-- version:${TD_VER_NUMBER}") + MESSAGE(STATUS "version:${TD_VER_NUMBER}") ELSE () # abort build MESSAGE(FATAL_ERROR "build taos-tools not found TD_VER_NUMBER define.") @@ -59,12 +59,12 @@ IF(GIT_FOUND) OUTPUT_VARIABLE GIT_COMMIT_ID ) - STRING(SUBSTRING "${TAOSBENCHMARK_COMMIT_ID}" 0 40 GIT_COMMIT_ID) - STRING(SUBSTRING "${TAOSDUMP_COMMIT_ID}" 0 40 GIT_COMMIT_ID) + STRING(SUBSTRING "${GIT_COMMIT_ID}" 0 40 TAOSBENCHMARK_COMMIT_ID) + SET(TAOSDUMP_COMMIT_ID "${TAOSBENCHMARK_COMMIT_ID}") # show - MESSAGE("-- taosdump commit id: ${TAOSDUMP_COMMIT_ID}") - MESSAGE("-- taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") + MESSAGE(STATUS "taosdump commit id: ${TAOSDUMP_COMMIT_ID}") + MESSAGE(STATUS "taosBenchmark commit id: ${TAOSBENCHMARK_COMMIT_ID}") # define ADD_DEFINITIONS(-DTAOSDUMP_COMMIT_ID="${TAOSDUMP_COMMIT_ID}") ADD_DEFINITIONS(-DTAOSBENCHMARK_COMMIT_ID="${TAOSBENCHMARK_COMMIT_ID}") @@ -73,9 +73,9 @@ ELSE() ENDIF (GIT_FOUND) # build info -SET(BUILD_INFO, "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") +SET(BUILD_INFO "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}") ADD_DEFINITIONS(-DBUILD_INFO="${BUILD_INFO}") -MESSAGE("-- build:${BUILD_INFO}") +MESSAGE(STATUS "build:${BUILD_INFO}") MESSAGE("") diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index 52f403a75f..1968a731f5 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -30,7 +30,7 @@ char *g_aggreFunc[] = {"*", "count(*)", "avg(C0)", "sum(C0)", void printVersion() { // version, macro define in src/CMakeLists.txt printf("taosBenchmark version: %s\n", TD_VER_NUMBER); - printf("git: %s\n", TAOSBENCHMAR_COMMIT_ID); + printf("git: %s\n", TAOSBENCHMARK_COMMIT_ID); printf("build: %s\n", BUILD_INFO); } From db0e07dd0482320d0b113252e1b3e0091f849931 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 11:50:26 +0800 Subject: [PATCH 13/45] fix: taodump string for version --- tools/taos-tools/src/taosdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index c7b9010f75..8593752265 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -262,7 +262,7 @@ static void printVersion(FILE *file) { } // version, macro define in src/CMakeLists.txt - fprintf(file, "taosBenchmark version: %s\n", TD_VER_NUMBER); + fprintf(file, "taosdump version: %s\n", TD_VER_NUMBER); fprintf(file, "git: %s\n", TAOSDUMP_COMMIT_ID); fprintf(file, "build: %s\n", BUILD_INFO); } From bb6d0ee8b2b2047d8515825ca1a76f20d7d84f27 Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 14:58:09 +0800 Subject: [PATCH 14/45] docs: add node version explanation --- docs/en/14-reference/05-connector/35-node.md | 26 ++++++++++++------- docs/zh/14-reference/05-connector/35-node.mdx | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/en/14-reference/05-connector/35-node.md b/docs/en/14-reference/05-connector/35-node.md index 49b1d200cf..e1d06d1db6 100644 --- a/docs/en/14-reference/05-connector/35-node.md +++ b/docs/en/14-reference/05-connector/35-node.md @@ -25,6 +25,8 @@ Support all platforms that can run Node.js. | Node.js Connector Version | Major Changes | TDengine Version | | ------------------------- | ------------------------------------------------------------------------ | --------------------------- | +| 3.1.4 | Modified the readme.| - | +| 3.1.3 | Upgraded the es5-ext version to address vulnerabilities in the lower version. | - | | 3.1.2 | Optimized data protocol and parsing, significantly improved performance. | - | | 3.1.1 | Optimized data transmission performance. | 3.3.2.0 and higher versions | | 3.1.0 | New release, supports WebSocket connection. | 3.2.0.0 and higher versions | @@ -132,16 +134,20 @@ Node.js connector (`@tdengine/websocket`), which connects to a TDengine instance In addition to obtaining a connection through a specified URL, you can also use WSConfig to specify parameters when establishing a connection. ```js -try { - let url = 'ws://127.0.0.1:6041' - let conf = WsSql.NewConfig(url) - conf.setUser('root') - conf.setPwd('taosdata') - conf.setDb('db') - conf.setTimeOut(500) - let wsSql = await WsSql.open(conf); -} catch (e) { - console.error(e); +const taos = require("@tdengine/websocket"); + +async function createConnect() { + try { + let url = 'ws://127.0.0.1:6041' + let conf = WsSql.NewConfig(url) + conf.setUser('root') + conf.setPwd('taosdata') + conf.setDb('db') + conf.setTimeOut(500) + let wsSql = await taos.sqlConnect(conf) + } catch (e) { + console.error(e); + } } ``` diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index d15a7a5a63..42eff0d650 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -24,6 +24,8 @@ Node.js 连接器源码托管在 [GitHub](https://github.com/taosdata/taos-conne | Node.js 连接器 版本 | 主要变化 | TDengine 版本 | | ------------------| ----------------------| ----------------| +| 3.1.4 | 修改 readme | - | +| 3.1.3 | 升级了 es5-ext 版本,解决低版本的漏洞 | - | | 3.1.2 | 对数据协议和解析进行了优化,性能得到大幅提升| - | | 3.1.1 | 优化了数据传输性能 | 3.3.2.0 及更高版本 | | 3.1.0 | 新版本发布,支持 WebSocket 连接 | 3.2.0.0 及更高版本 | From fde835b450c9fc96c395cc6313df1d57d69e959f Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 15:01:12 +0800 Subject: [PATCH 15/45] fix: add check case --- tests/army/tools/benchmark/basic/commandline.py | 17 ++++++++++++++++- .../army/tools/taosdump/ws/taosdumpEscapedDb.py | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/army/tools/benchmark/basic/commandline.py b/tests/army/tools/benchmark/basic/commandline.py index e1ed3b90a4..6af0644c20 100644 --- a/tests/army/tools/benchmark/basic/commandline.py +++ b/tests/army/tools/benchmark/basic/commandline.py @@ -21,16 +21,31 @@ from frame.sql import * from frame.caseBase import * from frame import * - class TDTestCase(TBase): def caseDescription(self): """ [TD-11510] taosBenchmark test cases """ + def checkVersion(self): + # run + outputs = etool.runBinFile("taosBenchmark", "-V") + print(outputs) + if len(outputs) != 3: + tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") + # version string len + assert len(outputs[0]) > 34 + assert len(outputs[1]) > 43 + assert len(outputs[2]) > 36 + + tdLog.info("check taosBenchmark version successfully.") def run(self): + # check version + self.checkVersion() + + # command line binPath = etool.benchMarkFile() cmd = ( "%s -F 7 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%%^*" diff --git a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py index f338c62688..7709b0e4cc 100644 --- a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py +++ b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py @@ -27,10 +27,24 @@ class TDTestCase(TBase): case1: [TS-3072] taosdump dump escaped db name test """ + def checkVersion(self): + # run + outputs = etool.runBinFile("taosdump", "-V") + print(outputs) + if len(outputs) != 3: + tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") + # version string len + assert len(outputs[0]) > 34 + assert len(outputs[1]) > 43 + assert len(outputs[2]) > 36 + tdLog.info("check taosdump version successfully.") def run(self): + # check version + self.checkVersion() + tdSql.prepare() tdSql.execute("drop database if exists db") From 45286613d31831c6b1360900fc96e7c1025bac9d Mon Sep 17 00:00:00 2001 From: qevolg <2227465945@qq.com> Date: Tue, 11 Feb 2025 15:04:35 +0800 Subject: [PATCH 16/45] fix(keeper): fix sql for log.logs stable --- tools/keeper/process/handle.go | 4 +++- tools/keeper/process/handle_test.go | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/keeper/process/handle.go b/tools/keeper/process/handle.go index 980902daca..ea02dd91f3 100644 --- a/tools/keeper/process/handle.go +++ b/tools/keeper/process/handle.go @@ -411,9 +411,11 @@ func (p *Processor) Prepare() { func (p *Processor) withDBName(tableName string) string { b := pool.BytesPoolGet() + b.WriteByte('`') b.WriteString(p.db) - b.WriteByte('.') + b.WriteString("`.`") b.WriteString(tableName) + b.WriteByte('`') return b.String() } diff --git a/tools/keeper/process/handle_test.go b/tools/keeper/process/handle_test.go index bfd5c369b4..55f469eabb 100644 --- a/tools/keeper/process/handle_test.go +++ b/tools/keeper/process/handle_test.go @@ -119,3 +119,9 @@ func Test_getStatusStr(t *testing.T) { assert.Equal(t, tt.expected, res) } } + +func Test_withDBName(t *testing.T) { + processor := &Processor{db: "db"} + res := processor.withDBName("test") + assert.Equal(t, res, "`db`.`test`") +} From 3c30a941fc46b68630da4cdd47e4a7de1fa6f2b4 Mon Sep 17 00:00:00 2001 From: qevolg <2227465945@qq.com> Date: Tue, 11 Feb 2025 15:13:07 +0800 Subject: [PATCH 17/45] chore: update taoskeeper ci --- .../workflows/{taoskeeper-ci.yml => taoskeeper-ci-build.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{taoskeeper-ci.yml => taoskeeper-ci-build.yml} (95%) diff --git a/.github/workflows/taoskeeper-ci.yml b/.github/workflows/taoskeeper-ci-build.yml similarity index 95% rename from .github/workflows/taoskeeper-ci.yml rename to .github/workflows/taoskeeper-ci-build.yml index 7f84eaa401..71bb1c9a51 100644 --- a/.github/workflows/taoskeeper-ci.yml +++ b/.github/workflows/taoskeeper-ci-build.yml @@ -1,4 +1,4 @@ -name: taosKeeper CI +name: taosKeeper Build on: push: @@ -8,7 +8,7 @@ on: jobs: build: runs-on: ubuntu-latest - name: Run unit tests + name: Build and test on ubuntu-latest steps: - name: Checkout the repository From fdcd81d802cac8ddfa0c5f5edf3d8831d0f649cb Mon Sep 17 00:00:00 2001 From: qevolg <2227465945@qq.com> Date: Tue, 11 Feb 2025 15:15:49 +0800 Subject: [PATCH 18/45] style(keeper): format code --- tools/keeper/util/empty_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/keeper/util/empty_test.go b/tools/keeper/util/empty_test.go index 5d82866721..b38609ec73 100644 --- a/tools/keeper/util/empty_test.go +++ b/tools/keeper/util/empty_test.go @@ -1,8 +1,6 @@ package util -import ( - "testing" -) +import "testing" func TestEmpty(t *testing.T) { } From f20c564d2b58cd433e6692c6f7a47c75a7c59e3e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 15:47:13 +0800 Subject: [PATCH 19/45] fix: sync taos-tools doc from 3.0 branch --- .../14-reference/02-tools/10-taosbenchmark.md | 26 +++++------ .../14-reference/02-tools/10-taosbenchmark.md | 45 ++++++++++--------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/docs/en/14-reference/02-tools/10-taosbenchmark.md b/docs/en/14-reference/02-tools/10-taosbenchmark.md index 6eb1da6a11..8447951f7e 100644 --- a/docs/en/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/en/14-reference/02-tools/10-taosbenchmark.md @@ -242,13 +242,14 @@ The query performance test mainly outputs the QPS indicator of query request spe ``` bash complete query with 3 threads and 10000 query delay avg: 0.002686s min: 0.001182s max: 0.012189s p90: 0.002977s p95: 0.003493s p99: 0.004645s SQL command: select ... -INFO: Total specified queries: 30000 INFO: Spend 26.9530 second completed total queries: 30000, the QPS of all threads: 1113.049 ``` - The first line represents the percentile distribution of query execution and query request delay for each of the three threads executing 10000 queries. The SQL command is the test query statement -- The second line indicates that a total of 10000 * 3 = 30000 queries have been completed -- The third line indicates that the total query time is 26.9653 seconds, and the query rate per second (QPS) is 1113.049 times/second +- The second line indicates that the total query time is 26.9653 seconds, and the query rate per second (QPS) is 1113.049 times/second +- If the `continue_if_fail` option is set to `yes` in the query, the last line will output the number of failed requests and error rate, the format like "error + number of failed requests (error rate)" +- QPS = number of successful requests / time spent (in seconds) +- Error rate = number of failed requests / (number of successful requests + number of failed requests) #### Subscription metrics @@ -330,9 +331,9 @@ Parameters related to supertable creation are configured in the `super_tables` s - **child_table_exists**: Whether the child table already exists, default is "no", options are "yes" or "no". -- **child_table_count**: Number of child tables, default is 10. +- **childtable_count**: Number of child tables, default is 10. -- **child_table_prefix**: Prefix for child table names, mandatory, no default value. +- **childtable_prefix**: Prefix for child table names, mandatory, no default value. - **escape_character**: Whether the supertable and child table names contain escape characters, default is "no", options are "yes" or "no". @@ -427,11 +428,9 @@ Specify the configuration parameters for tag and data columns in `super_tables` - **create_table_thread_count** : The number of threads for creating tables, default is 8. -- **connection_pool_size** : The number of pre-established connections with the TDengine server. If not configured, it defaults to the specified number of threads. - - **result_file** : The path to the result output file, default is ./output.txt. -- **confirm_parameter_prompt** : A toggle parameter that requires user confirmation after a prompt to continue. The default value is false. +- **confirm_parameter_prompt** : A toggle parameter that requires user confirmation after a prompt to continue. The value can be "yes" or "no", by default "no". - **interlace_rows** : Enables interleaved insertion mode and specifies the number of rows to insert into each subtable at a time. Interleaved insertion mode refers to inserting the specified number of rows into each subtable in sequence and repeating this process until all subtable data has been inserted. The default value is 0, meaning data is inserted into one subtable completely before moving to the next. This parameter can also be configured in `super_tables`; if configured, the settings in `super_tables` take higher priority and override the global settings. @@ -460,12 +459,12 @@ For other common parameters, see Common Configuration Parameters. Configuration parameters for querying specified tables (can specify supertables, subtables, or regular tables) are set in `specified_table_query`. -- **mixed_query** "yes": `Mixed Query` "no": `Normal Query`, default is "no" -`Mixed Query`: All SQL statements in `sqls` are grouped by the number of threads, with each thread executing one group. Each SQL statement in a thread needs to perform `query_times` queries. -`Normal Query `: Each SQL in `sqls` starts `threads` and exits after executing `query_times` times. The next SQL can only be executed after all previous SQL threads have finished executing and exited. -Regardless of whether it is a `Normal Query` or `Mixed Query`, the total number of query executions is the same. The total number of queries = `sqls` * `threads` * `query_times`. The difference is that `Normal Query` starts `threads` for each SQL query, while ` Mixed Query` only starts `threads` once to complete all SQL queries. The number of thread startups for the two is different. +`General Query`: Each SQL in `sqls` starts `threads` threads to query this SQL, Each thread exits after executing the `query_times` queries, and only after all threads executing this SQL have completed can the next SQL be executed. +The total number of queries(`General Query`) = the number of `sqls` * `query_times` * `threads` +- `Mixed Query` : All SQL statements in `sqls` are divided into `threads` groups, with each thread executing one group. Each SQL statement needs to execute `query_times` queries. +The total number of queries(`Mixed Query`) = the number of `sqls` * `query_times` -- **query_interval** : Query interval, in seconds, default is 0. +- **query_interval** : Query interval, in millisecond, default is 0. - **threads** : Number of threads executing the SQL query, default is 1. @@ -487,6 +486,7 @@ The thread mode of the super table query is the same as the `Normal Query` mode - **sqls** : - **sql** : The SQL command to execute, required; for supertable queries, keep "xxxx" in the SQL command, the program will automatically replace it with all subtable names of the supertable. - **result** : File to save the query results, if not specified, results are not saved. + - **Note**: The maximum number of SQL arrays configured under SQL is 100. ### Configuration Parameters for Subscription Scenarios diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index f1164650eb..b74b40e337 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -159,12 +159,13 @@ SUCC: insert delay, min: 19.6780ms, avg: 64.9390ms, p90: 94.6900ms, p95: 105.187 查询性能测试主要输出查询请求速度 QPS 指标, 输出格式如下: ``` bash complete query with 3 threads and 10000 query delay avg: 0.002686s min: 0.001182s max: 0.012189s p90: 0.002977s p95: 0.003493s p99: 0.004645s SQL command: select ... -INFO: Total specified queries: 30000 INFO: Spend 26.9530 second completed total queries: 30000, the QPS of all threads: 1113.049 ``` - 第一行表示 3 个线程每个线程执行 10000 次查询及查询请求延时百分位分布情况,`SQL command` 为测试的查询语句 -- 第二行表示总共完成了 10000 * 3 = 30000 次查询总数 -- 第三行表示查询总耗时为 26.9653 秒,每秒查询率(QPS)为:1113.049 次/秒 +- 第二行表示查询总耗时为 26.9653 秒,每秒查询率(QPS)为:1113.049 次/秒 +- 如果在查询中设置了 `continue_if_fail` 选项为 `yes`,在最后一行中会输出失败请求个数及错误率,格式 error + 失败请求个数 (错误率) +- QPS = 成功请求数量 / 花费时间(单位秒) +- 错误率 = 失败请求数量 /(成功请求数量 + 失败请求数量) #### 订阅指标 @@ -203,12 +204,12 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 插入场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) -- ** keep_trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 +- **keep_trying** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 -- ** trying_interval ** : 失败重试间隔时间,单位为毫秒,仅在 keep_trying 指定重试后有效。需使用 v3.0.9 以上版本。 -- ** childtable_from 和 childtable_to ** : 指定写入子表范围,开闭区间为 [childtable_from, childtable_to). +- **trying_interval** : 失败重试间隔时间,单位为毫秒,仅在 keep_trying 指定重试后有效。需使用 v3.0.9 以上版本。 +- **childtable_from 和 childtable_to** : 指定写入子表范围,开闭区间为 [childtable_from, childtable_to).   -- ** continue_if_fail ** : 允许用户定义失败后行为 +- **continue_if_fail** : 允许用户定义失败后行为 “continue_if_fail”:  “no”, 失败 taosBenchmark 自动退出,默认行为 “continue_if_fail”: “yes”, 失败 taosBenchmark 警告用户,并继续写入 @@ -220,7 +221,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **name** : 数据库名。 -- **drop** : 数据库已存在时是否删除重建,可选项为 "yes" 或 "no", 默认为 “yes” +- **drop** : 数据库已存在时是否删除,可选项为 "yes" 或 "no", 默认为 “yes” #### 流式计算相关配置参数 @@ -246,9 +247,9 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **child_table_exists** : 子表是否已经存在,默认值为 "no",可选值为 "yes" 或 "no"。 -- **child_table_count** : 子表的数量,默认值为 10。 +- **childtable_count** : 子表的数量,默认值为 10。 -- **child_table_prefix** : 子表名称的前缀,必选配置项,没有默认值。 +- **childtable_prefix** : 子表名称的前缀,必选配置项,没有默认值。 - **escape_character** : 超级表和子表名称中是否包含转义字符,默认值为 "no",可选值为 "yes" 或 "no"。 @@ -339,15 +340,13 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **thread_count** : 插入数据的线程数量,默认为 8。 -- **thread_bind_vgroup** : 写入时 vgroup 是否和写入线程绑定,绑定后可提升写入速度, 取值为 "yes" 或 "no",默认值为 “no”, 设置为 “no” 后与原来行为一致。 当设为 “yes” 时,如果 thread_count 数量大小写入数据库的 vgroups 数量, thread_count 自动调整为 vgroups 数量;如果 thread_count 数量小于 vgroups 数量,写入线程数量不做调整,一个线程写完一个 vgroup 数据后再写下一个,同时保持一个 vgroup 同时只能由一个线程写入的规则。 +**thread_bind_vgroup** : 写入时 vgroup 是否和写入线程绑定,绑定后可提升写入速度, 取值为 "yes" 或 "no",默认值为 “no”, 设置为 “no” 后与原来行为一致。 当设为 “yes” 时,如果 thread_count 大于写入数据库 vgroups 数量, thread_count 自动调整为 vgroups 数量;如果 thread_count 小于 vgroups 数量,写入线程数量不做调整,一个线程写完一个 vgroup 数据后再写下一个,同时保持一个 vgroup 同时只能由一个线程写入的规则。 - **create_table_thread_count** : 建表的线程数量,默认为 8。 -- **connection_pool_size** : 预先建立的与 TDengine 服务端之间的连接的数量。若不配置,则与所指定的线程数相同。 - - **result_file** : 结果输出文件的路径,默认值为 ./output.txt。 -- **confirm_parameter_prompt** : 开关参数,要求用户在提示后确认才能继续。默认值为 false 。 +- **confirm_parameter_prompt** : 开关参数,要求用户在提示后确认才能继续, 可取值 "yes" or "no"。默认值为 "no" 。 - **interlace_rows** : 启用交错插入模式并同时指定向每个子表每次插入的数据行数。交错插入模式是指依次向每张子表插入由本参数所指定的行数并重复这个过程,直到所有子表的数据都插入完成。默认值为 0, 即向一张子表完成数据插入后才会向下一张子表进行数据插入。 在 `super_tables` 中也可以配置该参数,若配置则以 `super_tables` 中的配置为高优先级,覆盖全局设置。 @@ -377,12 +376,16 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 查询指定表(可以指定超级表、子表或普通表)的配置参数在 `specified_table_query` 中设置。 -- **mixed_query** : 查询模式,取值 “yes” 为`混合查询`, "no" 为`正常查询` , 默认值为 “no” - `混合查询`:`sqls` 中所有 sql 按 `threads` 线程数分组,每个线程执行一组, 线程中每个 sql 都需执行 `query_times` 次查询 - `正常查询`:`sqls` 中每个 sql 启动 `threads` 个线程,每个线程执行完 `query_times` 次后退出,下个 sql 需等待上个 sql 线程全部执行完退出后方可执行 - 不管 `正常查询` 还是 `混合查询` ,执行查询总次数是相同的 ,查询总次数 = `sqls` 个数 * `threads` * `query_times`, 区别是 `正常查询` 每个 sql 都会启动 `threads` 个线程,而 `混合查询` 只启动一次 `threads` 个线程执行完所有 SQL, 两者启动线程次数不一样。 +- **mixed_query** : 查询模式 + “yes” :`混合查询` + "no"(默认值) :`普通查询` + `普通查询`:`sqls` 中每个 sql 启动 `threads` 个线程查询此 sql, 执行完 `query_times` 次查询后退出,执行此 sql 的所有线程都完成后进入下一个 sql + `查询总次数` = `sqls` 个数 * `query_times` * `threads` + + `混合查询`:`sqls` 中所有 sql 分成 `threads` 个组,每个线程执行一组, 每个 sql 都需执行 `query_times` 次查询 + `查询总次数` = `sqls` 个数 * `query_times` -- **query_interval** : 查询时间间隔,单位是秒,默认值为 0。 +- **query_interval** : 查询时间间隔,单位: millisecond,默认值为 0。 - **threads** : 执行查询 SQL 的线程数,默认值为 1。 @@ -402,9 +405,9 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 - **threads** : 执行查询 SQL 的线程数,默认值为 1。 - **sqls** : - - **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中保留 "xxxx",程序会自动将其替换为超级表的所有子表名。 - 替换为超级表中所有的子表名。 + - **sql** : 执行的 SQL 命令,必填;对于超级表的查询 SQL,在 SQL 命令中必须保留 "xxxx",会替换为超级下所有子表名后再执行。 - **result** : 保存查询结果的文件,未指定则不保存。 + - **限制项** : sqls 下配置 sql 数组最大为 100 个 ### 订阅场景配置参数 From 6620350ebce7a88e5a8e99f1cd6507db244235de Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 15:49:16 +0800 Subject: [PATCH 20/45] docs: add flink version explanation --- docs/en/10-third-party/01-collection/flink.md | 3 ++- docs/zh/10-third-party/01-collection/12-flink.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/en/10-third-party/01-collection/flink.md b/docs/en/10-third-party/01-collection/flink.md index 19a767f1f6..b225a2d610 100644 --- a/docs/en/10-third-party/01-collection/flink.md +++ b/docs/en/10-third-party/01-collection/flink.md @@ -26,6 +26,7 @@ Flink Connector supports all platforms that can run Flink 1.19 and above version | Flink Connector Version | Major Changes | TDengine Version| |-------------------------| ------------------------------------ | ---------------- | +| 2.0.2 | The Table Sink supports types such as RowKind.UPDATE_BEFORE, RowKind.UPDATE_AFTER, and RowKind.DELETE.| - | | 2.0.1 | Sink supports writing types from Rowdata implementations.| - | | 2.0.0 | 1.Support SQL queries on data in TDengine database.
2. Support CDC subscription to data in TDengine database.
3. Supports reading and writing to TDengine database using Table SQL. | 3.3.5.1 and higher| | 1.0.0 | Support Sink function to write data from other sources to TDengine in the future.| 3.3.2.0 and higher| @@ -115,7 +116,7 @@ If using Maven to manage a project, simply add the following dependencies in pom com.taosdata.flink flink-connector-tdengine - 2.0.1 + 2.0.2 ``` diff --git a/docs/zh/10-third-party/01-collection/12-flink.md b/docs/zh/10-third-party/01-collection/12-flink.md index 0f8bde5260..d74f6cad6d 100644 --- a/docs/zh/10-third-party/01-collection/12-flink.md +++ b/docs/zh/10-third-party/01-collection/12-flink.md @@ -24,6 +24,7 @@ Flink Connector 支持所有能运行 Flink 1.19 及以上版本的平台。 ## 版本历史 | Flink Connector 版本 | 主要变化 | TDengine 版本 | | ------------------| ------------------------------------ | ---------------- | +| 2.0.2 | Table Sink 支持 RowKind.UPDATE_BEFORE、RowKind.UPDATE_AFTER 和 RowKind.DELETE 类型| - | | 2.0.1 | Sink 支持对所有继承自 RowData 并已实现的类型进行数据写入| - | | 2.0.0 | 1. 支持 SQL 查询 TDengine 数据库中的数据
2. 支持 CDC 订阅 TDengine 数据库中的数据
3. 支持 Table SQL 方式读取和写入 TDengine 数据库| 3.3.5.1 及以上版本 | | 1.0.0 | 支持 Sink 功能,将来着其他数据源的数据写入到 TDengine| 3.3.2.0 及以上版本| @@ -112,7 +113,7 @@ env.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.AT_LEAST_ONCE); com.taosdata.flink flink-connector-tdengine - 2.0.1 + 2.0.2 ``` From 910840d508fc573e45486e833a1d48645bc2540f Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 16:17:00 +0800 Subject: [PATCH 21/45] fix: taos-cli taosdump taosbenchmark Unified explanation of tool acquisition methods --- docs/en/14-reference/02-tools/10-taosbenchmark.md | 2 +- docs/zh/14-reference/02-tools/08-taos-cli.md | 6 +++++- docs/zh/14-reference/02-tools/09-taosdump.md | 5 ++--- docs/zh/14-reference/02-tools/10-taosbenchmark.md | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/en/14-reference/02-tools/10-taosbenchmark.md b/docs/en/14-reference/02-tools/10-taosbenchmark.md index 8447951f7e..f146d7134c 100644 --- a/docs/en/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/en/14-reference/02-tools/10-taosbenchmark.md @@ -501,7 +501,7 @@ Configuration parameters for subscribing to specified tables (can specify supert - **sqls** : - **sql** : The SQL command to execute, required. -#### Data Type Writing Comparison Table in Configuration File +### Data Type Writing Comparison Table in Configuration File | # | **Engine** | **taosBenchmark** | --- | :----------------: | :---------------: diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index 5b204da4c2..e46b202361 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -4,7 +4,11 @@ sidebar_label: taos toc_max_heading_level: 4 --- -TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine 实例并与之交互的最简洁最常用工具。 使用前需要安装 TDengine Server 安装包或 TDengine Client 安装包。 +TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine 实例并与之交互最简洁常用工具。 + +## 工具获取 + +TDengine CLI 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) ## 启动 diff --git a/docs/zh/14-reference/02-tools/09-taosdump.md b/docs/zh/14-reference/02-tools/09-taosdump.md index 4286cda73a..e448e85188 100644 --- a/docs/zh/14-reference/02-tools/09-taosdump.md +++ b/docs/zh/14-reference/02-tools/09-taosdump.md @@ -6,10 +6,9 @@ toc_max_heading_level: 4 taosdump 是为开源用户提供的 TDengine 数据备份/恢复工具,备份数据文件采用标准 [ Apache AVRO ](https://avro.apache.org/) 格式,方便与外界生态交换数据。taosdump 提供多种数据备份及恢复选项来满足不同需求,可通过 --help 查看支持的全部选项。 +## 工具获取 -## 安装 - -taosdump 是 TDengine 安装包中默认安装组件,安装 TDengine 后即可使用,可参考 [TDengine 安装](../../../get-started/) +taosdump 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) ## 常用使用场景 diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index b74b40e337..88969b7d80 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -6,9 +6,9 @@ toc_max_heading_level: 4 taosBenchmark 是 TDengine 产品性能基准测试工具,提供对 TDengine 产品写入、查询及订阅性能测试,输出性能指标。 -## 安装 +## 工具获取 -taosBenchmark 是 TDengine 安装包中默认安装组件,安装 TDengine 后即可使用,参考 [TDengine 安装](../../../get-started/) +taosBenchmark 是 TDengine 服务器及客户端安装包安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) ## 运行 @@ -423,7 +423,7 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 - **sql** : 执行的 SQL 命令,必填。 -#### 配置文件中数据类型书写对照表 +### 配置文件中数据类型书写对照表 | # | **引擎** | **taosBenchmark** | --- | :----------------: | :---------------: From 806fa9cb7195b4e22c79bbd87b117d4c6c106bdb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 16:19:33 +0800 Subject: [PATCH 22/45] fix: taodump version is short --- tests/army/tools/taosdump/ws/taosdumpEscapedDb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py index 7709b0e4cc..0c9a236e59 100644 --- a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py +++ b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py @@ -34,7 +34,7 @@ class TDTestCase(TBase): if len(outputs) != 3: tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") # version string len - assert len(outputs[0]) > 34 + assert len(outputs[0]) > 22 assert len(outputs[1]) > 43 assert len(outputs[2]) > 36 From 7bb8d1793a12c5ca2b02bc5b3d447e9230d8d860 Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 16:30:56 +0800 Subject: [PATCH 23/45] docs: modify node config create error --- docs/en/14-reference/05-connector/35-node.md | 2 +- docs/zh/14-reference/05-connector/35-node.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/05-connector/35-node.md b/docs/en/14-reference/05-connector/35-node.md index e1d06d1db6..2644fab767 100644 --- a/docs/en/14-reference/05-connector/35-node.md +++ b/docs/en/14-reference/05-connector/35-node.md @@ -139,7 +139,7 @@ const taos = require("@tdengine/websocket"); async function createConnect() { try { let url = 'ws://127.0.0.1:6041' - let conf = WsSql.NewConfig(url) + let conf = new taos.WSConfig(dsn) conf.setUser('root') conf.setPwd('taosdata') conf.setDb('db') diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index 42eff0d650..b46049a809 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -137,7 +137,7 @@ const taos = require("@tdengine/websocket"); async function createConnect() { try { let url = 'ws://127.0.0.1:6041' - let conf = WsSql.NewConfig(url) + let conf = new taos.WSConfig(dsn) conf.setUser('root') conf.setPwd('taosdata') conf.setDb('db') From 8d1f7110db58aee203dab9127b8747a6d0587e7f Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 16:37:11 +0800 Subject: [PATCH 24/45] docs: modify node config url error --- docs/en/14-reference/05-connector/35-node.md | 2 +- docs/zh/14-reference/05-connector/35-node.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/05-connector/35-node.md b/docs/en/14-reference/05-connector/35-node.md index 2644fab767..858426cc3f 100644 --- a/docs/en/14-reference/05-connector/35-node.md +++ b/docs/en/14-reference/05-connector/35-node.md @@ -139,7 +139,7 @@ const taos = require("@tdengine/websocket"); async function createConnect() { try { let url = 'ws://127.0.0.1:6041' - let conf = new taos.WSConfig(dsn) + let conf = new taos.WSConfig(url) conf.setUser('root') conf.setPwd('taosdata') conf.setDb('db') diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index b46049a809..abdf1c7571 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -137,7 +137,7 @@ const taos = require("@tdengine/websocket"); async function createConnect() { try { let url = 'ws://127.0.0.1:6041' - let conf = new taos.WSConfig(dsn) + let conf = new taos.WSConfig(url) conf.setUser('root') conf.setPwd('taosdata') conf.setDb('db') From 0e502e05e760194d1eb75ac6aaf7382b2acc0c0e Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 11 Feb 2025 20:03:11 +0800 Subject: [PATCH 25/45] test: add test case for log compress --- tests/system-test/0-others/taosdlog.py | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tests/system-test/0-others/taosdlog.py b/tests/system-test/0-others/taosdlog.py index 06ac4ce5e4..7e8dc49552 100644 --- a/tests/system-test/0-others/taosdlog.py +++ b/tests/system-test/0-others/taosdlog.py @@ -47,6 +47,78 @@ class TDTestCase: break return buildPath + def checkLogBak(self, logPath, expectLogBak): + if platform.system().lower() == 'windows': + return True + result = False + try: + for file in os.listdir(logPath): + file_path = os.path.join(logPath, file) + if os.path.isdir(file_path): + continue + if file.endswith('.gz'): + if expectLogBak: + result = True + else: + raise Exception(f"Error: Found .gz file: {file_path}") + if '.' in file: + prefix, num_part = file.split('.', 1) + logNum=0 + if num_part.isdigit(): + logNum = int(num_part) + if logNum > 100: + if not expectLogBak: + raise Exception(f"Error: Found log file number >= 100: {file_path}") + except Exception as e: + raise Exception(f"Error: error occurred. Reason: {e}") + return result + + def checkTargetStrInFiles(self, filePaths, targetStr): + result = False + for filePath in filePaths: + if not os.path.exists(filePath): + continue + try: + with open(filePath, 'r', encoding='utf-8') as file: + for line in file: + if targetStr in line: + result = True + break + except Exception as e: + continue + return result + + def logRotateOccurred(self, logFiles, targetStr, maxRetry=15): + result = False + for i in range(maxRetry): + if self.checkTargetStrInFiles(logFiles, targetStr): + result = True + break + tdLog.info(f"wait {i+1} second(s) for log rotate") + time.sleep(1) + return result + + def checkLogCompress(self): + tdLog.info("Running check log compress") + dnodePath = self.buildPath + "/../sim/dnode1" + logPath = f"{dnodePath}/log" + taosdLogFiles = [f"{logPath}/taosdlog.0", f"{logPath}/taosdlog.1"] + logRotateStr="process log rotation" + logRotateResult = self.logRotateOccurred(taosdLogFiles, logRotateStr) + tdSql.checkEqual(True, logRotateResult) + tdSql.checkEqual(False, self.checkLogBak(logPath, False)) + tdSql.execute("alter all dnodes 'logKeepDays 3'") + tdSql.execute("alter all dnodes 'numOfLogLines 1000'") + tdSql.execute("alter all dnodes 'debugFlag 143'") + logCompress=False + for i in range(30): + logCompress=self.checkLogBak(logPath, True) + if logCompress: + break + tdLog.info(f"wait {i+1} second(s) for log compress") + time.sleep(1) + tdSql.checkEqual(True, logCompress) + def prepareCfg(self, cfgPath, cfgDict): tdLog.info("make dir %s" % cfgPath) os.makedirs(cfgPath, exist_ok=True) @@ -338,6 +410,7 @@ class TDTestCase: tdSql.checkEqual(True, os.path.exists(f"{dnodePath}/log/taoslog0.0")) def run(self): + self.checkLogCompress() self.checkLogOutput() self.checkLogRotate() self.closeTaosd() From b36c5965861bd8d44eb418f49769c14ca2f50d08 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 21:58:16 +0800 Subject: [PATCH 26/45] fix: doc taosdump --- docs/zh/14-reference/02-tools/08-taos-cli.md | 2 +- docs/zh/14-reference/02-tools/09-taosdump.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index e46b202361..914f302e3e 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -10,7 +10,7 @@ TDengine 命令行程序(以下简称 TDengine CLI)是用户操作 TDengine TDengine CLI 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) -## 启动 +## 运行 要进入 TDengine CLI,您在终端执行 `taos` 即可。 diff --git a/docs/zh/14-reference/02-tools/09-taosdump.md b/docs/zh/14-reference/02-tools/09-taosdump.md index e448e85188..82d39960ea 100644 --- a/docs/zh/14-reference/02-tools/09-taosdump.md +++ b/docs/zh/14-reference/02-tools/09-taosdump.md @@ -10,6 +10,7 @@ taosdump 是为开源用户提供的 TDengine 数据备份/恢复工具,备份 taosdump 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) +## 运行 ## 常用使用场景 From 646336a213e53a4f51f9fc8ce8b081291354890e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 11 Feb 2025 21:59:53 +0800 Subject: [PATCH 27/45] fix: doc taosdump --- tests/army/tools/benchmark/basic/commandline.py | 2 ++ tests/army/tools/taosdump/ws/taosdumpEscapedDb.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/army/tools/benchmark/basic/commandline.py b/tests/army/tools/benchmark/basic/commandline.py index 6af0644c20..12b3e5a920 100644 --- a/tests/army/tools/benchmark/basic/commandline.py +++ b/tests/army/tools/benchmark/basic/commandline.py @@ -35,7 +35,9 @@ class TDTestCase(TBase): tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") # version string len assert len(outputs[0]) > 34 + # commid id assert len(outputs[1]) > 43 + # build info assert len(outputs[2]) > 36 tdLog.info("check taosBenchmark version successfully.") diff --git a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py index 0c9a236e59..47feb43120 100644 --- a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py +++ b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py @@ -35,7 +35,9 @@ class TDTestCase(TBase): tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") # version string len assert len(outputs[0]) > 22 + # commit id assert len(outputs[1]) > 43 + # build info assert len(outputs[2]) > 36 tdLog.info("check taosdump version successfully.") From ed518e8de7d4668337fac6ba5719bf485d4452f0 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 09:45:24 +0800 Subject: [PATCH 28/45] doc: main frame is get run parameter other --- docs/zh/14-reference/02-tools/08-taos-cli.md | 63 ++++++++++--------- docs/zh/14-reference/02-tools/09-taosdump.md | 2 +- .../14-reference/02-tools/10-taosbenchmark.md | 2 +- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index 914f302e3e..d76c7e5374 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -12,13 +12,13 @@ TDengine CLI 是 TDengine 服务器及客户端安装包中默认安装组件, ## 运行 -要进入 TDengine CLI,您在终端执行 `taos` 即可。 +进入 TDengine CLI 交互执行模式,在终端命令行执行: ```bash taos ``` -如果连接服务成功,将会打印出欢迎消息和版本信息。如果失败,则会打印错误消息。 +如果连接服务成功,将会打印出欢迎消息和版本信息。若失败,打印错误消息。 TDengine CLI 的提示符号如下: @@ -32,36 +32,17 @@ taos> taos> quit ``` - -## 执行 SQL 脚本 - -在 TDengine CLI 里可以通过 `source` 命令来运行脚本文件中的多条 SQL 命令。 - -```sql -taos> source ; -``` - -## 在线修改显示字符宽度 - -可以在 TDengine CLI 里使用如下命令调整字符显示宽度 - -```sql -taos> SET MAX_BINARY_DISPLAY_WIDTH ; -``` - -如显示的内容后面以 ... 结尾时,表示该内容已被截断,可通过本命令修改显示字符宽度以显示完整的内容。 - ## 命令行参数 您可通过配置命令行参数来改变 TDengine CLI 的行为。以下为常用的几个命令行参数: -- -h HOST: 要连接的 TDengine 服务端所在服务器的 FQDN, 默认为连接本地服务 -- -P PORT: 指定服务端所用端口号 -- -u USER: 连接时使用的用户名 -- -p PASSWORD: 连接服务端时使用的密码,特殊字符如 `! & ( ) < > ; |` 需使用字符 `\` 进行转义处理 +- -h HOST: 要连接的 TDengine 服务端所在服务器的 FQDN, 默认值: 127.0.0.1 +- -P PORT: 指定服务端所用端口号,默认值:6030 +- -u USER: 连接时使用的用户名,默认值:root +- -p PASSWORD: 连接服务端时使用的密码,特殊字符如 `! & ( ) < > ; |` 需使用字符 `\` 进行转义处理, 默认值:taosdata - -?, --help: 打印出所有命令行参数 -还有更多其他参数: +更多参数: - -a AUTHSTR: 连接服务端的授权信息 - -A: 通过用户名和密码计算授权信息 @@ -83,15 +64,39 @@ taos> SET MAX_BINARY_DISPLAY_WIDTH ; - -z TIMEZONE: 指定时区,默认为本地时区 - -V: 打印出当前版本号 -示例: +### 非交互式执行 +使用 `-s` 参数可进行非交互式执行 SQL,执行完成后退出,此模式适合在自动化脚本中使用。 +如以下命令连接到服务器 h1.taos.com, 执行 -s 指定的 SQL: ```bash taos -h h1.taos.com -s "use db; show tables;" ``` -## 配置文件 +### taosc 配置文件 -也可以通过配置文件中的参数设置来控制 TDengine CLI 的行为。可用配置参数请参考[客户端配置](../../components/taosc) +可通过 `-c` 参数改变 `taosc` 客户端加载配置文件的位置,客户端配置参数参考 [客户端配置](../../components/taosc) +如以下命令指定了 `taosc` 客户端加载 `/root/cfg/` 下的 `taos.cfg` 配置文件 +```bash +taos -c /root/cfg/ +``` + +## 执行 SQL 脚本 + +在 TDengine CLI 里可以通过 `source` 命令来运行脚本文件中的多条 SQL 命令。 + +```sql +taos> source ; +``` + +## 在线修改显示字符宽度 + +可以在 TDengine CLI 里使用如下命令调整字符显示宽度 + +```sql +taos> SET MAX_BINARY_DISPLAY_WIDTH ; +``` + +如显示的内容后面以 ... 结尾时,表示该内容已被截断,可通过本命令修改显示字符宽度以显示完整的内容。 ## 错误代码表 在 TDengine 3.3.4.8 版本后 TDengine CLI 在返回错误信息中返回了具体错误码,用户可到 TDengine 官网错误码页面查找具体原因及解决措施,见:[错误码参考表](https://docs.taosdata.com/reference/error-code/) diff --git a/docs/zh/14-reference/02-tools/09-taosdump.md b/docs/zh/14-reference/02-tools/09-taosdump.md index 82d39960ea..1e3540ff27 100644 --- a/docs/zh/14-reference/02-tools/09-taosdump.md +++ b/docs/zh/14-reference/02-tools/09-taosdump.md @@ -43,7 +43,7 @@ taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入, ::: -## 详细命令行参数列表 +## 命令行参数 以下为 taosdump 详细命令行参数列表: diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index 88969b7d80..ec749eb5c3 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -87,7 +87,7 @@ taosBenchmark -f 查看更多 json 配置文件示例可 [点击这里](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example) -## 命令行参数详解 +## 命令行参数 | 命令行参数 | 功能说明 | | ---------------------------- | ----------------------------------------------- | | -f/--file \ | 要使用的 JSON 配置文件,由该文件指定所有参数,本参数与命令行其他参数不能同时使用。没有默认值 | From 9eb75a1d85432f0bd4d498821909ee17881ec1cb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 10:04:46 +0800 Subject: [PATCH 29/45] fix: taosBenchmark doc update --- docs/zh/14-reference/02-tools/10-taosbenchmark.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index ec749eb5c3..82da879af8 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -8,7 +8,7 @@ taosBenchmark 是 TDengine 产品性能基准测试工具,提供对 TDengine ## 工具获取 -taosBenchmark 是 TDengine 服务器及客户端安装包安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) +taosBenchmark 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) ## 运行 From 1c9b7d59b00b4311b68bee9cee96fe519c37f3b0 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 10:05:32 +0800 Subject: [PATCH 30/45] chore: prompt and test case for log --- source/util/src/tlog.c | 2 +- tests/system-test/0-others/taosdlog.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 8537f35095..a0105c260b 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -402,7 +402,7 @@ static void taosKeepOldLog(char *oldName) { } if (code != 0 && tsLogEmbedded == 1) { // print error messages only in embedded log mode // avoid using uWarn or uError, as they may open a new log file and potentially cause a deadlock. - fprintf(stderr, "failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); + fprintf(stderr, "WARN: failed at line %d to keep old log file:%s, reason:%s\n", lino, oldName, tstrerror(code)); } } } diff --git a/tests/system-test/0-others/taosdlog.py b/tests/system-test/0-others/taosdlog.py index 7e8dc49552..b6efbe2a4d 100644 --- a/tests/system-test/0-others/taosdlog.py +++ b/tests/system-test/0-others/taosdlog.py @@ -118,6 +118,8 @@ class TDTestCase: tdLog.info(f"wait {i+1} second(s) for log compress") time.sleep(1) tdSql.checkEqual(True, logCompress) + tdSql.execute("alter all dnodes 'numOfLogLines 1000000'") + tdSql.execute("alter all dnodes 'debugFlag 131'") def prepareCfg(self, cfgPath, cfgDict): tdLog.info("make dir %s" % cfgPath) From d73c8d98abb6bcdff14bcc5d504e8be1f1075de5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 10:27:10 +0800 Subject: [PATCH 31/45] docs: parameter charp splite two --- docs/zh/14-reference/02-tools/08-taos-cli.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index d76c7e5374..ec00dbabb1 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -26,7 +26,7 @@ TDengine CLI 的提示符号如下: taos> ``` -进入 TDengine CLI 后,你可执行各种 SQL 语句,包括插入、查询以及各种管理命令。 +进入 TDengine CLI 后,可执行各种 SQL 语句,包括插入、查询以及各种管理命令。 退出 TDengine CLI, 执行 `q` 或 `quit` 或 `exit` 回车即可 ```shell taos> quit @@ -34,7 +34,8 @@ taos> quit ## 命令行参数 -您可通过配置命令行参数来改变 TDengine CLI 的行为。以下为常用的几个命令行参数: +### 常用参数 +可通过配置命令行参数来改变 TDengine CLI 的行为。以下为常用的几个命令行参数: - -h HOST: 要连接的 TDengine 服务端所在服务器的 FQDN, 默认值: 127.0.0.1 - -P PORT: 指定服务端所用端口号,默认值:6030 @@ -42,7 +43,7 @@ taos> quit - -p PASSWORD: 连接服务端时使用的密码,特殊字符如 `! & ( ) < > ; |` 需使用字符 `\` 进行转义处理, 默认值:taosdata - -?, --help: 打印出所有命令行参数 -更多参数: +### 更多参数 - -a AUTHSTR: 连接服务端的授权信息 - -A: 通过用户名和密码计算授权信息 From b283194188cd2bca7383d2bf7f436d1c347e939a Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 10:56:51 +0800 Subject: [PATCH 32/45] docs: taosdump add running chapter --- docs/zh/14-reference/02-tools/09-taosdump.md | 69 ++++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/docs/zh/14-reference/02-tools/09-taosdump.md b/docs/zh/14-reference/02-tools/09-taosdump.md index 1e3540ff27..56f8ecc704 100644 --- a/docs/zh/14-reference/02-tools/09-taosdump.md +++ b/docs/zh/14-reference/02-tools/09-taosdump.md @@ -11,37 +11,17 @@ taosdump 是为开源用户提供的 TDengine 数据备份/恢复工具,备份 taosdump 是 TDengine 服务器及客户端安装包中默认安装组件,安装后即可使用,参考 [TDengine 安装](../../../get-started/) ## 运行 +taosdump 需在命令行终端中运行,运行时必须带参数,指明是备份操作或还原操作,如: +``` bash +taosdump -h dev126 -D test -o /root/test/ +``` +以上命令表示备份主机名为 `dev126` 机器上的 `test` 数据库到 `/root/test/` 目录下 -## 常用使用场景 +``` bash +taosdump -h dev126 -i /root/test/ +``` +以上命令表示把 `/root/test/` 目录下之前备份的数据文件恢复到主机名为 `dev126` 的主机上 -### taosdump 备份数据 - -1. 备份所有数据库:指定 `-A` 或 `--all-databases` 参数; -2. 备份多个指定数据库:使用 `-D db1,db2,...` 参数; -3. 备份指定数据库中某些超级表或普通表:使用 `dbname stbname1 stbname2 tbname1 tbname2 ...` 参数,注意这种输入序列第一个参数为数据库名称,且只支持一个数据库,第二个和之后的参数为该数据库中的超级表或普通表名称,中间以空格分隔; -4. 备份系统 log 库:TDengine 集群通常会包含一个系统数据库,名为 `log`,这个数据库内的数据为 TDengine 自我运行的数据,taosdump 默认不会对 log 库进行备份。如果有特定需求对 log 库进行备份,可以使用 `-a` 或 `--allow-sys` 命令行参数。 -5. “宽容”模式备份:taosdump 1.4.1 之后的版本提供 `-n` 参数和 `-L` 参数,用于备份数据时不使用转义字符和“宽容”模式,可以在表名、列名、标签名没使用转义字符的情况下减少备份数据时间和备份数据占用空间。如果不确定符合使用 `-n` 和 `-L` 条件时请使用默认参数进行“严格”模式进行备份。转义字符的说明请参考[官方文档](../../taos-sql/escape)。 -6. `-o` 参数指定的目录下如果已存在备份文件,为防止数据被覆盖,taosdump 会报错并退出,请更换其它空目录或清空原来数据后再备份。 -7. 目前 taosdump 不支持数据断点继备功能,一旦数据备份中断,需要从头开始。如果备份需要很长时间,建议使用(-S -E 选项)指定开始/结束时间进行分段备份的方法, - -:::tip -- taosdump 1.4.1 之后的版本提供 `-I` 参数,用于解析 avro 文件 schema 和数据,如果指定 `-s` 参数将只解析 schema。 -- taosdump 1.4.2 之后的备份使用 `-B` 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 `-B` 参数调整为更小的值进行尝试。 -- taosdump 的导出不支持中断恢复,所以当进程意外终止后,正确的处理方式是删除当前已导出或生成的所有相关文件。 -- taosdump 的导入支持中断恢复,但是当进程重新启动时,会收到一些“表已经存在”的提示,可以忽视。 - -::: - -### taosdump 恢复数据 - -- 恢复指定路径下的数据文件:使用 `-i` 参数加上数据文件所在路径。如前面提及,不应该使用同一个目录备份不同数据集合,也不应该在同一路径多次备份同一数据集,否则备份数据会造成覆盖或多次备份。 -- taosdump 支持数据恢复至新数据库名下,参数是 -W, 详细见命令行参数说明。 - - -:::tip -taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入,为提高数据恢复性能,目前使用 16384 为一次写入批次。如果备份数据中有比较多列数据,可能会导致产生 "WAL size exceeds limit" 错误,此时可以通过使用 `-B` 参数调整为一个更小的值进行尝试。 - -::: ## 命令行参数 @@ -119,3 +99,34 @@ for any corresponding short options. Report bugs to . ``` + +## 常用使用场景 + +### taosdump 备份数据 + +1. 备份所有数据库:指定 `-A` 或 `--all-databases` 参数; +2. 备份多个指定数据库:使用 `-D db1,db2,...` 参数; +3. 备份指定数据库中某些超级表或普通表:使用 `dbname stbname1 stbname2 tbname1 tbname2 ...` 参数,注意这种输入序列第一个参数为数据库名称,且只支持一个数据库,第二个和之后的参数为该数据库中的超级表或普通表名称,中间以空格分隔; +4. 备份系统 log 库:TDengine 集群通常会包含一个系统数据库,名为 `log`,这个数据库内的数据为 TDengine 自我运行的数据,taosdump 默认不会对 log 库进行备份。如果有特定需求对 log 库进行备份,可以使用 `-a` 或 `--allow-sys` 命令行参数。 +5. “宽容”模式备份:taosdump 1.4.1 之后的版本提供 `-n` 参数和 `-L` 参数,用于备份数据时不使用转义字符和“宽容”模式,可以在表名、列名、标签名没使用转义字符的情况下减少备份数据时间和备份数据占用空间。如果不确定符合使用 `-n` 和 `-L` 条件时请使用默认参数进行“严格”模式进行备份。转义字符的说明请参考[官方文档](../../taos-sql/escape)。 +6. `-o` 参数指定的目录下如果已存在备份文件,为防止数据被覆盖,taosdump 会报错并退出,请更换其它空目录或清空原来数据后再备份。 +7. 目前 taosdump 不支持数据断点继备功能,一旦数据备份中断,需要从头开始。如果备份需要很长时间,建议使用(-S -E 选项)指定开始/结束时间进行分段备份的方法, + +:::tip +- taosdump 1.4.1 之后的版本提供 `-I` 参数,用于解析 avro 文件 schema 和数据,如果指定 `-s` 参数将只解析 schema。 +- taosdump 1.4.2 之后的备份使用 `-B` 参数指定的批次数,默认值为 16384,如果在某些环境下由于网络速度或磁盘性能不足导致 "Error actual dump .. batch .." 可以通过 `-B` 参数调整为更小的值进行尝试。 +- taosdump 的导出不支持中断恢复,所以当进程意外终止后,正确的处理方式是删除当前已导出或生成的所有相关文件。 +- taosdump 的导入支持中断恢复,但是当进程重新启动时,会收到一些“表已经存在”的提示,可以忽视。 + +::: + +### taosdump 恢复数据 + +- 恢复指定路径下的数据文件:使用 `-i` 参数加上数据文件所在路径。如前面提及,不应该使用同一个目录备份不同数据集合,也不应该在同一路径多次备份同一数据集,否则备份数据会造成覆盖或多次备份。 +- taosdump 支持数据恢复至新数据库名下,参数是 -W, 详细见命令行参数说明。 + + +:::tip +taosdump 内部使用 TDengine stmt binding API 进行恢复数据的写入,为提高数据恢复性能,目前使用 16384 为一次写入批次。如果备份数据中有比较多列数据,可能会导致产生 "WAL size exceeds limit" 错误,此时可以通过使用 `-B` 参数调整为一个更小的值进行尝试。 + +::: \ No newline at end of file From 90d0c34e153bb087f8d9c7187a99493a2d151adc Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 11:06:19 +0800 Subject: [PATCH 33/45] docs: taos-cli lost line break --- docs/zh/14-reference/02-tools/08-taos-cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index ec00dbabb1..cff0e72f51 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -75,8 +75,8 @@ taos -h h1.taos.com -s "use db; show tables;" ### taosc 配置文件 -可通过 `-c` 参数改变 `taosc` 客户端加载配置文件的位置,客户端配置参数参考 [客户端配置](../../components/taosc) -如以下命令指定了 `taosc` 客户端加载 `/root/cfg/` 下的 `taos.cfg` 配置文件 +使用 `-c` 参数改变 `taosc` 客户端加载配置文件的位置,客户端配置参数参考 [客户端配置](../../components/taosc) +以下命令指定了 `taosc` 客户端加载 `/root/cfg/` 下的 `taos.cfg` 配置文件 ```bash taos -c /root/cfg/ ``` From b13fb9e287fbd11b25e0f8ed02dfea50c46adbbf Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 11:16:04 +0800 Subject: [PATCH 34/45] docs: add faq of start-limit-hit when restart taosd by systemctl --- docs/zh/27-train-faq/01-faq.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 24254c8807..34f205402e 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -311,4 +311,14 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 直接查子表更快。超级表带 TAG 过滤查询子查数据是为满足查询方便性,同时可对多个子表中数据进行过滤,如果目的是追求性能并已明确查询子表,直接从子表查性能更高 ### 35 如何查看数据压缩率指标? -TDengine 目前只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) \ No newline at end of file +TDengine 目前只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) + +### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 +问题描述: +自 TDengine 3.3.5.1 版本起,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 systemctl status taosd.service 显示错误:Failed with result 'start-limit-hit'。 + +问题原因: +TDengine 3.3.5.1 之前的版本,StartLimitInterval 为 60 秒。若在 60 秒内无法完成 3 次重启(例如,因从 WAL(预写式日志)中恢复大量数据导致启动时间较长),则下一个 60 秒周期内的重启会重新计数,导致系统持续不断地重启 taosd 服务。为避免无限重启问题,将 StartLimitInterval 调整为 900 秒。 + +问题解决: +1)通过 systemd 重启 taosd 服务:推荐方法是先执行命令 systemctl reset-failed taosd.service 重置失败计数器,然后再通过 systemctl restart taosd.service 重启;若需长期调整,可手动修改 /etc/systemd/system/taosd.service 文件,将 StartLimitInterval 调小或将 StartLimitBurst 调大(注:重新安装 taosd 会重置该参数,需要重新修改),执行 systemctl daemon-reload 重新加载配置,然后再重启。2)也可以不通过 systemd 而是通过 taosd 命令直接重启 taosd 服务,此时不受 StartLimitInterval 和 StartLimitBurst 参数限制。 \ No newline at end of file From 3ef70ca82066296d6b278029a46dac0a618ed6e4 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 11:32:26 +0800 Subject: [PATCH 35/45] fix: adjust chapter priority --- docs/zh/14-reference/02-tools/08-taos-cli.md | 28 ++++++++------- .../14-reference/02-tools/10-taosbenchmark.md | 34 +++++-------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index cff0e72f51..81d6398d49 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -89,7 +89,17 @@ taos -c /root/cfg/ taos> source ; ``` -## 在线修改显示字符宽度 +## 数据导入/导出 + +## 导出查询结果 + +- 可以使用符号 “>>” 导出查询结果到某个文件中,语法为: sql 查询语句 >> ‘输出文件名’; 输出文件如果不写路径的话,将输出至当前目录下。如 select * from d0 >> ‘/root/d0.csv’; 将把查询结果输出到 /root/d0.csv 中。 + +## 数据从文件导入 + +- 可以使用 insert into table_name file '输入文件名',把上一步中导出的数据文件再导入到指定表中。如 insert into d0 file '/root/d0.csv'; 表示把上面导出的数据全部再导致至 d0 表中。 + +## 设置显示字符宽度 可以在 TDengine CLI 里使用如下命令调整字符显示宽度 @@ -99,17 +109,14 @@ taos> SET MAX_BINARY_DISPLAY_WIDTH ; 如显示的内容后面以 ... 结尾时,表示该内容已被截断,可通过本命令修改显示字符宽度以显示完整的内容。 -## 错误代码表 -在 TDengine 3.3.4.8 版本后 TDengine CLI 在返回错误信息中返回了具体错误码,用户可到 TDengine 官网错误码页面查找具体原因及解决措施,见:[错误码参考表](https://docs.taosdata.com/reference/error-code/) - -## TDengine CLI TAB 键补全 +## TAB 键自动补全 - TAB 键前为空命令状态下按 TAB 键,会列出 TDengine CLI 支持的所有命令 - TAB 键前为空格状态下按 TAB 键,会显示此位置可以出现的所有命令词的第一个,再次按 TAB 键切为下一个 - TAB 键前为字符串,会搜索与此字符串前缀匹配的所有可出现命令词,并显示第一个,再次按 TAB 键切为下一个 - 输入反斜杠 `\` + TAB 键, 会自动补全为列显示模式命令词 `\G;` -## TDengine CLI 小技巧 +## 使用小技巧 - 可以使用上下光标键查看历史输入的指令 - 在 TDengine CLI 中使用 `alter user` 命令可以修改用户密码,缺省密码为 `taosdata` @@ -117,10 +124,5 @@ taos> SET MAX_BINARY_DISPLAY_WIDTH ; - 执行 `RESET QUERY CACHE` 可清除本地表 Schema 的缓存 - 批量执行 SQL 语句。可以将一系列的 TDengine CLI 命令(以英文 ; 结尾,每个 SQL 语句为一行)按行存放在文件里,在 TDengine CLI 里执行命令 `source ` 自动执行该文件里所有的 SQL 语句 -## TDengine CLI 导出查询结果到文件中 - -- 可以使用符号 “>>” 导出查询结果到某个文件中,语法为: sql 查询语句 >> ‘输出文件名’; 输出文件如果不写路径的话,将输出至当前目录下。如 select * from d0 >> ‘/root/d0.csv’; 将把查询结果输出到 /root/d0.csv 中。 - -## TDengine CLI 导入文件中的数据到表中 - -- 可以使用 insert into table_name file '输入文件名',把上一步中导出的数据文件再导入到指定表中。如 insert into d0 file '/root/d0.csv'; 表示把上面导出的数据全部再导致至 d0 表中。 +## 错误代码表 +在 TDengine 3.3.4.8 版本后 TDengine CLI 在返回错误信息中返回了具体错误码,用户可到 TDengine 官网错误码页面查找具体原因及解决措施,见:[错误码参考表](https://docs.taosdata.com/reference/error-code/) diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index 82da879af8..12cca20792 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -183,7 +183,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - 4 ~ 6 行是测试完成后每个消费者总体统计,统计共消费了多少条消息,共计多少行 - 第 7 行所有消费者总体统计,`msgs` 表示共消费了多少条消息, `rows` 表示共消费了多少行数据 -## 配置文件参数详解 +## 配置文件参数 ### 通用配置参数 @@ -215,7 +215,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 “continue_if_fail”: “yes”, 失败 taosBenchmark 警告用户,并继续写入 “continue_if_fail”: “smart”, 如果子表不存在失败,taosBenchmark 会建立子表并继续写入 -#### 数据库相关配置参数 +#### 数据库相关 创建数据库时的相关参数在 json 配置文件中的 `dbinfo` 中配置,个别具体参数如下。其余参数均与 TDengine 中 `create database` 时所指定的数据库参数相对应,详见[../../taos-sql/database] @@ -223,23 +223,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **drop** : 数据库已存在时是否删除,可选项为 "yes" 或 "no", 默认为 “yes” -#### 流式计算相关配置参数 - -创建流式计算的相关参数在 json 配置文件中的 `stream` 中配置,具体参数如下。 - -- **stream_name** : 流式计算的名称,必填项。 - -- **stream_stb** : 流式计算对应的超级表名称,必填项。 - -- **stream_sql** : 流式计算的sql语句,必填项。 - -- **trigger_mode** : 流式计算的触发模式,可选项。 - -- **watermark** : 流式计算的水印,可选项。 - -- **drop** : 是否创建流式计算,可选项为 "yes" 或者 "no", 为 "no" 时不创建。 - -#### 超级表相关配置参数 +#### 超级表相关 创建超级表时的相关参数在 json 配置文件中的 `super_tables` 中配置,具体参数如下。 @@ -301,7 +285,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **sqls** : 字符串数组类型,指定超级表创建成功后要执行的 sql 数组,sql 中指定表名前面要带数据库名,否则会报未指定数据库错误 -#### 标签列与数据列配置参数 +#### 标签列与数据列 指定超级表标签列与数据列的配置参数分别在 `super_tables` 中的 `columns` 和 `tag` 中。 @@ -336,7 +320,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **fillNull**: 字符串类型,指定此列是否随机插入 NULL 值,可指定为 “true” 或 "false", 只有当 generate_row_rule 为 2 时有效 -#### 插入行为配置参数 +#### 插入行为 - **thread_count** : 插入数据的线程数量,默认为 8。 @@ -362,7 +346,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **pre_load_tb_meta** :是否提前加载子表的 meta 数据,取值为 “yes” or "no"。当子表数量非常多时,打开此选项可提高写入速度。 -### 查询场景配置参数 +### 数据查询 查询场景下 `filetype` 必须设置为 `query`。 `query_times` 指定运行查询的次数,数值类型 @@ -372,7 +356,7 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 其它通用参数详见[通用配置参数](#通用配置参数)。 -#### 执行指定查询语句的配置参数 +#### 执行指定查询语句 查询指定表(可以指定超级表、子表或普通表)的配置参数在 `specified_table_query` 中设置。 @@ -393,7 +377,7 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 - **sql**: 执行的 SQL 命令,必填。 - **result**: 保存查询结果的文件,未指定则不保存。 -#### 查询超级表的配置参数 +#### 查询超级表 查询超级表的配置参数在 `super_table_query` 中设置。 超级表查询的线程模式与上面介绍的指定查询语句查询的 `正常查询` 模式相同,不同之处是本 `sqls` 使用所有子表填充。 @@ -413,8 +397,6 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU ,单位为 订阅场景下 `filetype` 必须设置为 `subscribe`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) -#### 执行指定订阅语句的配置参数 - 订阅指定表(可以指定超级表、子表或者普通表)的配置参数在 `specified_table_query` 中设置。 - **threads/concurrent** : 执行 SQL 的线程数,默认为 1。 From b5069177d37213f690641b8d339c769adfabe83a Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 11:38:37 +0800 Subject: [PATCH 36/45] fix: error word modify --- docs/zh/14-reference/02-tools/08-taos-cli.md | 4 ++-- docs/zh/14-reference/02-tools/10-taosbenchmark.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index 81d6398d49..76e4688503 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -91,11 +91,11 @@ taos> source ; ## 数据导入/导出 -## 导出查询结果 +### 导出查询结果 - 可以使用符号 “>>” 导出查询结果到某个文件中,语法为: sql 查询语句 >> ‘输出文件名’; 输出文件如果不写路径的话,将输出至当前目录下。如 select * from d0 >> ‘/root/d0.csv’; 将把查询结果输出到 /root/d0.csv 中。 -## 数据从文件导入 +### 数据从文件导入 - 可以使用 insert into table_name file '输入文件名',把上一步中导出的数据文件再导入到指定表中。如 insert into d0 file '/root/d0.csv'; 表示把上面导出的数据全部再导致至 d0 表中。 diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md index 12cca20792..c95c76a837 100644 --- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md +++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md @@ -320,7 +320,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **fillNull**: 字符串类型,指定此列是否随机插入 NULL 值,可指定为 “true” 或 "false", 只有当 generate_row_rule 为 2 时有效 -#### 插入行为 +#### 插入行为相关 - **thread_count** : 插入数据的线程数量,默认为 8。 @@ -346,7 +346,7 @@ INFO: Consumed total msgs: 3000, total rows: 30000000 - **pre_load_tb_meta** :是否提前加载子表的 meta 数据,取值为 “yes” or "no"。当子表数量非常多时,打开此选项可提高写入速度。 -### 数据查询 +### 查询场景配置参数 查询场景下 `filetype` 必须设置为 `query`。 `query_times` 指定运行查询的次数,数值类型 From 4590a899e66738e15e9a28b998c30c51c3a10437 Mon Sep 17 00:00:00 2001 From: Kaili Xu Date: Wed, 12 Feb 2025 13:03:37 +0800 Subject: [PATCH 37/45] docs: update 01-faq.md about start-limit-hit when restart taosd with systemd --- docs/zh/27-train-faq/01-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 34f205402e..8986bce8ab 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -318,7 +318,7 @@ TDengine 目前只提供以表为统计单位的压缩率,数据库及整体 自 TDengine 3.3.5.1 版本起,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 systemctl status taosd.service 显示错误:Failed with result 'start-limit-hit'。 问题原因: -TDengine 3.3.5.1 之前的版本,StartLimitInterval 为 60 秒。若在 60 秒内无法完成 3 次重启(例如,因从 WAL(预写式日志)中恢复大量数据导致启动时间较长),则下一个 60 秒周期内的重启会重新计数,导致系统持续不断地重启 taosd 服务。为避免无限重启问题,将 StartLimitInterval 调整为 900 秒。 +TDengine 3.3.5.1 之前的版本,StartLimitInterval 为 60 秒。若在 60 秒内无法完成 3 次重启(例如,因从 WAL(预写式日志)中恢复大量数据导致启动时间较长),则下一个 60 秒周期内的重启会重新计数,导致系统持续不断地重启 taosd 服务。为避免无限重启问题,将 StartLimitInterval 由 60 秒调整为 900 秒。因此,在使用 systemd 短时间内多次启动 taosd 时遇到 start-limit-hit 错误的机率增多。 问题解决: -1)通过 systemd 重启 taosd 服务:推荐方法是先执行命令 systemctl reset-failed taosd.service 重置失败计数器,然后再通过 systemctl restart taosd.service 重启;若需长期调整,可手动修改 /etc/systemd/system/taosd.service 文件,将 StartLimitInterval 调小或将 StartLimitBurst 调大(注:重新安装 taosd 会重置该参数,需要重新修改),执行 systemctl daemon-reload 重新加载配置,然后再重启。2)也可以不通过 systemd 而是通过 taosd 命令直接重启 taosd 服务,此时不受 StartLimitInterval 和 StartLimitBurst 参数限制。 \ No newline at end of file +1)通过 systemd 重启 taosd 服务:推荐方法是先执行命令 systemctl reset-failed taosd.service 重置失败计数器,然后再通过 systemctl restart taosd.service 重启;若需长期调整,可手动修改 /etc/systemd/system/taosd.service 文件,将 StartLimitInterval 调小或将 StartLimitBurst 调大(注:重新安装 taosd 会重置该参数,需要重新修改),执行 systemctl daemon-reload 重新加载配置,然后再重启。2)也可以不通过 systemd 而是通过 taosd 命令直接重启 taosd 服务,此时不受 StartLimitInterval 和 StartLimitBurst 参数限制。 From 748e1058de7b4f14ffeae8aa3e822c7be77344e8 Mon Sep 17 00:00:00 2001 From: Kaili Xu Date: Wed, 12 Feb 2025 13:05:34 +0800 Subject: [PATCH 38/45] docs: update format of start-limit-hit in 01-faq.md --- docs/zh/27-train-faq/01-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 8986bce8ab..5e43f99745 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -315,10 +315,10 @@ TDengine 目前只提供以表为统计单位的压缩率,数据库及整体 ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: -自 TDengine 3.3.5.1 版本起,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 systemctl status taosd.service 显示错误:Failed with result 'start-limit-hit'。 +自 TDengine 3.3.5.1 版本起,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 `systemctl status taosd.service` 显示错误:Failed with result 'start-limit-hit'。 问题原因: TDengine 3.3.5.1 之前的版本,StartLimitInterval 为 60 秒。若在 60 秒内无法完成 3 次重启(例如,因从 WAL(预写式日志)中恢复大量数据导致启动时间较长),则下一个 60 秒周期内的重启会重新计数,导致系统持续不断地重启 taosd 服务。为避免无限重启问题,将 StartLimitInterval 由 60 秒调整为 900 秒。因此,在使用 systemd 短时间内多次启动 taosd 时遇到 start-limit-hit 错误的机率增多。 问题解决: -1)通过 systemd 重启 taosd 服务:推荐方法是先执行命令 systemctl reset-failed taosd.service 重置失败计数器,然后再通过 systemctl restart taosd.service 重启;若需长期调整,可手动修改 /etc/systemd/system/taosd.service 文件,将 StartLimitInterval 调小或将 StartLimitBurst 调大(注:重新安装 taosd 会重置该参数,需要重新修改),执行 systemctl daemon-reload 重新加载配置,然后再重启。2)也可以不通过 systemd 而是通过 taosd 命令直接重启 taosd 服务,此时不受 StartLimitInterval 和 StartLimitBurst 参数限制。 +1)通过 systemd 重启 taosd 服务:推荐方法是先执行命令 `systemctl reset-failed taosd.service` 重置失败计数器,然后再通过 `systemctl restart taosd.service` 重启;若需长期调整,可手动修改 /etc/systemd/system/taosd.service 文件,将 StartLimitInterval 调小或将 StartLimitBurst 调大(注:重新安装 taosd 会重置该参数,需要重新修改),执行 `systemctl daemon-reload` 重新加载配置,然后再重启。2)也可以不通过 systemd 而是通过 taosd 命令直接重启 taosd 服务,此时不受 StartLimitInterval 和 StartLimitBurst 参数限制。 From 6a223a8c22661d51daa5702e20dffe24b9fecf3b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 13:43:24 +0800 Subject: [PATCH 39/45] fix: update taoscli doc --- docs/zh/14-reference/02-tools/08-taos-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/14-reference/02-tools/08-taos-cli.md b/docs/zh/14-reference/02-tools/08-taos-cli.md index 76e4688503..2964b7c184 100644 --- a/docs/zh/14-reference/02-tools/08-taos-cli.md +++ b/docs/zh/14-reference/02-tools/08-taos-cli.md @@ -99,7 +99,7 @@ taos> source ; - 可以使用 insert into table_name file '输入文件名',把上一步中导出的数据文件再导入到指定表中。如 insert into d0 file '/root/d0.csv'; 表示把上面导出的数据全部再导致至 d0 表中。 -## 设置显示字符宽度 +## 设置字符类型显示宽度 可以在 TDengine CLI 里使用如下命令调整字符显示宽度 From fa4fc1bb457d182b41adb0a5e6cbf489cb3359d3 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 12 Feb 2025 13:45:30 +0800 Subject: [PATCH 40/45] fix: reduce version check length --- tests/army/tools/benchmark/basic/commandline.py | 10 +++++++--- tests/army/tools/taosdump/ws/taosdumpEscapedDb.py | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/army/tools/benchmark/basic/commandline.py b/tests/army/tools/benchmark/basic/commandline.py index 12b3e5a920..0a60e1f876 100644 --- a/tests/army/tools/benchmark/basic/commandline.py +++ b/tests/army/tools/benchmark/basic/commandline.py @@ -34,13 +34,17 @@ class TDTestCase(TBase): if len(outputs) != 3: tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") # version string len - assert len(outputs[0]) > 34 - # commid id + assert len(outputs[0]) > 27 + assert outputs[0][:22] == "taosBenchmark version:" + + # commit id assert len(outputs[1]) > 43 + assert outputs[1][:4] == "git:" # build info assert len(outputs[2]) > 36 + assert outputs[2][:6] == "build:" - tdLog.info("check taosBenchmark version successfully.") + tdLog.info("check taosBenchmark version successfully.") def run(self): diff --git a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py index 47feb43120..6c535f794e 100644 --- a/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py +++ b/tests/army/tools/taosdump/ws/taosdumpEscapedDb.py @@ -35,10 +35,13 @@ class TDTestCase(TBase): tdLog.exit(f"checkVersion return lines count {len(outputs) != 3}") # version string len assert len(outputs[0]) > 22 + assert outputs[0][:17] == "taosdump version:" # commit id assert len(outputs[1]) > 43 + assert outputs[1][:4] == "git:" # build info assert len(outputs[2]) > 36 + assert outputs[2][:6] == "build:" tdLog.info("check taosdump version successfully.") From ec9ba9b4003f0187083faf4862cf2b81b6997ead Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 15:28:08 +0800 Subject: [PATCH 41/45] docs: add faq of db compression ratio and disk space usage --- docs/zh/27-train-faq/01-faq.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 5e43f99745..53bc2eef51 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -310,12 +310,14 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 ### 34 超级表带 TAG 过滤查子查数据与直接查子表哪个块? 直接查子表更快。超级表带 TAG 过滤查询子查数据是为满足查询方便性,同时可对多个子表中数据进行过滤,如果目的是追求性能并已明确查询子表,直接从子表查性能更高 -### 35 如何查看数据压缩率指标? -TDengine 目前只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) +### 35 如何查看数据库的数据压缩率和磁盘占用指标? +TDengine 3.3.5.0 之前的版本,只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) + +TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`, 查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: -自 TDengine 3.3.5.1 版本起,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 `systemctl status taosd.service` 显示错误:Failed with result 'start-limit-hit'。 +TDengine 3.3.5.1 及以上的版本,taosd.service 的 systemd 配置文件中,StartLimitInterval 参数从 60 秒调整为 900 秒。若在 900 秒内 taosd 服务重启达到 3 次,后续通过 systemd 启动 taosd 服务时会失败,执行 `systemctl status taosd.service` 显示错误:Failed with result 'start-limit-hit'。 问题原因: TDengine 3.3.5.1 之前的版本,StartLimitInterval 为 60 秒。若在 60 秒内无法完成 3 次重启(例如,因从 WAL(预写式日志)中恢复大量数据导致启动时间较长),则下一个 60 秒周期内的重启会重新计数,导致系统持续不断地重启 taosd 服务。为避免无限重启问题,将 StartLimitInterval 由 60 秒调整为 900 秒。因此,在使用 systemd 短时间内多次启动 taosd 时遇到 start-limit-hit 错误的机率增多。 From 8a492ac6083b129a9896e930e40fb006b79186e7 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 15:30:04 +0800 Subject: [PATCH 42/45] docs: add faq of db compression ratio and disk space usage --- docs/zh/27-train-faq/01-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 53bc2eef51..571fc182be 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -313,7 +313,7 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 ### 35 如何查看数据库的数据压缩率和磁盘占用指标? TDengine 3.3.5.0 之前的版本,只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) -TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`, 查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) +TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`, 查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: From aa6d5fe6c83b50000ea28b3b45354b57aa0ffff4 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 15:32:48 +0800 Subject: [PATCH 43/45] docs: add faq of db compression ratio and disk space usage --- docs/zh/27-train-faq/01-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 571fc182be..0868d4e733 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -313,7 +313,7 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 ### 35 如何查看数据库的数据压缩率和磁盘占用指标? TDengine 3.3.5.0 之前的版本,只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) -TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`, 查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) +TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`,查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: From f90fb4f3d0c2159c4e623cbd79b2e25f39d292b3 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 15:36:18 +0800 Subject: [PATCH 44/45] docs: add faq of db compression ratio and disk space usage --- docs/zh/27-train-faq/01-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 0868d4e733..5b43d80156 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -313,7 +313,7 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 ### 35 如何查看数据库的数据压缩率和磁盘占用指标? TDengine 3.3.5.0 之前的版本,只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) -TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`,查看数据库各个模块磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) +TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库整体的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`,查看数据库各个模块的磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: From d09ab48c3f7dc793b0b73ec8413624074f44883b Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 12 Feb 2025 15:50:29 +0800 Subject: [PATCH 45/45] docs: add faq of db compression ratio and disk space usage --- docs/zh/14-reference/03-taos-sql/02-database.md | 2 +- docs/zh/27-train-faq/01-faq.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/14-reference/03-taos-sql/02-database.md b/docs/zh/14-reference/03-taos-sql/02-database.md index 53d52a3e96..9e42f240d0 100644 --- a/docs/zh/14-reference/03-taos-sql/02-database.md +++ b/docs/zh/14-reference/03-taos-sql/02-database.md @@ -215,7 +215,7 @@ SHOW db_name.ALIVE; 查询数据库 db_name 的可用状态,返回值 0:不可用 1:完全可用 2:部分可用(即数据库包含的 VNODE 部分节点可用,部分节点不可用) -## 查看DB 的磁盘空间占用 +## 查看 DB 的磁盘空间占用 ```sql select * from INFORMATION_SCHEMA.INS_DISK_USAGE where db_name = 'db_name' diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 5b43d80156..12a21df10b 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -313,7 +313,7 @@ TDinsight插件中展示的数据是通过taosKeeper和taosAdapter服务收集 ### 35 如何查看数据库的数据压缩率和磁盘占用指标? TDengine 3.3.5.0 之前的版本,只提供以表为统计单位的压缩率,数据库及整体还未提供,查看命令是在客户端 taos-CLI 中执行 `SHOW TABLE DISTRIBUTED table_name;` 命令,table_name 为要查看压缩率的表,可以为超级表、普通表及子表,详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/show/#show-table-distributed) -TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库整体的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`,查看数据库各个模块的磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8Bdb-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) +TDengine 3.3.5.0 及以上的版本,还提供了数据库整体压缩率和磁盘空间占用统计。查看数据库整体的数据压缩率和磁盘空间占用的命令为 `SHOW db_name.disk_info;`,查看数据库各个模块的磁盘空间占用的命令为 `SELECT * FROM INFORMATION_SCHEMA.INS_DISK_USAGE WHERE db_name='db_name';`,db_name 为要查看的数据库名称。详细可 [查看此处](https://docs.taosdata.com/reference/taos-sql/database/#%E6%9F%A5%E7%9C%8B-db-%E7%9A%84%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E5%8D%A0%E7%94%A8) ### 36 短时间内,通过 systemd 重启 taosd 超过一定次数后重启失败,报错:start-limit-hit。 问题描述: