From b600b4c8bc088582acd2e7d6fe1fdf877c11fa24 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 21 Nov 2022 16:18:50 +0800 Subject: [PATCH 01/12] refactor(sync): modify wal pInfo++, to find which case can not pass --- source/libs/wal/src/walWrite.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 6cd127fed4..caae669e4a 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -325,7 +325,8 @@ int32_t walEndSnapshot(SWal *pWal) { SWalFileInfo *pInfo = taosArraySearch(pWal->fileInfoSet, &tmp, compareWalFileInfo, TD_LE); if (pInfo) { if (ver >= pInfo->lastVer) { - pInfo--; + //pInfo--; + pInfo++; } if (POINTER_DISTANCE(pInfo, pWal->fileInfoSet->pData) > 0) { wDebug("vgId:%d, wal end remove for %" PRId64, pWal->cfg.vgId, pInfo->firstVer); From 6d5a2567749750728111f6ad029c921d21ca893c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 21 Nov 2022 22:40:20 +0800 Subject: [PATCH 02/12] fix(query): fix some memory leaks. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 26 +++++++++---- source/libs/executor/src/cachescanoperator.c | 1 + source/libs/executor/src/executorimpl.c | 40 -------------------- 3 files changed, 19 insertions(+), 48 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 986cba8b17..fbafc63382 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -361,11 +361,17 @@ static void resetAllDataBlockScanInfo(SHashObj* pTableMap, int64_t ts) { STableBlockScanInfo* pInfo = *(STableBlockScanInfo**)p; pInfo->iterInit = false; + pInfo->iter.hasVal = false; pInfo->iiter.hasVal = false; + if (pInfo->iter.iter != NULL) { pInfo->iter.iter = tsdbTbDataIterDestroy(pInfo->iter.iter); } + if (pInfo->iiter.iter != NULL) { + pInfo->iiter.iter = tsdbTbDataIterDestroy(pInfo->iiter.iter); + } + pInfo->delSkyline = taosArrayDestroy(pInfo->delSkyline); pInfo->lastKey = ts; } @@ -373,6 +379,8 @@ static void resetAllDataBlockScanInfo(SHashObj* pTableMap, int64_t ts) { static void clearBlockScanInfo(STableBlockScanInfo* p) { p->iterInit = false; + + p->iter.hasVal = false; p->iiter.hasVal = false; if (p->iter.iter != NULL) { @@ -388,9 +396,9 @@ static void clearBlockScanInfo(STableBlockScanInfo* p) { tMapDataClear(&p->mapData); } -static void destroyAllBlockScanInfo(SHashObj* pTableMap, bool clearEntry) { +static void destroyAllBlockScanInfo(SHashObj* pTableMap) { void* p = NULL; - while (clearEntry && ((p = taosHashIterate(pTableMap, p)) != NULL)) { + while ((p = taosHashIterate(pTableMap, p)) != NULL) { clearBlockScanInfo(*(STableBlockScanInfo**)p); } @@ -2226,6 +2234,7 @@ static int32_t initMemDataIterator(STableBlockScanInfo* pBlockScanInfo, STsdbRea if (pReader->pReadSnap->pMem != NULL) { d = tsdbGetTbDataFromMemTable(pReader->pReadSnap->pMem, pReader->suid, pBlockScanInfo->uid); if (d != NULL) { + ASSERT(pBlockScanInfo->iter.iter == NULL); code = tsdbTbDataIterCreate(d, &startKey, backward, &pBlockScanInfo->iter.iter); if (code == TSDB_CODE_SUCCESS) { pBlockScanInfo->iter.hasVal = (tsdbTbDataIterGet(pBlockScanInfo->iter.iter) != NULL); @@ -3789,9 +3798,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL updateBlockSMAInfo(pReader->pSchema, &pReader->suppInfo); } - STsdbReader* p = pReader->innerReader[0] != NULL ? pReader->innerReader[0] : pReader; - - pReader->status.pTableMap = createDataBlockScanInfo(p, pTableList, numOfTables); + pReader->status.pTableMap = createDataBlockScanInfo(pReader, pTableList, numOfTables); if (pReader->status.pTableMap == NULL) { tsdbReaderClose(pReader); *ppReader = NULL; @@ -3849,7 +3856,7 @@ void tsdbReaderClose(STsdbReader* pReader) { } { - if (pReader->innerReader[0] != NULL) { + if (pReader->innerReader[0] != NULL || pReader->innerReader[1] != NULL) { STsdbReader* p = pReader->innerReader[0]; p->status.pTableMap = NULL; @@ -3887,9 +3894,12 @@ void tsdbReaderClose(STsdbReader* pReader) { cleanupDataBlockIterator(&pReader->status.blockIter); size_t numOfTables = taosHashGetSize(pReader->status.pTableMap); - destroyAllBlockScanInfo(pReader->status.pTableMap, (pReader->innerReader[0] == NULL) ? true : false); + if (pReader->status.pTableMap != NULL) { + destroyAllBlockScanInfo(pReader->status.pTableMap); + clearBlockScanInfoBuf(&pReader->blockInfoBuf); + } + blockDataDestroy(pReader->pResBlock); - clearBlockScanInfoBuf(&pReader->blockInfoBuf); if (pReader->pFileReader != NULL) { tsdbDataFReaderClose(&pReader->pFileReader); diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index b78ba8ac0a..922ed05653 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -246,6 +246,7 @@ void destroyLastrowScanOperator(void* param) { pInfo->pLastrowReader = tsdbCacherowsReaderClose(pInfo->pLastrowReader); } + cleanupExprSupp(&pInfo->pseudoExprSup); taosMemoryFreeClear(param); } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 0dd5765aa4..a7e955100c 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -20,7 +20,6 @@ #include "querynodes.h" #include "tfill.h" #include "tname.h" -#include "tref.h" #include "tdatablock.h" #include "tglobal.h" @@ -134,45 +133,6 @@ static int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, static void initCtxOutputBuffer(SqlFunctionCtx* pCtx, int32_t size); static void doSetTableGroupOutputBuf(SOperatorInfo* pOperator, int32_t numOfOutput, uint64_t groupId); -#if 0 -static bool chkResultRowFromKey(STaskRuntimeEnv* pRuntimeEnv, SResultRowInfo* pResultRowInfo, char* pData, - int16_t bytes, bool masterscan, uint64_t uid) { - bool existed = false; - SET_RES_WINDOW_KEY(pRuntimeEnv->keyBuf, pData, bytes, uid); - - SResultRow** p1 = - (SResultRow**)taosHashGet(pRuntimeEnv->pResultRowHashTable, pRuntimeEnv->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes)); - - // in case of repeat scan/reverse scan, no new time window added. - if (QUERY_IS_INTERVAL_QUERY(pRuntimeEnv->pQueryAttr)) { - if (!masterscan) { // the *p1 may be NULL in case of sliding+offset exists. - return p1 != NULL; - } - - if (p1 != NULL) { - if (pResultRowInfo->size == 0) { - existed = false; - } else if (pResultRowInfo->size == 1) { - // existed = (pResultRowInfo->pResult[0] == (*p1)); - } else { // check if current pResultRowInfo contains the existed pResultRow - SET_RES_EXT_WINDOW_KEY(pRuntimeEnv->keyBuf, pData, bytes, uid, pResultRowInfo); - int64_t* index = - taosHashGet(pRuntimeEnv->pResultRowListSet, pRuntimeEnv->keyBuf, GET_RES_EXT_WINDOW_KEY_LEN(bytes)); - if (index != NULL) { - existed = true; - } else { - existed = false; - } - } - } - - return existed; - } - - return p1 != NULL; -} -#endif - SResultRow* getNewResultRow(SDiskbasedBuf* pResultBuf, int32_t* currentPageId, int32_t interBufSize) { SFilePage* pData = NULL; From bb51d3cac774def54dda8ec7a5eefee8f7626333 Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 21 Nov 2022 23:11:00 +0800 Subject: [PATCH 03/12] fix: fix error for select count(c2),count(ts) from table caused by invalid ts column aggregation --- source/dnode/vnode/src/tsdb/tsdbRead.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 986cba8b17..bb2de2ec93 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -4118,9 +4118,13 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS } else if (pAgg->colId < pSup->colIds[j]) { i += 1; } else if (pSup->colIds[j] < pAgg->colId) { + if (pSup->colIds[j] == PRIMARYKEY_TIMESTAMP_COL_ID) { + taosArrayPush(pNewAggList, &pSup->tsColAgg); + } else { // all date in this block are null - SColumnDataAgg nullColAgg = {.colId = pSup->colIds[j], .numOfNull = pBlock->nRow}; - taosArrayPush(pNewAggList, &nullColAgg); + SColumnDataAgg nullColAgg = {.colId = pSup->colIds[j], .numOfNull = pBlock->nRow}; + taosArrayPush(pNewAggList, &nullColAgg); + } j += 1; } } From 514ad921c74b4d20c818340304db65b574b70e04 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 01:16:38 +0800 Subject: [PATCH 04/12] test:add testcase of enterprise installPackages --- packaging/MPtestJenkinsfile | 197 +++++++++++++++++++++++------------- packaging/testpackage.sh | 107 +++++++++++++++++--- 2 files changed, 218 insertions(+), 86 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index 5dc8024f29..0e958e8384 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -40,27 +40,32 @@ pipeline { choice( name: 'sourcePath', choices: ['nas','web'], - description: 'choice which way to download the installation pacakge;web is Office Web and nas means taos nas server ' + description: 'Choice which way to download the installation pacakge;web is Office Web and nas means taos nas server ' + ) + choice( + name: 'verMode', + choices: ['all','community','enterprise'], + description: 'Choice which types of package you want do check ' ) string ( name:'version', - defaultValue:'3.0.1.6', - description: 'release version number,eg: 3.0.0.1 or 3.0.0.' + defaultValue:'3.0.1.7', + description: 'Release version number,eg: 3.0.0.1 or 3.0.0.' ) string ( name:'baseVersion', - defaultValue:'3.0.1.6', - description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' + defaultValue:'3.0.1.7', + description: 'The number of baseVerison is generally not modified.Now it is 3.0.0.1' ) string ( name:'toolsVersion', defaultValue:'2.2.7', - description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' + description: 'Release version number,eg:2.2.0' ) string ( name:'toolsBaseVersion', defaultValue:'2.1.2', - description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' + description: 'The number of baseVerison is generally not modified.Now it is 2.1.2' ) } environment{ @@ -68,10 +73,10 @@ pipeline { TDINTERNAL_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal' TDENGINE_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal/community' BRANCH_NAME = '3.0' - - TD_SERVER_TAR = "TDengine-server-${version}-Linux-x64.tar.gz" + + TD_SERVER_TAR = "${preServerPackag}-${version}-Linux-x64.tar.gz" BASE_TD_SERVER_TAR = "TDengine-server-${baseVersion}-Linux-x64.tar.gz" - + TD_SERVER_ARM_TAR = "TDengine-server-${version}-Linux-arm64.tar.gz" BASE_TD_SERVER_ARM_TAR = "TDengine-server-${baseVersion}-Linux-arm64.tar.gz" @@ -108,19 +113,24 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sync_source("${BRANCH_NAME}") sh ''' + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done + cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + python3 checkPackageRuning.py ''' } } @@ -131,22 +141,26 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sync_source("${BRANCH_NAME}") sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - dpkg -r tdengine - ''' + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done + + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + python3 checkPackageRuning.py + dpkg -r tdengine + ''' } } } @@ -156,19 +170,24 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sync_source("${BRANCH_NAME}") sh ''' + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done + cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + python3 checkPackageRuning.py ''' } } @@ -179,21 +198,26 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sync_source("${BRANCH_NAME}") sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done + cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py - ''' - sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + python3 checkPackageRuning.py sudo rpm -e tdengine - ''' + ''' } } } @@ -203,9 +227,16 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sync_source("${BRANCH_NAME}") sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_ARM_TAR} ${version} ${BASE_TD_SERVER_ARM_TAR} ${baseVersion} server ${sourcePath} - python3 checkPackageRuning.py + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done ''' } } @@ -219,8 +250,16 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES'){ sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_TAR} ${version} ${BASE_TD_CLIENT_TAR} ${baseVersion} client ${sourcePath} + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done python3 checkPackageRuning.py 192.168.0.21 ''' } @@ -231,8 +270,16 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES'){ sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_LITE_TAR} ${version} ${BASE_TD_CLIENT_LITE_TAR} ${baseVersion} client ${sourcePath} + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done python3 checkPackageRuning.py 192.168.0.24 ''' } @@ -245,8 +292,16 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES'){ sh ''' - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_ARM_TAR} ${version} ${BASE_TD_CLIENT_ARM_TAR} ${baseVersion} client ${sourcePath} + if [ "${verMode}" = "all" ];then + verMode="community enterprise" + fi + verModeList=${verMode} + for verModeSin in ${verModeList} + do + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + done python3 checkPackageRuning.py 192.168.0.21 ''' } diff --git a/packaging/testpackage.sh b/packaging/testpackage.sh index b0e33835dd..846c8d160f 100755 --- a/packaging/testpackage.sh +++ b/packaging/testpackage.sh @@ -1,15 +1,72 @@ #!/bin/sh + + +function usage() { + echo "$0" + echo -e "\t -f test file type,server/client/tools/" + echo -e "\t -m pacakage version Type,community/enterprise" + echo -e "\t -l package type,lite or not" + echo -e "\t -c operation type,x64/arm64" + echo -e "\t -v pacakage version,3.0.1.7" + echo -e "\t -o pacakage version,3.0.1.7" + echo -e "\t -s source Path,web/nas" + echo -e "\t -t package Type,tar/rpm/deb" + echo -e "\t -h help" +} + + #parameter scriptDir=$(dirname $(readlink -f $0)) -packgeName=$1 -version=$2 -originPackageName=$3 -originversion=$4 -testFile=$5 -# sourcePath:web/nas -sourcePath=$6 +version="3.0.1.7" +originversion="3.0.1.7" +testFile="server" +verMode="communtity" +sourcePath="nas" +cpuType="x64" +lite="true" +packageType="tar" subFile="taos.tar.gz" +while getopts "m:c:f:l:s:o:t:v:h" opt; do + case $opt in + m) + verMode=$OPTARG + ;; + v) + version=$OPTARG + ;; + f) + testFile=$OPTARG + ;; + l) + lite=$OPTARG + ;; + s) + sourcePath=$OPTARG + ;; + o) + originversion=$OPTARG + ;; + c) + cpuType=$OPTARG + ;; + t) + packageType=$OPTARG + ;; + h) + usage + exit 0 + ;; + ?) + echo "Invalid option: -$OPTARG" + usage + exit 0 + ;; + esac +done + + +echo "testFile:${testFile},verMode:${verMode},lite:${lite},cpuType:${cpuType},packageType:${packageType},version-${version},originversion:${originversion},sourcePath:${sourcePath}" # Color setting RED='\033[41;30m' GREEN='\033[1;32m' @@ -21,20 +78,40 @@ BLUE_DARK='\033[0;34m' GREEN_UNDERLINE='\033[4;32m' NC='\033[0m' -if [ ${testFile} = "server" ];then - tdPath="TDengine-server-${version}" - originTdpPath="TDengine-server-${originversion}" +if [[ ${verMode} = "enterprise" ]];then + prePackag="TDengine-enterprise-${testFile}" +elif [ ${verMode} = "community" ];then + prePackag="TDengine-${testFile}" +fi +if [ ${lite} = "true" ];then + packageLite="-Lite" +elif [ ${lite} = "false" ];then + packageLite="" +fi +if [[ "$packageType" = "tar" ]] ;then + packageType="tar.gz" +fi + +tdPath="${prePackag}-${version}" +originTdpPath="${prePackag}-${originversion}" + +packgeName="${tdPath}-Linux-${cpuType}${packageLite}.${packageType}" +originPackageName="${originTdpPath}-Linux-${cpuType}${packageLite}.${packageType}" + +if [ "$testFile" == "server" ] ;then installCmd="install.sh" elif [ ${testFile} = "client" ];then - tdPath="TDengine-client-${version}" - originTdpPath="TDengine-client-${originversion}" installCmd="install_client.sh" elif [ ${testFile} = "tools" ];then tdPath="taosTools-${version}" originTdpPath="taosTools-${originversion}" + packgeName="${tdPath}-Linux-${cpuType}${packageLite}.${packageType}" + originPackageName="${originTdpPath}-Linux-${cpuType}${packageLite}.${packageType}" installCmd="install-taostools.sh" fi + +echo "tdPath:${tdPath},originTdpPath:${originTdpPath},packgeName:${packgeName},originPackageName:${originPackageName}" function cmdInstall { command=$1 if command -v ${command} ;then @@ -76,16 +153,16 @@ file=$1 versionPath=$2 sourceP=$3 nasServerIP="192.168.1.131" -packagePath="/nas/TDengine/v${versionPath}/community" +packagePath="/nas/TDengine/v${versionPath}/${verMode}" if [ -f ${file} ];then echoColor YD "${file} already exists ,it will delete it and download it again " rm -rf ${file} fi -if [ ${sourceP} = 'web' ];then +if [[ ${sourceP} = 'web' ]];then echoColor BD "====download====:wget https://www.taosdata.com/assets-download/3.0/${file}" wget https://www.taosdata.com/assets-download/3.0/${file} -elif [ ${sourceP} = 'nas' ];then +elif [[ ${sourceP} = 'nas' ]];then echoColor BD "====download====:scp root@${nasServerIP}:${packagePath}/${file} ." scp root@${nasServerIP}:${packagePath}/${file} . fi From c3514a97a204275d034d612cae41c322762d85c3 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 01:53:08 +0800 Subject: [PATCH 05/12] test:modify two options that downloads the installPackages --- packaging/MPtestJenkinsfile | 93 ++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index 0e958e8384..de6cace508 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -117,19 +117,26 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py - - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py done + ''' + sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + ''' + + sh ''' + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb python3 checkPackageRuning.py ''' } @@ -145,19 +152,26 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py - - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py done + ''' + sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb + bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + ''' + + sh ''' + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb python3 checkPackageRuning.py dpkg -r tdengine ''' @@ -174,19 +188,25 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py - - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done + ''' + sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + ''' + + sh ''' + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm python3 checkPackageRuning.py ''' } @@ -202,19 +222,25 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py - - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py - done + done + ''' + sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm + bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py + ''' + + sh ''' + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm python3 checkPackageRuning.py sudo rpm -e tdengine ''' @@ -231,6 +257,9 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -254,6 +283,8 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -270,16 +301,10 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES'){ sh ''' - if [ "${verMode}" = "all" ];then - verMode="community enterprise" - fi - verModeList=${verMode} - for verModeSin in ${verModeList} - do - cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar - python3 checkPackageRuning.py - done + verModeList=community + cd ${TDENGINE_ROOT_DIR}/packaging + bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + python3 checkPackageRuning.py python3 checkPackageRuning.py 192.168.0.24 ''' } @@ -296,10 +321,12 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} + ''' + sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar + bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar python3 checkPackageRuning.py done python3 checkPackageRuning.py 192.168.0.21 From 642202681c7ee1c4359d794b7589f9059a1af5b1 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 22 Nov 2022 09:22:13 +0800 Subject: [PATCH 06/12] test: add asan case --- tests/parallel_test/cases.task | 132 ++++++++++++++++----------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 75ff515078..1741e282fb 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -431,40 +431,40 @@ ,,,system-test,python3 ./test.py -f 1-insert/time_range_wise.py ,,,system-test,python3 ./test.py -f 1-insert/block_wise.py ,,,system-test,python3 ./test.py -f 1-insert/create_retentions.py -,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py ,,,system-test,python3 ./test.py -f 1-insert/mutil_stage.py -,,,system-test,python3 ./test.py -f 1-insert/table_param_ttl.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data_muti_rows.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/db_tb_name_check.py ,,,system-test,python3 ./test.py -f 1-insert/database_pre_suf.py ,,,system-test,python3 ./test.py -f 1-insert/InsertFuturets.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py -,,,system-test,python3 ./test.py -f 2-query/abs.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/and_or_for_byte.py -,,,system-test,python3 ./test.py -f 2-query/and_or_for_byte.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/and_or_for_byte.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/apercentile.py -,,,system-test,python3 ./test.py -f 2-query/apercentile.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/apercentile.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arccos.py -,,,system-test,python3 ./test.py -f 2-query/arccos.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arccos.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arcsin.py -,,,system-test,python3 ./test.py -f 2-query/arcsin.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arcsin.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arctan.py -,,,system-test,python3 ./test.py -f 2-query/arctan.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arctan.py -R ,,,system-test,python3 ./test.py -f 2-query/avg.py ,,,system-test,python3 ./test.py -f 2-query/avg.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -,,,system-test,python3 ./test.py -f 2-query/between.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -,,,system-test,python3 ./test.py -f 2-query/bottom.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cast.py -,,,system-test,python3 ./test.py -f 2-query/cast.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cast.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ceil.py -,,,system-test,python3 ./test.py -f 2-query/ceil.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ceil.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/char_length.py -,,,system-test,python3 ./test.py -f 2-query/char_length.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/char_length.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/check_tsdb.py -,,,system-test,python3 ./test.py -f 2-query/check_tsdb.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/check_tsdb.py -R ,,,system-test,python3 ./test.py -f 2-query/concat.py ,,,system-test,python3 ./test.py -f 2-query/concat.py -R ,,,system-test,python3 ./test.py -f 2-query/concat_ws.py @@ -472,63 +472,63 @@ ,,,system-test,python3 ./test.py -f 2-query/concat_ws2.py ,,,system-test,python3 ./test.py -f 2-query/concat_ws2.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cos.py -,,,system-test,python3 ./test.py -f 2-query/cos.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cos.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -,,,system-test,python3 ./test.py -f 2-query/count_partition.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -,,,system-test,python3 ./test.py -f 2-query/count.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -,,,system-test,python3 ./test.py -f 2-query/countAlwaysReturnValue.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py -,,,system-test,python3 ./test.py -f 2-query/db.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -,,,system-test,python3 ./test.py -f 2-query/diff.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -,,,system-test,python3 ./test.py -f 2-query/distinct.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_apercentile.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_avg.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_avg.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_avg.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_count.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_max.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_max.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_max.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_min.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_min.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_min.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_spread.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_spread.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_spread.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_stddev.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_stddev.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_stddev.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_sum.py -,,,system-test,python3 ./test.py -f 2-query/distribute_agg_sum.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_sum.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/explain.py -,,,system-test,python3 ./test.py -f 2-query/explain.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/explain.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/first.py -,,,system-test,python3 ./test.py -f 2-query/first.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/first.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/floor.py -,,,system-test,python3 ./test.py -f 2-query/floor.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/floor.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -,,,system-test,python3 ./test.py -f 2-query/function_null.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -,,,system-test,python3 ./test.py -f 2-query/function_stateduration.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/histogram.py -,,,system-test,python3 ./test.py -f 2-query/histogram.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/histogram.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hyperloglog.py -,,,system-test,python3 ./test.py -f 2-query/hyperloglog.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hyperloglog.py -R ,,,system-test,python3 ./test.py -f 2-query/interp.py ,,,system-test,python3 ./test.py -f 2-query/interp.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/irate.py -,,,system-test,python3 ./test.py -f 2-query/irate.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/irate.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join.py -,,,system-test,python3 ./test.py -f 2-query/join.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join.py -R ,,,system-test,python3 ./test.py -f 2-query/last_row.py ,,,system-test,python3 ./test.py -f 2-query/last_row.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -,,,system-test,python3 ./test.py -f 2-query/last.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/leastsquares.py -,,,system-test,python3 ./test.py -f 2-query/leastsquares.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/leastsquares.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/length.py -,,,system-test,python3 ./test.py -f 2-query/length.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/length.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/log.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/log.py -R ,,,system-test,python3 ./test.py -f 2-query/lower.py @@ -536,25 +536,25 @@ ,,,system-test,python3 ./test.py -f 2-query/ltrim.py ,,,system-test,python3 ./test.py -f 2-query/ltrim.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -,,,system-test,python3 ./test.py -f 2-query/mavg.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -,,,system-test,python3 ./test.py -f 2-query/max_partition.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -,,,system-test,python3 ./test.py -f 2-query/max.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -,,,system-test,python3 ./test.py -f 2-query/min.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -R ,,,system-test,python3 ./test.py -f 2-query/mode.py ,,,system-test,python3 ./test.py -f 2-query/mode.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py -,,,system-test,python3 ./test.py -f 2-query/Now.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -,,,system-test,python3 ./test.py -f 2-query/percentile.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/pow.py -,,,system-test,python3 ./test.py -f 2-query/pow.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/pow.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/query_cols_tags_and_or.py -,,,system-test,python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/round.py -,,,system-test,python3 ./test.py -f 2-query/round.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/round.py -R ,,,system-test,python3 ./test.py -f 2-query/rtrim.py ,,,system-test,python3 ./test.py -f 2-query/rtrim.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sample.py @@ -566,51 +566,51 @@ ,,,system-test,python3 ./test.py -f 2-query/sml.py ,,,system-test,python3 ./test.py -f 2-query/sml.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py -,,,system-test,python3 ./test.py -f 2-query/spread.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sqrt.py -,,,system-test,python3 ./test.py -f 2-query/sqrt.py -R +,,y,system-test,./pytest.sh python3./test.py -f 2-query/sqrt.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -,,,system-test,python3 ./test.py -f 2-query/statecount.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py ,,,system-test,python3 ./test.py -f 2-query/stateduration.py -R ,,,system-test,python3 ./test.py -f 2-query/substr.py ,,,system-test,python3 ./test.py -f 2-query/substr.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sum.py -,,,system-test,python3 ./test.py -f 2-query/sum.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sum.py -R ,,,system-test,python3 ./test.py -f 2-query/tail.py ,,,system-test,python3 ./test.py -f 2-query/tail.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tan.py -,,,system-test,python3 ./test.py -f 2-query/tan.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tan.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -,,,system-test,python3 ./test.py -f 2-query/Timediff.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -,,,system-test,python3 ./test.py -f 2-query/timetruncate.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timezone.py -,,,system-test,python3 ./test.py -f 2-query/timezone.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timezone.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/To_iso8601.py -,,,system-test,python3 ./test.py -f 2-query/To_iso8601.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/To_iso8601.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/To_unixtimestamp.py -,,,system-test,python3 ./test.py -f 2-query/To_unixtimestamp.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/To_unixtimestamp.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -,,,system-test,python3 ./test.py -f 2-query/Today.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -,,,system-test,python3 ./test.py -f 2-query/top.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -R ,,,system-test,python3 ./test.py -f 2-query/tsbsQuery.py ,,,system-test,python3 ./test.py -f 2-query/tsbsQuery.py -R ,,,system-test,python3 ./test.py -f 2-query/ttl_comment.py ,,,system-test,python3 ./test.py -f 2-query/ttl_comment.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py -,,,system-test,python3 ./test.py -f 2-query/twa.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py -R ,,,system-test,python3 ./test.py -f 2-query/union.py ,,,system-test,python3 ./test.py -f 2-query/union.py -R ,,,system-test,python3 ./test.py -f 2-query/unique.py ,,,system-test,python3 ./test.py -f 2-query/unique.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/upper.py -,,,system-test,python3 ./test.py -f 2-query/upper.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/upper.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -,,,system-test,python3 ./test.py -f 2-query/varchar.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -,,,system-test,python3 ./test.py -f 2-query/case_when.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -R ,,,system-test,python3 ./test.py -f 1-insert/update_data.py ,,,system-test,python3 ./test.py -f 1-insert/tb_100w_data_order.py ,,,system-test,python3 ./test.py -f 1-insert/delete_stable.py From 726d4d69aad90bca7d517aa1a14d4de4d902677e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 22 Nov 2022 09:55:36 +0800 Subject: [PATCH 07/12] test: add asan case --- tests/parallel_test/cases.task | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1741e282fb..b91d53bcf2 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -572,7 +572,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -,,,system-test,python3 ./test.py -f 2-query/stateduration.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -R ,,,system-test,python3 ./test.py -f 2-query/substr.py ,,,system-test,python3 ./test.py -f 2-query/substr.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sum.py @@ -601,8 +601,8 @@ ,,,system-test,python3 ./test.py -f 2-query/ttl_comment.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py -R -,,,system-test,python3 ./test.py -f 2-query/union.py -,,,system-test,python3 ./test.py -f 2-query/union.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union.py -R ,,,system-test,python3 ./test.py -f 2-query/unique.py ,,,system-test,python3 ./test.py -f 2-query/unique.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/upper.py From b9f7d181b64255a913a06d29abecb7727324a501 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 22 Nov 2022 10:47:50 +0800 Subject: [PATCH 08/12] fix: free the batch create table reqs' decoded comment field --- source/dnode/vnode/src/vnd/vnodeSvr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 5c8c166833..c75d1ffded 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -609,6 +609,7 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR _exit: for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pCreateReq = req.pReqs + iReq; + taosMemoryFree(pCreateReq->comment); taosArrayDestroy(pCreateReq->ctb.tagName); } taosArrayDestroyEx(rsp.pArray, tFreeSVCreateTbRsp); From fbb0a1e921dbc12aff0e3abdaae054d603834512 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 22 Nov 2022 11:08:55 +0800 Subject: [PATCH 09/12] fix(query): set correct tsdbreader during the creation of tableblockscan info --- source/dnode/vnode/src/tsdb/tsdbRead.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index fbafc63382..69fae4d481 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -329,20 +329,6 @@ static SHashObj* createDataBlockScanInfo(STsdbReader* pTsdbReader, const STableK } taosHashPut(pTableMap, &pScanInfo->uid, sizeof(uint64_t), &pScanInfo, POINTER_BYTES); - -#if 0 -// STableBlockScanInfo info = {.lastKey = 0, .uid = idList[j].uid}; - if (ASCENDING_TRAVERSE(pTsdbReader->order)) { - int64_t skey = pTsdbReader->window.skey; - info.lastKey = (skey > INT64_MIN) ? (skey - 1) : skey; - } else { - int64_t ekey = pTsdbReader->window.ekey; - info.lastKey = (ekey < INT64_MAX) ? (ekey + 1) : ekey; - } - - taosHashPut(pTableMap, &info.uid, sizeof(uint64_t), &info, sizeof(info)); -#endif - tsdbTrace("%p check table uid:%" PRId64 " from lastKey:%" PRId64 " %s", pTsdbReader, pScanInfo->uid, pScanInfo->lastKey, pTsdbReader->idStr); } @@ -3798,7 +3784,8 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL updateBlockSMAInfo(pReader->pSchema, &pReader->suppInfo); } - pReader->status.pTableMap = createDataBlockScanInfo(pReader, pTableList, numOfTables); + STsdbReader* p = (pReader->innerReader[0] != NULL)? pReader->innerReader[0]:pReader; + pReader->status.pTableMap = createDataBlockScanInfo(p, pTableList, numOfTables); if (pReader->status.pTableMap == NULL) { tsdbReaderClose(pReader); *ppReader = NULL; From 33538e39e24715cbb8f68497a9eaad86dcc9edba Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 22 Nov 2022 12:21:18 +0800 Subject: [PATCH 10/12] test: add asan case --- tests/parallel_test/cases.task | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index b91d53bcf2..1e5f2fad44 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -568,7 +568,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sqrt.py -,,y,system-test,./pytest.sh python3./test.py -f 2-query/sqrt.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sqrt.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py @@ -597,8 +597,8 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -R ,,,system-test,python3 ./test.py -f 2-query/tsbsQuery.py ,,,system-test,python3 ./test.py -f 2-query/tsbsQuery.py -R -,,,system-test,python3 ./test.py -f 2-query/ttl_comment.py -,,,system-test,python3 ./test.py -f 2-query/ttl_comment.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/twa.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union.py From 1d48426e94ddb732bc132dc8d17e0262598fcbd6 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Tue, 22 Nov 2022 12:45:31 +0800 Subject: [PATCH 11/12] refactor(sync): del wal in multi-replicas --- include/libs/sync/sync.h | 2 +- source/libs/sync/src/syncAppendEntriesReply.c | 3 ++ source/libs/sync/src/syncMain.c | 49 +++++++++++++------ source/libs/sync/src/syncRaftLog.c | 12 ++++- source/libs/sync/src/syncTimeout.c | 24 ++++----- source/libs/sync/src/syncUtil.c | 4 +- 6 files changed, 63 insertions(+), 31 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 3a808ac6f3..513ba8cb34 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -36,7 +36,7 @@ extern "C" { #define SYNC_DEL_WAL_MS (1000 * 60) #define SYNC_ADD_QUORUM_COUNT 3 #define SYNC_MNODE_LOG_RETENTION 10000 -#define SYNC_VNODE_LOG_RETENTION 100 +#define SYNC_VNODE_LOG_RETENTION 20 #define SNAPSHOT_MAX_CLOCK_SKEW_MS 1000 * 10 #define SNAPSHOT_WAIT_MS 1000 * 30 diff --git a/source/libs/sync/src/syncAppendEntriesReply.c b/source/libs/sync/src/syncAppendEntriesReply.c index 13ea250155..c602788b19 100644 --- a/source/libs/sync/src/syncAppendEntriesReply.c +++ b/source/libs/sync/src/syncAppendEntriesReply.c @@ -67,6 +67,9 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { if (pMsg->matchIndex > oldMatchIndex) { syncIndexMgrSetIndex(ths->pMatchIndex, &(pMsg->srcId), pMsg->matchIndex); syncMaybeAdvanceCommitIndex(ths); + + // maybe update minMatchIndex + ths->minMatchIndex = syncMinMatchIndex(ths); } syncIndexMgrSetIndex(ths->pNextIndex, &(pMsg->srcId), pMsg->matchIndex + 1); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index a427d7aa0c..88b8ba7e25 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -243,6 +243,18 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) { goto _DEL_WAL; } else { + lastApplyIndex -= SYNC_VNODE_LOG_RETENTION; + + SyncIndex beginIndex = pSyncNode->pLogStore->syncLogBeginIndex(pSyncNode->pLogStore); + SyncIndex endIndex = pSyncNode->pLogStore->syncLogEndIndex(pSyncNode->pLogStore); + bool isEmpty = pSyncNode->pLogStore->syncLogIsEmpty(pSyncNode->pLogStore); + + if (isEmpty || !(lastApplyIndex >= beginIndex && lastApplyIndex <= endIndex)) { + sNTrace(pSyncNode, "new-snapshot-index:%" PRId64 ", empty:%d, do not delete wal", lastApplyIndex, isEmpty); + syncNodeRelease(pSyncNode); + return 0; + } + // vnode if (pSyncNode->replicaNum > 1) { // multi replicas @@ -300,26 +312,31 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) { _DEL_WAL: do { - SyncIndex snapshottingIndex = atomic_load_64(&pSyncNode->snapshottingIndex); + SSyncLogStoreData* pData = pSyncNode->pLogStore->data; + SyncIndex snapshotVer = walGetSnapshotVer(pData->pWal); + SyncIndex walCommitVer = walGetCommittedVer(pData->pWal); + SyncIndex wallastVer = walGetLastVer(pData->pWal); + if (lastApplyIndex <= walCommitVer) { + SyncIndex snapshottingIndex = atomic_load_64(&pSyncNode->snapshottingIndex); - if (snapshottingIndex == SYNC_INDEX_INVALID) { - atomic_store_64(&pSyncNode->snapshottingIndex, lastApplyIndex); - pSyncNode->snapshottingTime = taosGetTimestampMs(); + if (snapshottingIndex == SYNC_INDEX_INVALID) { + atomic_store_64(&pSyncNode->snapshottingIndex, lastApplyIndex); + pSyncNode->snapshottingTime = taosGetTimestampMs(); + + code = walBeginSnapshot(pData->pWal, lastApplyIndex); + if (code == 0) { + sNTrace(pSyncNode, "wal snapshot begin, index:%" PRId64 ", last apply index:%" PRId64, + pSyncNode->snapshottingIndex, lastApplyIndex); + } else { + sNError(pSyncNode, "wal snapshot begin error since:%s, index:%" PRId64 ", last apply index:%" PRId64, + terrstr(terrno), pSyncNode->snapshottingIndex, lastApplyIndex); + atomic_store_64(&pSyncNode->snapshottingIndex, SYNC_INDEX_INVALID); + } - SSyncLogStoreData* pData = pSyncNode->pLogStore->data; - code = walBeginSnapshot(pData->pWal, lastApplyIndex); - if (code == 0) { - sNTrace(pSyncNode, "wal snapshot begin, index:%" PRId64 ", last apply index:%" PRId64, - pSyncNode->snapshottingIndex, lastApplyIndex); } else { - sNError(pSyncNode, "wal snapshot begin error since:%s, index:%" PRId64 ", last apply index:%" PRId64, - terrstr(terrno), pSyncNode->snapshottingIndex, lastApplyIndex); - atomic_store_64(&pSyncNode->snapshottingIndex, SYNC_INDEX_INVALID); + sNTrace(pSyncNode, "snapshotting for %" PRId64 ", do not delete wal for new-snapshot-index:%" PRId64, + snapshottingIndex, lastApplyIndex); } - - } else { - sNTrace(pSyncNode, "snapshotting for %" PRId64 ", do not delete wal for new-snapshot-index:%" PRId64, - snapshottingIndex, lastApplyIndex); } } while (0); diff --git a/source/libs/sync/src/syncRaftLog.c b/source/libs/sync/src/syncRaftLog.c index db0b6d1d02..2f824b6b3b 100644 --- a/source/libs/sync/src/syncRaftLog.c +++ b/source/libs/sync/src/syncRaftLog.c @@ -375,7 +375,17 @@ static int32_t raftLogGetLastEntry(SSyncLogStore* pLogStore, SSyncRaftEntry** pp int32_t raftLogUpdateCommitIndex(SSyncLogStore* pLogStore, SyncIndex index) { SSyncLogStoreData* pData = pLogStore->data; SWal* pWal = pData->pWal; - // ASSERT(walCommit(pWal, index) == 0); + + // need not update + SyncIndex snapshotVer = walGetSnapshotVer(pWal); + SyncIndex walCommitVer = walGetCommittedVer(pWal); + SyncIndex wallastVer = walGetLastVer(pWal); + + if (index < snapshotVer || index > wallastVer) { + // ignore + return 0; + } + int32_t code = walCommit(pWal, index); if (code != 0) { int32_t err = terrno; diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index 3d4583aadb..151e5cdf46 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -62,18 +62,20 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { syncNodeCleanConfigIndex(ths); } - // end timeout wal snapshot int64_t timeNow = taosGetTimestampMs(); - if (timeNow - ths->snapshottingIndex > SYNC_DEL_WAL_MS && - atomic_load_64(&ths->snapshottingIndex) != SYNC_INDEX_INVALID) { - SSyncLogStoreData* pData = ths->pLogStore->data; - int32_t code = walEndSnapshot(pData->pWal); - if (code != 0) { - sNError(ths, "timer wal snapshot end error since:%s", terrstr()); - return -1; - } else { - sNTrace(ths, "wal snapshot end, index:%" PRId64, atomic_load_64(&ths->snapshottingIndex)); - atomic_store_64(&ths->snapshottingIndex, SYNC_INDEX_INVALID); + if (atomic_load_64(&ths->snapshottingIndex) != SYNC_INDEX_INVALID) { + // end timeout wal snapshot + if (timeNow - ths->snapshottingTime > SYNC_DEL_WAL_MS && + atomic_load_64(&ths->snapshottingIndex) != SYNC_INDEX_INVALID) { + SSyncLogStoreData* pData = ths->pLogStore->data; + int32_t code = walEndSnapshot(pData->pWal); + if (code != 0) { + sNError(ths, "timer wal snapshot end error since:%s", terrstr()); + return -1; + } else { + sNTrace(ths, "wal snapshot end, index:%" PRId64, atomic_load_64(&ths->snapshottingIndex)); + atomic_store_64(&ths->snapshottingIndex, SYNC_INDEX_INVALID); + } } } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index b50336cd63..4fc7dd245d 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -239,11 +239,11 @@ void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNo "vgId:%d, sync %s " "%s" ", tm:%" PRIu64 ", cmt:%" PRId64 ", fst:%" PRId64 ", lst:%" PRId64 ", min:%" PRId64 ", snap:%" PRId64 - ", snap-tm:%" PRIu64 ", sby:%d, aq:%d, bch:%d, r-num:%d, lcfg:%" PRId64 + ", snap-tm:%" PRIu64 ", sby:%d, aq:%d, snaping:%" PRId64 ", r-num:%d, lcfg:%" PRId64 ", chging:%d, rsto:%d, dquorum:%d, elt:%" PRId64 ", hb:%" PRId64 ", %s, %s", pNode->vgId, syncStr(pNode->state), eventLog, currentTerm, pNode->commitIndex, logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm, - pNode->pRaftCfg->isStandBy, aqItems, pNode->pRaftCfg->batchSize, pNode->replicaNum, + pNode->pRaftCfg->isStandBy, aqItems, pNode->snapshottingIndex, pNode->replicaNum, pNode->pRaftCfg->lastConfigIndex, pNode->changing, pNode->restoreFinish, quorum, pNode->electTimerLogicClock, pNode->heartbeatTimerLogicClockUser, peerStr, cfgStr); } From cd49e5b4e5252791bcb99dfdda6436ab1011276c Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Nov 2022 13:40:25 +0800 Subject: [PATCH 12/12] test:add testcase of enterprise installPackages --- packaging/MPtestJenkinsfile | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index de6cace508..dad5b7f129 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -116,10 +116,7 @@ pipeline { if [ "${verMode}" = "all" ];then verMode="community enterprise" fi - verModeList=${verMode} - ''' - - sh ''' + verModeList=${verMode} for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -152,9 +149,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -188,8 +182,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -222,8 +214,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -257,9 +247,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -283,8 +270,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging @@ -321,8 +306,6 @@ pipeline { verMode="community enterprise" fi verModeList=${verMode} - ''' - sh ''' for verModeSin in ${verModeList} do cd ${TDENGINE_ROOT_DIR}/packaging