From 8114e1e7582efa936c5f16994fbda811f5b11e3d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 14 Jul 2020 19:24:38 +0800 Subject: [PATCH 01/30] [td-225] fix compiler error. --- src/query/inc/qUtil.h | 23 +++- src/query/inc/tsqlfunction.h | 5 +- src/query/src/qExecutor.c | 215 ++++++++++++++++++++++------------- src/query/src/qUtil.c | 13 +-- src/query/src/qresultBuf.c | 2 +- src/tsdb/src/tsdbRead.c | 3 +- 6 files changed, 164 insertions(+), 97 deletions(-) diff --git a/src/query/inc/qUtil.h b/src/query/inc/qUtil.h index 9b818b367f..8aa3168efb 100644 --- a/src/query/inc/qUtil.h +++ b/src/query/inc/qUtil.h @@ -32,14 +32,31 @@ int32_t numOfClosedTimeWindow(SWindowResInfo* pWindowResInfo); void closeTimeWindow(SWindowResInfo* pWindowResInfo, int32_t slot); void closeAllTimeWindow(SWindowResInfo* pWindowResInfo); void removeRedundantWindow(SWindowResInfo *pWindowResInfo, TSKEY lastKey, int32_t order); -SWindowResult *getWindowResult(SWindowResInfo *pWindowResInfo, int32_t slot); + +static FORCE_INLINE SWindowResult *getWindowResult(SWindowResInfo *pWindowResInfo, int32_t slot) { + assert(pWindowResInfo != NULL && slot >= 0 && slot < pWindowResInfo->size); + return &pWindowResInfo->pResult[slot]; +} #define curTimeWindow(_winres) ((_winres)->curIndex) +#define GET_ROW_PARAM_FOR_MULTIOUTPUT(_q, tbq, sq) (((tbq) && (!sq))? (_q)->pSelectExpr[1].base.arg->argValue.i64:1) + bool isWindowResClosed(SWindowResInfo *pWindowResInfo, int32_t slot); -void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, SPosInfo *posInfo, size_t interBufSize); +void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, size_t interBufSize); -char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult); +//char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult); + +static FORCE_INLINE char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult) { + assert(pResult != NULL && pRuntimeEnv != NULL); + + SQuery *pQuery = pRuntimeEnv->pQuery; + tFilePage *page = GET_RES_BUF_PAGE_BY_ID(pRuntimeEnv->pResultBuf, pResult->pos.pageId); + int32_t realRowId = pResult->pos.rowId * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, pRuntimeEnv->topBotQuery, pRuntimeEnv->stableQuery); + + return ((char *)page->data) + pRuntimeEnv->offset[columnIndex] * pRuntimeEnv->numOfRowsPerPage + + pQuery->pSelectExpr[columnIndex].bytes * realRowId; +} __filter_func_t *getRangeFilterFuncArray(int32_t type); __filter_func_t *getValueFilterFuncArray(int32_t type); diff --git a/src/query/inc/tsqlfunction.h b/src/query/inc/tsqlfunction.h index e57cb26456..c687f01cbc 100644 --- a/src/query/inc/tsqlfunction.h +++ b/src/query/inc/tsqlfunction.h @@ -132,13 +132,10 @@ typedef struct SQLPreAggVal { typedef struct SInterpInfoDetail { TSKEY ts; // interp specified timestamp - int8_t hasResult; int8_t type; int8_t primaryCol; } SInterpInfoDetail; -typedef struct SInterpInfo { SInterpInfoDetail *pInterpDetail; } SInterpInfo; - typedef struct SResultInfo { int8_t hasResult; // result generated, not NULL value bool initialized; // output buffer has been initialized @@ -146,7 +143,7 @@ typedef struct SResultInfo { bool superTableQ; // is super table query int32_t numOfRes; // num of output result in current buffer int32_t bufLen; // buffer size - void * interResultBuf; // output result buffer + void* interResultBuf; // output result buffer } SResultInfo; struct SQLFunctionCtx; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index db71f64083..82cd4f4286 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -361,10 +361,6 @@ static bool hasTagValOutput(SQuery* pQuery) { * @return */ static bool hasNullValue(SColIndex* pColIndex, SDataStatis *pStatis, SDataStatis **pColStatis) { - if (TSDB_COL_IS_TAG(pColIndex->flag) || pColIndex->colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) { - return false; - } - if (pStatis != NULL) { *pColStatis = &pStatis[pColIndex->colIndex]; assert((*pColStatis)->colId == pColIndex->colId); @@ -372,6 +368,10 @@ static bool hasNullValue(SColIndex* pColIndex, SDataStatis *pStatis, SDataStatis *pColStatis = NULL; } + if (TSDB_COL_IS_TAG(pColIndex->flag) || pColIndex->colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) { + return false; + } + if ((*pColStatis) != NULL && (*pColStatis)->numOfNull == 0) { return false; } @@ -387,31 +387,33 @@ static SWindowResult *doSetTimeWindowFromKey(SQueryRuntimeEnv *pRuntimeEnv, SWin if (p1 != NULL) { pWindowResInfo->curIndex = *p1; } else { - if (masterscan) { // more than the capacity, reallocate the resources - if (pWindowResInfo->size >= pWindowResInfo->capacity) { - int64_t newCap = pWindowResInfo->capacity * 2; - - char *t = realloc(pWindowResInfo->pResult, newCap * sizeof(SWindowResult)); - if (t != NULL) { - pWindowResInfo->pResult = (SWindowResult *)t; - memset(&pWindowResInfo->pResult[pWindowResInfo->capacity], 0, sizeof(SWindowResult) * pWindowResInfo->capacity); - } else { - // todo - } - - for (int32_t i = pWindowResInfo->capacity; i < newCap; ++i) { - SPosInfo pos = {-1, -1}; - createQueryResultInfo(pQuery, &pWindowResInfo->pResult[i], pRuntimeEnv->stableQuery, &pos, pRuntimeEnv->interBufSize); - } - pWindowResInfo->capacity = newCap; - } - - // add a new result set for a new group - pWindowResInfo->curIndex = pWindowResInfo->size++; - taosHashPut(pWindowResInfo->hashList, pData, bytes, (char *)&pWindowResInfo->curIndex, sizeof(int32_t)); - } else { + if (!masterscan) { // not master scan, do not add new timewindow return NULL; } + + // more than the capacity, reallocate the resources + if (pWindowResInfo->size >= pWindowResInfo->capacity) { + int64_t newCap = pWindowResInfo->capacity * 1.5; + char *t = realloc(pWindowResInfo->pResult, newCap * sizeof(SWindowResult)); + if (t != NULL) { + pWindowResInfo->pResult = (SWindowResult *)t; + + int32_t inc = newCap - pWindowResInfo->capacity; + memset(&pWindowResInfo->pResult[pWindowResInfo->capacity], 0, sizeof(SWindowResult) * inc); + } else { + // todo + } + + for (int32_t i = pWindowResInfo->capacity; i < newCap; ++i) { + createQueryResultInfo(pQuery, &pWindowResInfo->pResult[i], pRuntimeEnv->stableQuery, pRuntimeEnv->interBufSize); + } + + pWindowResInfo->capacity = newCap; + } + + // add a new result set for a new group + pWindowResInfo->curIndex = pWindowResInfo->size++; + taosHashPut(pWindowResInfo->hashList, pData, bytes, (char *)&pWindowResInfo->curIndex, sizeof(int32_t)); } return getWindowResult(pWindowResInfo, pWindowResInfo->curIndex); @@ -511,10 +513,11 @@ static int32_t setWindowOutputBufByKey(SQueryRuntimeEnv *pRuntimeEnv, SWindowRes } *newWind = true; + // not assign result buffer yet, add new result buffer if (pWindowRes->pos.pageId == -1) { int32_t ret = addNewWindowResultBuf(pWindowRes, pResultBuf, sid, pRuntimeEnv->numOfRowsPerPage); - if (ret != 0) { + if (ret != TSDB_CODE_SUCCESS) { return -1; } } @@ -531,7 +534,7 @@ static SWindowStatus *getTimeWindowResStatus(SWindowResInfo *pWindowResInfo, int return &pWindowResInfo->pResult[slot].status; } -static int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey, int16_t pos, +static FORCE_INLINE int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey, int16_t pos, int16_t order, int64_t *pData) { int32_t forwardStep = 0; @@ -647,12 +650,8 @@ static int32_t getNumOfRowsInTimeWindow(SQuery *pQuery, SDataBlockInfo *pDataBlo if (QUERY_IS_ASC_QUERY(pQuery)) { if (ekey < pDataBlockInfo->window.ekey) { num = getForwardStepsInBlock(pDataBlockInfo->rows, searchFn, ekey, startPos, order, pPrimaryColumn); - if (num == 0) { // no qualified data in current block, do not update the lastKey value - assert(ekey < pPrimaryColumn[startPos]); - } else { - if (updateLastKey) { - item->lastKey = pPrimaryColumn[startPos + (num - 1)] + step; - } + if (updateLastKey) { // update the last key + item->lastKey = pPrimaryColumn[startPos + (num - 1)] + step; } } else { num = pDataBlockInfo->rows - startPos; @@ -663,12 +662,8 @@ static int32_t getNumOfRowsInTimeWindow(SQuery *pQuery, SDataBlockInfo *pDataBlo } else { // desc if (ekey > pDataBlockInfo->window.skey) { num = getForwardStepsInBlock(pDataBlockInfo->rows, searchFn, ekey, startPos, order, pPrimaryColumn); - if (num == 0) { // no qualified data in current block, do not update the lastKey value - assert(ekey > pPrimaryColumn[startPos]); - } else { - if (updateLastKey) { - item->lastKey = pPrimaryColumn[startPos - (num - 1)] + step; - } + if (updateLastKey) { // update the last key + item->lastKey = pPrimaryColumn[startPos - (num - 1)] + step; } } else { num = startPos + 1; @@ -912,13 +907,20 @@ static void blockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis * } int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order); - if (QUERY_IS_INTERVAL_QUERY(pQuery) && tsCols != NULL) { - int32_t offset = GET_COL_DATA_POS(pQuery, 0, step); - TSKEY ts = tsCols[offset]; + if (QUERY_IS_INTERVAL_QUERY(pQuery)/* && tsCols != NULL*/) { + TSKEY ts = TSKEY_INITIAL_VAL; - bool hasTimeWindow = false; + if (tsCols == NULL) { + ts = QUERY_IS_ASC_QUERY(pQuery)? pDataBlockInfo->window.skey:pDataBlockInfo->window.ekey; + } else { + int32_t offset = GET_COL_DATA_POS(pQuery, 0, step); + ts = tsCols[offset]; + } + + bool hasTimeWindow = false; STimeWindow win = getActiveTimeWindow(pWindowResInfo, ts, pQuery); - if (setWindowOutputBufByKey(pRuntimeEnv, pWindowResInfo, pDataBlockInfo->tid, &win, masterScan, &hasTimeWindow) != TSDB_CODE_SUCCESS) { + if (setWindowOutputBufByKey(pRuntimeEnv, pWindowResInfo, pDataBlockInfo->tid, &win, masterScan, &hasTimeWindow) != + TSDB_CODE_SUCCESS) { tfree(sasArray); return; } @@ -927,7 +929,7 @@ static void blockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis * int32_t startPos = pQuery->pos; if (hasTimeWindow) { - TSKEY ekey = reviseWindowEkey(pQuery, &win); + TSKEY ekey = reviseWindowEkey(pQuery, &win); forwardStep = getNumOfRowsInTimeWindow(pQuery, pDataBlockInfo, tsCols, pQuery->pos, ekey, searchFn, true); SWindowStatus *pStatus = getTimeWindowResStatus(pWindowResInfo, curTimeWindow(pWindowResInfo)); @@ -946,7 +948,8 @@ static void blockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis * // null data, failed to allocate more memory buffer hasTimeWindow = false; - if (setWindowOutputBufByKey(pRuntimeEnv, pWindowResInfo, pDataBlockInfo->tid, &nextWin, masterScan, &hasTimeWindow) != TSDB_CODE_SUCCESS) { + if (setWindowOutputBufByKey(pRuntimeEnv, pWindowResInfo, pDataBlockInfo->tid, &nextWin, masterScan, + &hasTimeWindow) != TSDB_CODE_SUCCESS) { break; } @@ -957,7 +960,7 @@ static void blockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis * TSKEY ekey = reviseWindowEkey(pQuery, &nextWin); forwardStep = getNumOfRowsInTimeWindow(pQuery, pDataBlockInfo, tsCols, startPos, ekey, searchFn, true); - SWindowStatus* pStatus = getTimeWindowResStatus(pWindowResInfo, curTimeWindow(pWindowResInfo)); + SWindowStatus *pStatus = getTimeWindowResStatus(pWindowResInfo, curTimeWindow(pWindowResInfo)); doBlockwiseApplyFunctions(pRuntimeEnv, pStatus, &nextWin, startPos, forwardStep, tsCols, pDataBlockInfo->rows); } @@ -1478,7 +1481,9 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int16_t order qDebug("QInfo:%p setup runtime env", GET_QINFO_ADDR(pRuntimeEnv)); SQuery *pQuery = pRuntimeEnv->pQuery; - pRuntimeEnv->resultInfo = calloc(pQuery->numOfOutput, sizeof(SResultInfo)); + size_t size = pRuntimeEnv->interBufSize + pQuery->numOfOutput * sizeof(SResultInfo); + + pRuntimeEnv->resultInfo = calloc(1, size); pRuntimeEnv->pCtx = (SQLFunctionCtx *)calloc(pQuery->numOfOutput, sizeof(SQLFunctionCtx)); if (pRuntimeEnv->resultInfo == NULL || pRuntimeEnv->pCtx == NULL) { @@ -1549,7 +1554,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int16_t order } } - char* buf = calloc(1, pRuntimeEnv->interBufSize); + char* buf = (char*) pRuntimeEnv->resultInfo + sizeof(SResultInfo) * pQuery->numOfOutput; // set the intermediate result output buffer setWindowResultInfo(pRuntimeEnv->resultInfo, pQuery, pRuntimeEnv->stableQuery, buf); @@ -1592,7 +1597,6 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { tfree(pCtx->tagInfo.pTagCtxList); } - tfree(pRuntimeEnv->resultInfo[0].interResultBuf); tfree(pRuntimeEnv->resultInfo); tfree(pRuntimeEnv->pCtx); } @@ -1608,7 +1612,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { #define IS_QUERY_KILLED(_q) ((_q)->code == TSDB_CODE_TSC_QUERY_CANCELLED) -static void setQueryKilled(SQInfo *pQInfo) { pQInfo->code = TSDB_CODE_TSC_QUERY_CANCELLED; } +static void setQueryKilled(SQInfo *pQInfo) { pQInfo->code = TSDB_CODE_TSC_QUERY_CANCELLED;} static bool isFixedOutputQuery(SQueryRuntimeEnv* pRuntimeEnv) { SQuery* pQuery = pRuntimeEnv->pQuery; @@ -1912,23 +1916,21 @@ static int32_t getInitialPageNum(SQInfo *pQInfo) { return num; } -#define GET_ROW_PARAM_FOR_MULTIOUTPUT(_q, tbq, sq) (((tbq) && (!sq))? (_q)->pSelectExpr[1].base.arg->argValue.i64:1) - static FORCE_INLINE int32_t getNumOfRowsInResultPage(SQuery *pQuery, bool topBotQuery, bool isSTableQuery) { int32_t rowSize = pQuery->rowSize * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, topBotQuery, isSTableQuery); return (DEFAULT_INTERN_BUF_PAGE_SIZE - sizeof(tFilePage)) / rowSize; } -char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult) { - assert(pResult != NULL && pRuntimeEnv != NULL); - - SQuery *pQuery = pRuntimeEnv->pQuery; - tFilePage *page = GET_RES_BUF_PAGE_BY_ID(pRuntimeEnv->pResultBuf, pResult->pos.pageId); - int32_t realRowId = pResult->pos.rowId * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, pRuntimeEnv->topBotQuery, pRuntimeEnv->stableQuery); - - return ((char *)page->data) + pRuntimeEnv->offset[columnIndex] * pRuntimeEnv->numOfRowsPerPage + - pQuery->pSelectExpr[columnIndex].bytes * realRowId; -} +//char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int32_t columnIndex, SWindowResult *pResult) { +// assert(pResult != NULL && pRuntimeEnv != NULL); +// +// SQuery *pQuery = pRuntimeEnv->pQuery; +// tFilePage *page = GET_RES_BUF_PAGE_BY_ID(pRuntimeEnv->pResultBuf, pResult->pos.pageId); +// int32_t realRowId = pResult->pos.rowId * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, pRuntimeEnv->topBotQuery, pRuntimeEnv->stableQuery); +// +// return ((char *)page->data) + pRuntimeEnv->offset[columnIndex] * pRuntimeEnv->numOfRowsPerPage + +// pQuery->pSelectExpr[columnIndex].bytes * realRowId; +//} #define IS_PREFILTER_TYPE(_t) ((_t) != TSDB_DATA_TYPE_BINARY && (_t) != TSDB_DATA_TYPE_NCHAR) @@ -1997,23 +1999,80 @@ static bool needToLoadDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SDataStatis *pDat return false; } +#define PT_IN_WINDOW(_p, _w) ((_p) > (_w).skey && (_p) < (_w).ekey) + +static bool overlapWithTimeWindow(SQuery* pQuery, SDataBlockInfo* pBlockInfo) { + STimeWindow w = {0}; + + TSKEY sk = MIN(pQuery->window.skey, pQuery->window.ekey); + TSKEY ek = MAX(pQuery->window.skey, pQuery->window.ekey); + + + if (QUERY_IS_ASC_QUERY(pQuery)) { + getAlignQueryTimeWindow(pQuery, pBlockInfo->window.skey, sk, ek, &w); + + if (PT_IN_WINDOW(w.ekey, pBlockInfo->window)) { + return true; + } + + while(1) { + GET_NEXT_TIMEWINDOW(pQuery, &w); + if (w.skey > pBlockInfo->window.skey) { + break; + } + + if (PT_IN_WINDOW(w.skey, pBlockInfo->window) || PT_IN_WINDOW(w.ekey, pBlockInfo->window)) { + return true; + } + } + } else { + getAlignQueryTimeWindow(pQuery, pBlockInfo->window.ekey, sk, ek, &w); + if (PT_IN_WINDOW(w.skey, pBlockInfo->window)) { + return true; + } + + while(1) { + GET_NEXT_TIMEWINDOW(pQuery, &w); + if (w.ekey < pBlockInfo->window.skey) { + break; + } + + if (PT_IN_WINDOW(w.skey, pBlockInfo->window) || PT_IN_WINDOW(w.ekey, pBlockInfo->window)) { + return true; + } + } + } + + return false; +} + int32_t loadDataBlockOnDemand(SQueryRuntimeEnv *pRuntimeEnv, void* pQueryHandle, SDataBlockInfo* pBlockInfo, SDataStatis **pStatis, SArray** pDataBlock) { SQuery *pQuery = pRuntimeEnv->pQuery; uint32_t status = 0; - if (pQuery->numOfFilterCols > 0) { + if (pQuery->numOfFilterCols > 0 || pRuntimeEnv->pTSBuf > 0) { status = BLK_DATA_ALL_NEEDED; } else { // check if this data block is required to load - for (int32_t i = 0; i < pQuery->numOfOutput; ++i) { - SSqlFuncMsg* pSqlFunc = &pQuery->pSelectExpr[i].base; - int32_t functionId = pSqlFunc->functionId; - int32_t colId = pSqlFunc->colInfo.colId; - status |= aAggs[functionId].dataReqFunc(&pRuntimeEnv->pCtx[i], pBlockInfo->window.skey, pBlockInfo->window.ekey, colId); + // Calculate all time windows that are overlapping or contain current data block. + // If current data block is contained by all possible time window, loading current + // data block is not needed. + if (QUERY_IS_INTERVAL_QUERY(pQuery) && overlapWithTimeWindow(pQuery, pBlockInfo)) { + status = BLK_DATA_ALL_NEEDED; } - if (pRuntimeEnv->pTSBuf > 0 || QUERY_IS_INTERVAL_QUERY(pQuery)) { - status |= BLK_DATA_ALL_NEEDED; + if (status != BLK_DATA_ALL_NEEDED) { + for (int32_t i = 0; i < pQuery->numOfOutput; ++i) { + SSqlFuncMsg* pSqlFunc = &pQuery->pSelectExpr[i].base; + + int32_t functionId = pSqlFunc->functionId; + int32_t colId = pSqlFunc->colInfo.colId; + + status |= aAggs[functionId].dataReqFunc(&pRuntimeEnv->pCtx[i], pBlockInfo->window.skey, pBlockInfo->window.ekey, colId); + if ((status & BLK_DATA_ALL_NEEDED) != 0) { + break; + } + } } } @@ -2954,13 +3013,14 @@ void switchCtxOrder(SQueryRuntimeEnv *pRuntimeEnv) { } } -void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, SPosInfo *posInfo, size_t interBufSize) { +void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, size_t interBufSize) { int32_t numOfCols = pQuery->numOfOutput; - pResultRow->resultInfo = calloc((size_t)numOfCols, sizeof(SResultInfo)); - pResultRow->pos = *posInfo; + size_t size = numOfCols * sizeof(SResultInfo) + interBufSize; + pResultRow->resultInfo = calloc(1, size); + pResultRow->pos = (SPosInfo) {-1, -1}; - char* buf = calloc(1, interBufSize); + char* buf = (char*) pResultRow->resultInfo + numOfCols * sizeof(SResultInfo); // set the intermediate result output buffer setWindowResultInfo(pResultRow->resultInfo, pQuery, isSTableQuery, buf); @@ -4263,7 +4323,6 @@ static int64_t scanMultiTableDataBlocks(SQInfo *pQInfo) { SDataStatis *pStatis = NULL; SArray *pDataBlock = NULL; - if (loadDataBlockOnDemand(pRuntimeEnv, pQueryHandle, &blockInfo, &pStatis, &pDataBlock) == BLK_DATA_DISCARD) { pQuery->current->lastKey = QUERY_IS_ASC_QUERY(pQuery)? blockInfo.window.ekey + step:blockInfo.window.skey + step; continue; diff --git a/src/query/src/qUtil.c b/src/query/src/qUtil.c index dce2c24ea0..8bb1233a49 100644 --- a/src/query/src/qUtil.c +++ b/src/query/src/qUtil.c @@ -51,19 +51,17 @@ int32_t initWindowResInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRun // use the pointer arraylist pWindowResInfo->pResult = calloc(threshold, sizeof(SWindowResult)); for (int32_t i = 0; i < pWindowResInfo->capacity; ++i) { - SPosInfo posInfo = {-1, -1}; - createQueryResultInfo(pRuntimeEnv->pQuery, &pWindowResInfo->pResult[i], pRuntimeEnv->stableQuery, &posInfo, pRuntimeEnv->interBufSize); + createQueryResultInfo(pRuntimeEnv->pQuery, &pWindowResInfo->pResult[i], pRuntimeEnv->stableQuery, pRuntimeEnv->interBufSize); } return TSDB_CODE_SUCCESS; } -void destroyTimeWindowRes(SWindowResult *pWindowRes, int32_t nOutputCols) { +void destroyTimeWindowRes(SWindowResult *pWindowRes) { if (pWindowRes == NULL) { return; } - free(pWindowRes->resultInfo[0].interResultBuf); free(pWindowRes->resultInfo); } @@ -78,7 +76,7 @@ void cleanupTimeWindowInfo(SWindowResInfo *pWindowResInfo, int32_t numOfCols) { for (int32_t i = 0; i < pWindowResInfo->capacity; ++i) { SWindowResult *pResult = &pWindowResInfo->pResult[i]; - destroyTimeWindowRes(pResult, numOfCols); + destroyTimeWindowRes(pResult); } taosHashCleanup(pWindowResInfo->hashList); @@ -217,11 +215,6 @@ void removeRedundantWindow(SWindowResInfo *pWindowResInfo, TSKEY lastKey, int32_ } } -SWindowResult *getWindowResult(SWindowResInfo *pWindowResInfo, int32_t slot) { - assert(pWindowResInfo != NULL && slot >= 0 && slot < pWindowResInfo->size); - return &pWindowResInfo->pResult[slot]; -} - bool isWindowResClosed(SWindowResInfo *pWindowResInfo, int32_t slot) { return (getWindowResult(pWindowResInfo, slot)->status.closed == true); } diff --git a/src/query/src/qresultBuf.c b/src/query/src/qresultBuf.c index f63f072b0b..fe079694f7 100644 --- a/src/query/src/qresultBuf.c +++ b/src/query/src/qresultBuf.c @@ -86,7 +86,7 @@ static int32_t extendDiskFileSize(SDiskbasedResultBuf* pResultBuf, int32_t numOf return TSDB_CODE_SUCCESS; } -static bool noMoreAvailablePages(SDiskbasedResultBuf* pResultBuf) { +static FORCE_INLINE bool noMoreAvailablePages(SDiskbasedResultBuf* pResultBuf) { return (pResultBuf->allocateId == pResultBuf->numOfPages - 1); } diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 3311a0f13c..2fca34cd0a 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -603,6 +603,8 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo tdInitDataCols(pQueryHandle->rhelper.pDataCols[0], pSchema); tdInitDataCols(pQueryHandle->rhelper.pDataCols[1], pSchema); +// int16_t* colIds = pQueryHandle->defaultLoadColumn->pData; +// int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, QH_GET_NUM_OF_COLS(pQueryHandle)); if (tsdbLoadBlockData(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo) == 0) { SDataBlockLoadInfo* pBlockLoadInfo = &pQueryHandle->dataBlockLoadInfo; @@ -1361,7 +1363,6 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO return TSDB_CODE_SUCCESS; } -// todo opt for only one table case static int32_t getDataBlocksInFilesImpl(STsdbQueryHandle* pQueryHandle, bool* exists) { pQueryHandle->numOfBlocks = 0; SQueryFilePos* cur = &pQueryHandle->cur; From d5e0bfc42eeb3d8ad7595bc7e0d2a2498304fa0b Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 14 Jul 2020 22:58:37 +0800 Subject: [PATCH 02/30] [td-225] fix invalid write in tbname query --- src/query/src/qast.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/query/src/qast.c b/src/query/src/qast.c index ffd339f111..03504a4244 100644 --- a/src/query/src/qast.c +++ b/src/query/src/qast.c @@ -1062,10 +1062,9 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) { if (*e == TS_PATH_DELIMITER[0]) { cond = e + 1; } else if (*e == ',') { - size_t len = e - cond + VARSTR_HEADER_SIZE; - char* p = exception_malloc(len); - varDataSetLen(p, len - VARSTR_HEADER_SIZE); - memcpy(varDataVal(p), cond, len); + size_t len = e - cond; + char* p = exception_malloc(len + VARSTR_HEADER_SIZE); + STR_WITH_SIZE_TO_VARSTR(p, cond, len); cond += len; taosArrayPush(pVal->arr, &p); } From 4cb2dc53f37a66d5993e0e2e100a63cb665658ac Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 15 Jul 2020 11:11:30 +0800 Subject: [PATCH 03/30] [td-805] opt query perf --- src/client/src/tscFunctionImpl.c | 17 ++----- src/query/inc/qresultBuf.h | 30 ++++++------ src/query/src/qExecutor.c | 25 +++++----- src/query/src/qresultBuf.c | 80 +++++++++----------------------- src/tsdb/src/tsdbRead.c | 36 ++++++++++---- 5 files changed, 78 insertions(+), 110 deletions(-) diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 1ec84f023a..8e81462257 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -1481,7 +1481,7 @@ static bool first_last_function_setup(SQLFunctionCtx *pCtx) { // todo opt for null block static void first_function(SQLFunctionCtx *pCtx) { - if (pCtx->order == TSDB_ORDER_DESC) { + if (pCtx->order == TSDB_ORDER_DESC || pCtx->preAggVals.dataBlockLoaded == false) { return; } @@ -1550,28 +1550,17 @@ static void first_data_assign_impl(SQLFunctionCtx *pCtx, char *pData, int32_t in * to decide if the value is earlier than current intermediate result */ static void first_dist_function(SQLFunctionCtx *pCtx) { - assert(pCtx->size > 0); - - if (pCtx->size == 0) { - return; - } - /* * do not to check data in the following cases: * 1. data block that are not loaded * 2. scan data files in desc order */ - if (pCtx->order == TSDB_ORDER_DESC) { + if (pCtx->order == TSDB_ORDER_DESC || pCtx->preAggVals.dataBlockLoaded == false) { return; } int32_t notNullElems = 0; - // data block is discard, not loaded, do not need to check it - if (!pCtx->preAggVals.dataBlockLoaded) { - return; - } - // find the first not null value for (int32_t i = 0; i < pCtx->size; ++i) { char *data = GET_INPUT_CHAR_INDEX(pCtx, i); @@ -1655,7 +1644,7 @@ static void first_dist_func_second_merge(SQLFunctionCtx *pCtx) { * least one data in this block that is not null.(TODO opt for this case) */ static void last_function(SQLFunctionCtx *pCtx) { - if (pCtx->order != pCtx->param[0].i64Key) { + if (pCtx->order != pCtx->param[0].i64Key || pCtx->preAggVals.dataBlockLoaded == false) { return; } diff --git a/src/query/inc/qresultBuf.h b/src/query/inc/qresultBuf.h index ad01555c28..a323d530a2 100644 --- a/src/query/inc/qresultBuf.h +++ b/src/query/inc/qresultBuf.h @@ -22,26 +22,22 @@ extern "C" { #include "os.h" #include "qextbuffer.h" +#include "hash.h" -typedef struct SIDList { - uint32_t alloc; - int32_t size; - int32_t* pData; -} SIDList; +typedef struct SArray* SIDList; typedef struct SDiskbasedResultBuf { - int32_t numOfRowsPerPage; - int32_t numOfPages; - int64_t totalBufSize; - int32_t fd; // data file fd - int32_t allocateId; // allocated page id - int32_t incStep; // minimum allocated pages - char* pBuf; // mmap buffer pointer - char* path; // file path + int32_t numOfRowsPerPage; + int32_t numOfPages; + int64_t totalBufSize; + int32_t fd; // data file fd + int32_t allocateId; // allocated page id + int32_t incStep; // minimum allocated pages + char* pBuf; // mmap buffer pointer + char* path; // file path - uint32_t numOfAllocGroupIds; // number of allocated id list - void* idsTable; // id hash table - SIDList* list; // for each id, there is a page id list + SHashObj* idsTable; // id hash table + SIDList list; // for each id, there is a page id list } SDiskbasedResultBuf; #define DEFAULT_INTERN_BUF_PAGE_SIZE (8192L*5) @@ -112,7 +108,7 @@ void destroyResultBuf(SDiskbasedResultBuf* pResultBuf, void* handle); * @param pList * @return */ -int32_t getLastPageId(SIDList *pList); +int32_t getLastPageId(SIDList pList); #ifdef __cplusplus } diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 82cd4f4286..d1349bd221 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -361,7 +361,7 @@ static bool hasTagValOutput(SQuery* pQuery) { * @return */ static bool hasNullValue(SColIndex* pColIndex, SDataStatis *pStatis, SDataStatis **pColStatis) { - if (pStatis != NULL) { + if (pStatis != NULL && !TSDB_COL_IS_TAG(pColIndex->flag)) { *pColStatis = &pStatis[pColIndex->colIndex]; assert((*pColStatis)->colId == pColIndex->colId); } else { @@ -472,10 +472,10 @@ static int32_t addNewWindowResultBuf(SWindowResult *pWindowRes, SDiskbasedResult int32_t pageId = -1; SIDList list = getDataBufPagesIdList(pResultBuf, sid); - if (list.size == 0) { + if (taosArrayGetSize(list) == 0) { pData = getNewDataBuf(pResultBuf, sid, &pageId); } else { - pageId = getLastPageId(&list); + pageId = getLastPageId(list); pData = GET_RES_BUF_PAGE_BY_ID(pResultBuf, pageId); if (pData->num >= numOfRowsPerPage) { @@ -2069,7 +2069,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv *pRuntimeEnv, void* pQueryHandle, int32_t colId = pSqlFunc->colInfo.colId; status |= aAggs[functionId].dataReqFunc(&pRuntimeEnv->pCtx[i], pBlockInfo->window.skey, pBlockInfo->window.ekey, colId); - if ((status & BLK_DATA_ALL_NEEDED) != 0) { + if ((status & BLK_DATA_ALL_NEEDED) == BLK_DATA_ALL_NEEDED) { break; } } @@ -2670,16 +2670,19 @@ void copyResToQueryResultBuf(SQInfo *pQInfo, SQuery *pQuery) { SIDList list = getDataBufPagesIdList(pResultBuf, pQInfo->offset + id); int32_t total = 0; - for (int32_t i = 0; i < list.size; ++i) { - tFilePage *pData = GET_RES_BUF_PAGE_BY_ID(pResultBuf, list.pData[i]); + int32_t size = taosArrayGetSize(list); + for (int32_t i = 0; i < size; ++i) { + int32_t* pgId = taosArrayGet(list, i); + tFilePage *pData = GET_RES_BUF_PAGE_BY_ID(pResultBuf, *pgId); total += pData->num; } int32_t rows = total; int32_t offset = 0; - for (int32_t num = 0; num < list.size; ++num) { - tFilePage *pData = GET_RES_BUF_PAGE_BY_ID(pResultBuf, list.pData[num]); + for (int32_t j = 0; j < size; ++j) { + int32_t* pgId = taosArrayGet(list, j); + tFilePage *pData = GET_RES_BUF_PAGE_BY_ID(pResultBuf, *pgId); for (int32_t i = 0; i < pQuery->numOfOutput; ++i) { int32_t bytes = pRuntimeEnv->pCtx[i].outputBytes; @@ -2745,7 +2748,7 @@ int32_t mergeIntoGroupResultImpl(SQInfo *pQInfo, SArray *pGroup) { STableQueryInfo *item = taosArrayGetP(pGroup, i); SIDList list = getDataBufPagesIdList(pRuntimeEnv->pResultBuf, TSDB_TABLEID(item->pTable)->tid); - if (list.size > 0 && item->windowResInfo.size > 0) { + if (taosArrayGetSize(list) > 0 && item->windowResInfo.size > 0) { pTableList[numOfTables] = item; numOfTables += 1; } @@ -4208,14 +4211,14 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo pRuntimeEnv->numOfRowsPerPage = getNumOfRowsInResultPage(pQuery, pRuntimeEnv->topBotQuery, isSTableQuery); - if (isSTableQuery) { + if (isSTableQuery && !onlyQueryTags(pRuntimeEnv->pQuery)) { int32_t rows = getInitialPageNum(pQInfo); code = createDiskbasedResultBuffer(&pRuntimeEnv->pResultBuf, rows, pQuery->rowSize, pQInfo); if (code != TSDB_CODE_SUCCESS) { return code; } - if (pQuery->intervalTime == 0) { + if (!QUERY_IS_INTERVAL_QUERY(pQuery)) { int16_t type = TSDB_DATA_TYPE_NULL; if (pRuntimeEnv->groupbyNormalCol) { // group by columns not tags; diff --git a/src/query/src/qresultBuf.c b/src/query/src/qresultBuf.c index fe079694f7..6175008ef6 100644 --- a/src/query/src/qresultBuf.c +++ b/src/query/src/qresultBuf.c @@ -2,7 +2,6 @@ #include "hash.h" #include "qextbuffer.h" #include "taoserror.h" -#include "tsqlfunction.h" #include "queryLog.h" int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t size, int32_t rowSize, void* handle) { @@ -20,11 +19,10 @@ int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t si // init id hash table pResBuf->idsTable = taosHashInit(size, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false); - pResBuf->list = calloc(size, sizeof(SIDList)); - pResBuf->numOfAllocGroupIds = size; + pResBuf->list = taosArrayInit(size, POINTER_BYTES); char path[4096] = {0}; - getTmpfilePath("tsdb_q_buf", path); + getTmpfilePath("tsdb_qbuf", path); pResBuf->path = strdup(path); pResBuf->fd = open(pResBuf->path, O_CREAT | O_RDWR, 0666); @@ -48,7 +46,7 @@ int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t si return TSDB_CODE_QRY_OUT_OF_MEMORY; // todo change error code } - qDebug("QInfo:%p create tmp file for output result, %s, %" PRId64 "bytes", handle, pResBuf->path, + qDebug("QInfo:%p create tmp file for output result: %s, %" PRId64 "bytes", handle, pResBuf->path, pResBuf->totalBufSize); return TSDB_CODE_SUCCESS; @@ -90,7 +88,7 @@ static FORCE_INLINE bool noMoreAvailablePages(SDiskbasedResultBuf* pResultBuf) { return (pResultBuf->allocateId == pResultBuf->numOfPages - 1); } -static int32_t getGroupIndex(SDiskbasedResultBuf* pResultBuf, int32_t groupId) { +static FORCE_INLINE int32_t getGroupIndex(SDiskbasedResultBuf* pResultBuf, int32_t groupId) { assert(pResultBuf != NULL); char* p = taosHashGet(pResultBuf->idsTable, (const char*)&groupId, sizeof(int32_t)); @@ -99,61 +97,30 @@ static int32_t getGroupIndex(SDiskbasedResultBuf* pResultBuf, int32_t groupId) { } int32_t slot = GET_INT32_VAL(p); - assert(slot >= 0 && slot < pResultBuf->numOfAllocGroupIds); + assert(slot >= 0 && slot < taosHashGetSize(pResultBuf->idsTable)); return slot; } static int32_t addNewGroupId(SDiskbasedResultBuf* pResultBuf, int32_t groupId) { int32_t num = getNumOfResultBufGroupId(pResultBuf); // the num is the newest allocated group id slot - - if (pResultBuf->numOfAllocGroupIds <= num) { - size_t n = pResultBuf->numOfAllocGroupIds << 1u; - - SIDList* p = (SIDList*)realloc(pResultBuf->list, sizeof(SIDList) * n); - assert(p != NULL); - - memset(&p[pResultBuf->numOfAllocGroupIds], 0, sizeof(SIDList) * pResultBuf->numOfAllocGroupIds); - - pResultBuf->list = p; - pResultBuf->numOfAllocGroupIds = n; - } - taosHashPut(pResultBuf->idsTable, (const char*)&groupId, sizeof(int32_t), &num, sizeof(int32_t)); + + SArray* pa = taosArrayInit(1, sizeof(int32_t)); + taosArrayPush(pResultBuf->list, &pa); + + assert(taosArrayGetSize(pResultBuf->list) == taosHashGetSize(pResultBuf->idsTable)); return num; } -static int32_t doRegisterId(SIDList* pList, int32_t id) { - if (pList->size >= pList->alloc) { - int32_t s = 0; - if (pList->alloc == 0) { - s = 4; - assert(pList->pData == NULL); - } else { - s = pList->alloc << 1u; - } - - int32_t* c = realloc(pList->pData, s * sizeof(int32_t)); - assert(c); - - memset(&c[pList->alloc], 0, sizeof(int32_t) * pList->alloc); - - pList->pData = c; - pList->alloc = s; - } - - pList->pData[pList->size++] = id; - return 0; -} - static void registerPageId(SDiskbasedResultBuf* pResultBuf, int32_t groupId, int32_t pageId) { int32_t slot = getGroupIndex(pResultBuf, groupId); if (slot < 0) { slot = addNewGroupId(pResultBuf, groupId); } - SIDList* pList = &pResultBuf->list[slot]; - doRegisterId(pList, pageId); + SIDList pList = taosArrayGetP(pResultBuf->list, slot); + taosArrayPush(pList, &pageId); } tFilePage* getNewDataBuf(SDiskbasedResultBuf* pResultBuf, int32_t groupId, int32_t* pageId) { @@ -178,12 +145,11 @@ tFilePage* getNewDataBuf(SDiskbasedResultBuf* pResultBuf, int32_t groupId, int32 int32_t getNumOfRowsPerPage(SDiskbasedResultBuf* pResultBuf) { return pResultBuf->numOfRowsPerPage; } SIDList getDataBufPagesIdList(SDiskbasedResultBuf* pResultBuf, int32_t groupId) { - SIDList list = {0}; int32_t slot = getGroupIndex(pResultBuf, groupId); if (slot < 0) { - return list; + return taosArrayInit(1, sizeof(int32_t)); } else { - return pResultBuf->list[slot]; + return taosArrayGetP(pResultBuf->list, slot); } } @@ -202,22 +168,20 @@ void destroyResultBuf(SDiskbasedResultBuf* pResultBuf, void* handle) { tfree(pResultBuf->path); - for (int32_t i = 0; i < pResultBuf->numOfAllocGroupIds; ++i) { - SIDList* pList = &pResultBuf->list[i]; - tfree(pList->pData); + size_t size = taosArrayGetSize(pResultBuf->list); + for (int32_t i = 0; i < size; ++i) { + SArray* pa = taosArrayGetP(pResultBuf->list, i); + taosArrayDestroy(pa); } - tfree(pResultBuf->list); + taosArrayDestroy(pResultBuf->list); taosHashCleanup(pResultBuf->idsTable); tfree(pResultBuf); } -int32_t getLastPageId(SIDList *pList) { - if (pList == NULL || pList->size <= 0) { - return -1; - } - - return pList->pData[pList->size - 1]; +int32_t getLastPageId(SIDList pList) { + size_t size = taosArrayGetSize(pList); + return *(int32_t*) taosArrayGet(pList, size - 1); } diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 2fca34cd0a..fee8784b88 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -90,6 +90,12 @@ typedef struct SBlockOrderSupporter { int32_t* numOfBlocksPerTable; } SBlockOrderSupporter; +typedef struct SIOCostSummary { + int64_t blockLoadTime; + int64_t statisInfoLoadTime; + int64_t blockMergeTime; +} SIOCostSummary; + typedef struct STsdbQueryHandle { STsdbRepo* pTsdb; SQueryFilePos cur; // current position @@ -116,6 +122,8 @@ typedef struct STsdbQueryHandle { SArray* defaultLoadColumn;// default load column SDataBlockLoadInfo dataBlockLoadInfo; /* record current block load information */ SLoadCompBlockInfo compBlockLoadInfo; /* record current compblock information in SQuery */ + + SIOCostSummary cost; } STsdbQueryHandle; static void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle); @@ -622,6 +630,8 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo tfree(data); int64_t et = taosGetTimestampUs() - st; + + pQueryHandle->cost.blockLoadTime += et; tsdbDebug("%p load file block into buffer, elapsed time:%"PRId64 " us", pQueryHandle, et); return blockLoaded; @@ -1784,23 +1794,22 @@ void tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle, SDataBlockInfo* p int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataStatis** pBlockStatis) { STsdbQueryHandle* pHandle = (STsdbQueryHandle*) pQueryHandle; - SQueryFilePos* cur = &pHandle->cur; - if (cur->mixBlock) { + SQueryFilePos* c = &pHandle->cur; + if (c->mixBlock) { *pBlockStatis = NULL; return TSDB_CODE_SUCCESS; } - assert((cur->slot >= 0 && cur->slot < pHandle->numOfBlocks) || - ((cur->slot == pHandle->numOfBlocks) && (cur->slot == 0))); - - STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[cur->slot]; - - // file block with subblocks has no statistics data + STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[c->slot]; + assert((c->slot >= 0 && c->slot < pHandle->numOfBlocks) || ((c->slot == pHandle->numOfBlocks) && (c->slot == 0))); + + // file block with sub-blocks has no statistics data if (pBlockInfo->compBlock->numOfSubBlocks > 1) { *pBlockStatis = NULL; return TSDB_CODE_SUCCESS; } - + + int64_t stime = taosGetTimestampUs(); tsdbLoadCompData(&pHandle->rhelper, pBlockInfo->compBlock, NULL); // todo opt perf @@ -1830,7 +1839,10 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta pHandle->statis[i].max = pBlockInfo->compBlock->keyLast; } } - + + int64_t elapsed = taosGetTimestampUs() - stime; + pHandle->cost.statisInfoLoadTime += elapsed; + return TSDB_CODE_SUCCESS; } @@ -2351,6 +2363,10 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) { tsdbUnRefMemTable(pQueryHandle->pTsdb, pQueryHandle->imem); tsdbDestroyHelper(&pQueryHandle->rhelper); + + tsdbDebug(":io-cost summary: statis-info time:%"PRId64"us, datablock time:%" PRId64"us ,%p", pQueryHandle->cost.statisInfoLoadTime, + pQueryHandle->cost.blockLoadTime, pQueryHandle->qinfo); + tfree(pQueryHandle); } From 81cc5f4e2a705a174751ec0a593b7d5d6e753d50 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 15 Jul 2020 12:59:15 +0800 Subject: [PATCH 04/30] [td-225] remove profile flag --- cmake/platform.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/platform.inc b/cmake/platform.inc index 731cf44684..2e0e2d6af0 100755 --- a/cmake/platform.inc +++ b/cmake/platform.inc @@ -109,7 +109,7 @@ IF (TD_LINUX_64) IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ELSE () - SET(COMMON_FLAGS "-std=gnu99 -Wall -pg -Werror -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") + SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () ELSE () SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") From 415cb3b93722c7a1a262d75ac08cf4be5292777d Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 15 Jul 2020 13:18:46 +0800 Subject: [PATCH 05/30] fix TSDB test --- src/tsdb/tests/tsdbTests.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tsdb/tests/tsdbTests.cpp b/src/tsdb/tests/tsdbTests.cpp index 8628d816c4..88bd524c20 100644 --- a/src/tsdb/tests/tsdbTests.cpp +++ b/src/tsdb/tests/tsdbTests.cpp @@ -39,7 +39,9 @@ static int insertData(SInsertInfo *pInfo) { pBlock->uid = pInfo->uid; pBlock->tid = pInfo->tid; pBlock->sversion = pInfo->sversion; - pBlock->len = 0; + pBlock->dataLen = 0; + pBlock->schemaLen = 0; + pBlock->numOfRows = 0; for (int i = 0; i < pInfo->rowsPerSubmit; i++) { // start_time += 1000; if (pInfo->isAscend) { @@ -47,7 +49,7 @@ static int insertData(SInsertInfo *pInfo) { } else { start_time -= pInfo->interval; } - SDataRow row = (SDataRow)(pBlock->data + pBlock->len); + SDataRow row = (SDataRow)(pBlock->data + pBlock->dataLen); tdInitDataRow(row, pInfo->pSchema); for (int j = 0; j < schemaNCols(pInfo->pSchema); j++) { @@ -59,13 +61,15 @@ static int insertData(SInsertInfo *pInfo) { tdAppendColVal(row, (void *)(&val), pTCol->type, pTCol->bytes, pTCol->offset); } } - pBlock->len += dataRowLen(row); + pBlock->dataLen += dataRowLen(row); + pBlock->numOfRows++; } - pMsg->length = pMsg->length + sizeof(SSubmitBlk) + pBlock->len; + pMsg->length = sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + pBlock->dataLen; pMsg->numOfBlocks = 1; - pBlock->len = htonl(pBlock->len); + pBlock->dataLen = htonl(pBlock->dataLen); pBlock->numOfRows = htonl(pBlock->numOfRows); + pBlock->schemaLen = htonl(pBlock->schemaLen); pBlock->uid = htobe64(pBlock->uid); pBlock->tid = htonl(pBlock->tid); @@ -74,7 +78,6 @@ static int insertData(SInsertInfo *pInfo) { pMsg->length = htonl(pMsg->length); pMsg->numOfBlocks = htonl(pMsg->numOfBlocks); - pMsg->compressed = htonl(pMsg->numOfBlocks); if (tsdbInsertData(pInfo->pRepo, pMsg, NULL) < 0) { tfree(pMsg); From 02f97ece3262da6878a1e28137927059e1738a7c Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 15 Jul 2020 14:37:32 +0800 Subject: [PATCH 06/30] adjust some parameter for efficiency --- src/inc/taosdef.h | 2 +- src/tsdb/src/tsdbMemTable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 7696c91bdf..db0333a7c5 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -293,7 +293,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MIN_TOTAL_BLOCKS 2 #define TSDB_MAX_TOTAL_BLOCKS 10000 -#define TSDB_DEFAULT_TOTAL_BLOCKS 4 +#define TSDB_DEFAULT_TOTAL_BLOCKS 6 #define TSDB_MIN_TABLES 4 #define TSDB_MAX_TABLES 10000000 diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index 1cd212b216..a51a172896 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -172,7 +172,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) { STsdbBufBlock *pBufBlock = tsdbGetCurrBufBlock(pRepo); if (pBufBlock != NULL && pBufBlock->remain < bytes) { - if (listNEles(pRepo->mem->bufBlockList) >= pCfg->totalBlocks / 2) { // need to commit mem + if (listNEles(pRepo->mem->bufBlockList) >= pCfg->totalBlocks / 3) { // need to commit mem if (tsdbAsyncCommit(pRepo) < 0) return NULL; } else { if (tsdbLockRepo(pRepo) < 0) return NULL; From d5686f48d65e745733f9646ebf140bc539103449 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 15 Jul 2020 17:51:24 +0800 Subject: [PATCH 07/30] no reconfig any more --- src/inc/tsdb.h | 1 - src/vnode/src/vnodeMain.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index b8cc1768e8..3059fd2435 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -46,7 +46,6 @@ typedef struct { int (*eventCallBack)(void *); void *(*cqCreateFunc)(void *handle, uint64_t uid, int sid, char *sqlStr, STSchema *pSchema); void (*cqDropFunc)(void *handle); - void *(*configFunc)(int32_t vgId, int32_t sid); } STsdbAppH; // --------- TSDB REPOSITORY CONFIGURATION DEFINITION diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 49f648b74d..f316efcfdb 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -263,7 +263,6 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { appH.cqH = pVnode->cq; appH.cqCreateFunc = cqCreate; appH.cqDropFunc = cqDrop; - appH.configFunc = dnodeSendCfgTableToRecv; sprintf(temp, "%s/tsdb", rootDir); pVnode->tsdb = tsdbOpenRepo(temp, &appH); if (pVnode->tsdb == NULL) { @@ -580,7 +579,6 @@ static void vnodeNotifyFileSynced(void *ahandle, uint64_t fversion) { appH.cqH = pVnode->cq; appH.cqCreateFunc = cqCreate; appH.cqDropFunc = cqDrop; - appH.configFunc = dnodeSendCfgTableToRecv; pVnode->tsdb = tsdbOpenRepo(rootDir, &appH); } From c8159c56c6b76ed625a8a64e6bd470e744b2170b Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 16 Jul 2020 10:55:15 +0800 Subject: [PATCH 08/30] [td-805] opt query perf --- src/client/inc/tsclient.h | 1 - src/client/src/tscSQLParser.c | 25 +++++++++++++++---------- src/query/src/qExecutor.c | 28 +++++++++++++++++++--------- src/rpc/src/rpcTcp.c | 2 +- src/tsdb/src/tsdbRead.c | 32 ++++++++++++++++++-------------- 5 files changed, 53 insertions(+), 35 deletions(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index be82eb64a8..1b30c4ffca 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -422,7 +422,6 @@ static FORCE_INLINE void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pField int32_t bytes = pInfo->pSqlExpr->resBytes; char* pData = pRes->data + pInfo->pSqlExpr->offset * pRes->numOfRows + bytes * pRes->row; - if (type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BINARY) { int32_t realLen = varDataLen(pData); assert(realLen <= bytes - VARSTR_HEADER_SIZE); diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 9d80c7ed50..8166f7ee5e 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1385,6 +1385,11 @@ static int32_t doAddProjectionExprAndResultFields(SQueryInfo* pQueryInfo, SColum return numOfTotalColumns; } +static void tscInsertPrimaryTSSourceColumn(SQueryInfo* pQueryInfo, SColumnIndex* pIndex) { + SColumnIndex tsCol = {.tableIndex = pIndex->tableIndex, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX}; + tscColumnListInsert(pQueryInfo->colList, &tsCol); +} + int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExprItem* pItem) { const char* msg0 = "invalid column name"; const char* msg1 = "tag for normal table query is not allowed"; @@ -1427,6 +1432,8 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t addProjectQueryCol(pQueryInfo, startPos, &index, pItem); } + + tscInsertPrimaryTSSourceColumn(pQueryInfo, &index); } else { return TSDB_CODE_TSC_INVALID_SQL; } @@ -1499,8 +1506,8 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col switch (optr) { case TK_COUNT: { - if (pItem->pNode->pParam != NULL && pItem->pNode->pParam->nExpr != 1) { /* more than one parameter for count() function */ + if (pItem->pNode->pParam != NULL && pItem->pNode->pParam->nExpr != 1) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -1551,11 +1558,12 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col } } else { // count(*) is equalled to count(primary_timestamp_key) index = (SColumnIndex){0, PRIMARYKEY_TIMESTAMP_COL_INDEX}; - int32_t size = tDataTypeDesc[TSDB_DATA_TYPE_BIGINT].nSize; pExpr = tscSqlExprAppend(pQueryInfo, functionID, &index, TSDB_DATA_TYPE_BIGINT, size, size, false); } - + + pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex); + memset(pExpr->aliasName, 0, tListLen(pExpr->aliasName)); getColumnName(pItem, pExpr->aliasName, sizeof(pExpr->aliasName) - 1); @@ -1570,9 +1578,8 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col } // the time stamp may be always needed - if (index.tableIndex > 0 && index.tableIndex < tscGetNumOfColumns(pTableMetaInfo->pTableMeta)) { - SColumnIndex tsCol = {.tableIndex = index.tableIndex, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX}; - tscColumnListInsert(pQueryInfo->colList, &tsCol); + if (index.tableIndex < tscGetNumOfColumns(pTableMetaInfo->pTableMeta)) { + tscInsertPrimaryTSSourceColumn(pQueryInfo, &index); } return TSDB_CODE_SUCCESS; @@ -1682,10 +1689,8 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col tscColumnListInsert(pQueryInfo->colList, &(ids.ids[i])); } } - - SColumnIndex tsCol = {.tableIndex = index.tableIndex, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX}; - tscColumnListInsert(pQueryInfo->colList, &tsCol); - + + tscInsertPrimaryTSSourceColumn(pQueryInfo, &index); return TSDB_CODE_SUCCESS; } case TK_FIRST: diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 100c8c77fd..706eb0c95c 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4564,7 +4564,6 @@ static void sequentialTableProcess(SQInfo *pQInfo) { // TODO handle the limit offset problem if (pQuery->numOfFilterCols == 0 && pQuery->limit.offset > 0) { - // skipBlocks(pRuntimeEnv); if (Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) { pQInfo->tableIndex++; continue; @@ -4799,7 +4798,7 @@ static void tableFixedOutputProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo) SQueryRuntimeEnv *pRuntimeEnv = &pQInfo->runtimeEnv; SQuery *pQuery = pRuntimeEnv->pQuery; - if (!isTopBottomQuery(pQuery) && pQuery->limit.offset > 0) { // no need to execute, since the output will be ignore. + if (!pRuntimeEnv->topBotQuery && pQuery->limit.offset > 0) { // no need to execute, since the output will be ignore. return; } @@ -5639,6 +5638,20 @@ static int compareTableIdInfo(const void* a, const void* b) { static void freeQInfo(SQInfo *pQInfo); +static void calResultBufSize(SQuery* pQuery) { + const int32_t RESULT_MSG_MIN_SIZE = 1024 * (1024 + 512); // bytes + const int32_t RESULT_MSG_MIN_ROWS = 8192; + const float RESULT_THRESHOLD_RATIO = 0.85; + + int32_t numOfRes = RESULT_MSG_MIN_SIZE / pQuery->rowSize; + if (numOfRes < RESULT_MSG_MIN_ROWS) { + numOfRes = RESULT_MSG_MIN_ROWS; + } + + pQuery->rec.capacity = numOfRes; + pQuery->rec.threshold = numOfRes * RESULT_THRESHOLD_RATIO; +} + static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList, SSqlGroupbyExpr *pGroupbyExpr, SExprInfo *pExprs, STableGroupInfo *pTableGroupInfo, SColumnInfo* pTagCols) { int16_t numOfCols = pQueryMsg->numOfCols; @@ -5672,8 +5685,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList, pQuery->fillType = pQueryMsg->fillType; pQuery->numOfTags = pQueryMsg->numOfTags; pQuery->tagColList = pTagCols; - - // todo do not allocate ?? + pQuery->colList = calloc(numOfCols, sizeof(SSingleColumnFilterInfo)); if (pQuery->colList == NULL) { goto _cleanup; @@ -5703,9 +5715,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList, goto _cleanup; } - // set the output buffer capacity - pQuery->rec.capacity = 4096; - pQuery->rec.threshold = 4000; + calResultBufSize(pQuery); for (int32_t col = 0; col < pQuery->numOfOutput; ++col) { assert(pExprs[col].interBytes >= pExprs[col].bytes); @@ -5967,7 +5977,6 @@ static void freeQInfo(SQInfo *pQInfo) { } tfree(pQuery->sdata); - tfree(pQuery); qDebug("QInfo:%p QInfo is freed", pQInfo); @@ -6503,7 +6512,8 @@ void* qOpenQueryMgmt(int32_t vgId) { } static void queryMgmtKillQueryFn(void* handle) { - qKillQuery(handle); + void** h = (void**) handle; + qKillQuery(*h); } void qQueryMgmtNotifyClosed(void* pQMgmt) { diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index def1fd9383..5cb45a6d26 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -374,7 +374,7 @@ int taosSendTcpData(uint32_t ip, uint16_t port, void *data, int len, void *chand if (chandle == NULL) return -1; - return (int)send(pFdObj->fd, data, (size_t)len, 0); + return taosWriteMsg(pFdObj->fd, data, len); } static void taosReportBrokenLink(SFdObj *pFdObj) { diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 7249e7472c..2195760e88 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -604,7 +604,6 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo int16_t* colIds = pQueryHandle->defaultLoadColumn->pData; int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, QH_GET_NUM_OF_COLS(pQueryHandle)); -// int32_t ret = tsdbLoadBlockData(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo); if (ret == TSDB_CODE_SUCCESS) { SDataBlockLoadInfo* pBlockLoadInfo = &pQueryHandle->dataBlockLoadInfo; @@ -1534,7 +1533,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { pSecQueryHandle->statis = calloc(numOfCols, sizeof(SDataStatis)); pSecQueryHandle->pColumns = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); - + for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData colInfo = {{0}, 0}; SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); @@ -1542,7 +1541,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { colInfo.info = pCol->info; colInfo.pData = calloc(1, EXTRA_BYTES + pQueryHandle->outputCapacity * pCol->info.bytes); taosArrayPush(pSecQueryHandle->pColumns, &colInfo); - pSecQueryHandle->statis[i].colId = colInfo.info.colId; } size_t si = taosArrayGetSize(pQueryHandle->pTableCheckInfo); @@ -1564,7 +1562,8 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { tsdbInitDataBlockLoadInfo(&pSecQueryHandle->dataBlockLoadInfo); tsdbInitCompBlockLoadInfo(&pSecQueryHandle->compBlockLoadInfo); - + pSecQueryHandle->defaultLoadColumn = taosArrayClone(pQueryHandle->defaultLoadColumn); + bool ret = tsdbNextDataBlock((void*) pSecQueryHandle); assert(ret); @@ -1811,22 +1810,26 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta int64_t stime = taosGetTimestampUs(); tsdbLoadCompData(&pHandle->rhelper, pBlockInfo->compBlock, NULL); - // todo opt perf + int16_t* colIds = pHandle->defaultLoadColumn->pData; + size_t numOfCols = QH_GET_NUM_OF_COLS(pHandle); + memset(pHandle->statis, 0, numOfCols * sizeof(SDataStatis)); for(int32_t i = 0; i < numOfCols; ++i) { - SDataStatis* st = &pHandle->statis[i]; - int32_t colId = st->colId; - - memset(st, 0, sizeof(SDataStatis)); - st->colId = colId; + pHandle->statis[i].colId = colIds[i]; } tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, numOfCols); - - *pBlockStatis = pHandle->statis; - + + // always load the first primary timestamp column data + SDataStatis* pPrimaryColStatis = &pHandle->statis[0]; + assert(pPrimaryColStatis->colId == PRIMARYKEY_TIMESTAMP_COL_INDEX); + + pPrimaryColStatis->numOfNull = 0; + pPrimaryColStatis->min = pBlockInfo->compBlock->keyFirst; + pPrimaryColStatis->max = pBlockInfo->compBlock->keyLast; + //update the number of NULL data rows - for(int32_t i = 0; i < numOfCols; ++i) { + for(int32_t i = 1; i < numOfCols; ++i) { if (pHandle->statis[i].numOfNull == -1) { // set the column data are all NULL pHandle->statis[i].numOfNull = pBlockInfo->compBlock->numOfRows; } @@ -1842,6 +1845,7 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta int64_t elapsed = taosGetTimestampUs() - stime; pHandle->cost.statisInfoLoadTime += elapsed; + *pBlockStatis = pHandle->statis; return TSDB_CODE_SUCCESS; } From 8f3798da1d4ebacd27ac695c517881cd3b364293 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 16 Jul 2020 11:25:08 +0800 Subject: [PATCH 09/30] [td-225] refactor code --- src/client/src/tscAsync.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 8c194c031d..b856752db3 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -474,33 +474,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { // in case of insert, redo parsing the sql string and build new submit data block for two reasons: // 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly. // 2. vnode may need the schema information along with submit block to update its local table schema. - if (pCmd->command == TSDB_SQL_INSERT) { - tscDebug("%p redo parse sql string to build submit block", pSql); - - pCmd->parseFinished = false; - tscResetSqlCmdObj(pCmd); - - code = tsParseSql(pSql, true); - - if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { - return; - } else if (code != TSDB_CODE_SUCCESS) { - goto _error; - } - - /* - * Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks, - * and send the required submit block according to index value in supporter to server. - */ - pSql->fp = pSql->fetchFp; // restore the fp - tscHandleInsertRetry(pSql); - } else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue + if (pCmd->command == TSDB_SQL_INSERT || pCmd->command == TSDB_SQL_SELECT) { tscDebug("%p redo parse sql string and proceed", pSql); - //tscDebug("before %p fp:%p, fetchFp:%p", pSql, pSql->fp, pSql->fetchFp); pCmd->parseFinished = false; tscResetSqlCmdObj(pCmd); - //tscDebug("after %p fp:%p, fetchFp:%p", pSql, pSql->fp, pSql->fetchFp); code = tsParseSql(pSql, true); if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { @@ -509,8 +487,17 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { goto _error; } - tscProcessSql(pSql); - } else { // in all other cases, simple retry + if (pCmd->command == TSDB_SQL_INSERT) { + /* + * Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks, + * and send the required submit block according to index value in supporter to server. + */ + pSql->fp = pSql->fetchFp; // restore the fp + tscHandleInsertRetry(pSql); + } else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue + tscProcessSql(pSql); + } + }else { // in all other cases, simple retry tscProcessSql(pSql); } From b8bedb9c1bc1dcffaaf39fc0e4eefe3284814ba0 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 16 Jul 2020 12:15:17 +0800 Subject: [PATCH 10/30] add some debug info --- src/tsdb/src/tsdbMemTable.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index a51a172896..b29cec3cf9 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -204,6 +204,9 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) { pBufBlock->offset += bytes; pBufBlock->remain -= bytes; + tsdbTrace("vgId:%d allocate %d bytes from buffer block, nBlocks %d offset %d remain %d", REPO_ID(pRepo), bytes, + listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain); + return ptr; } @@ -324,6 +327,8 @@ static void tsdbFreeBytes(STsdbRepo *pRepo, void *ptr, int bytes) { pBufBlock->offset -= bytes; pBufBlock->remain += bytes; ASSERT(ptr == POINTER_SHIFT(pBufBlock->data, pBufBlock->offset)); + tsdbTrace("vgId:%d return %d bytes to buffer block, nBlocks %d offset %d remain %d", REPO_ID(pRepo), bytes, + listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain); } static SMemTable* tsdbNewMemTable(STsdbCfg* pCfg) { From 203aafdf7953f17b9cdf2e4e99ca7bb8eda34dd6 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 16 Jul 2020 13:59:02 +0800 Subject: [PATCH 11/30] add more debug code --- src/tsdb/src/tsdbRWHelper.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index 040b4a5334..2b110656d2 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -589,20 +589,25 @@ void tsdbGetDataStatis(SRWHelper *pHelper, SDataStatis *pStatis, int numOfCols) int tsdbLoadBlockDataCols(SRWHelper *pHelper, SCompBlock *pCompBlock, SCompInfo *pCompInfo, int16_t *colIds, int numOfColIds) { ASSERT(pCompBlock->numOfSubBlocks >= 1); // Must be super block + SCompBlock *pTCompBlock = NULL; int numOfSubBlocks = pCompBlock->numOfSubBlocks; if (numOfSubBlocks > 1) - pCompBlock = (SCompBlock *)POINTER_SHIFT((pCompInfo == NULL) ? pHelper->pCompInfo : pCompInfo, pCompBlock->offset); + pTCompBlock = (SCompBlock *)POINTER_SHIFT((pCompInfo == NULL) ? pHelper->pCompInfo : pCompInfo, pCompBlock->offset); tdResetDataCols(pHelper->pDataCols[0]); - if (tsdbLoadBlockDataColsImpl(pHelper, pCompBlock, pHelper->pDataCols[0], colIds, numOfColIds) < 0) goto _err; + if (tsdbLoadBlockDataColsImpl(pHelper, pTCompBlock, pHelper->pDataCols[0], colIds, numOfColIds) < 0) goto _err; for (int i = 1; i < numOfSubBlocks; i++) { tdResetDataCols(pHelper->pDataCols[1]); - pCompBlock++; - if (tsdbLoadBlockDataColsImpl(pHelper, pCompBlock, pHelper->pDataCols[1], colIds, numOfColIds) < 0) goto _err; + pTCompBlock++; + if (tsdbLoadBlockDataColsImpl(pHelper, pTCompBlock, pHelper->pDataCols[1], colIds, numOfColIds) < 0) goto _err; if (tdMergeDataCols(pHelper->pDataCols[0], pHelper->pDataCols[1], pHelper->pDataCols[1]->numOfRows) < 0) goto _err; } + ASSERT(pHelper->pDataCols[0]->numOfRows == pCompBlock->numOfRows && + dataColsKeyFirst(pHelper->pDataCols[0]) == pCompBlock->keyFirst && + dataColsKeyLast(pHelper->pDataCols[0]) == pCompBlock->keyLast); + return 0; _err: @@ -610,19 +615,25 @@ _err: } int tsdbLoadBlockData(SRWHelper *pHelper, SCompBlock *pCompBlock, SCompInfo *pCompInfo) { + SCompBlock *pTCompBlock = NULL; + int numOfSubBlock = pCompBlock->numOfSubBlocks; if (numOfSubBlock > 1) - pCompBlock = (SCompBlock *)POINTER_SHIFT((pCompInfo == NULL) ? pHelper->pCompInfo : pCompInfo, pCompBlock->offset); + pTCompBlock = (SCompBlock *)POINTER_SHIFT((pCompInfo == NULL) ? pHelper->pCompInfo : pCompInfo, pCompBlock->offset); tdResetDataCols(pHelper->pDataCols[0]); - if (tsdbLoadBlockDataImpl(pHelper, pCompBlock, pHelper->pDataCols[0]) < 0) goto _err; + if (tsdbLoadBlockDataImpl(pHelper, pTCompBlock, pHelper->pDataCols[0]) < 0) goto _err; for (int i = 1; i < numOfSubBlock; i++) { tdResetDataCols(pHelper->pDataCols[1]); - pCompBlock++; - if (tsdbLoadBlockDataImpl(pHelper, pCompBlock, pHelper->pDataCols[1]) < 0) goto _err; + pTCompBlock++; + if (tsdbLoadBlockDataImpl(pHelper, pTCompBlock, pHelper->pDataCols[1]) < 0) goto _err; if (tdMergeDataCols(pHelper->pDataCols[0], pHelper->pDataCols[1], pHelper->pDataCols[1]->numOfRows) < 0) goto _err; } + ASSERT(pHelper->pDataCols[0]->numOfRows == pCompBlock->numOfRows && + dataColsKeyFirst(pHelper->pDataCols[0]) == pCompBlock->keyFirst && + dataColsKeyLast(pHelper->pDataCols[0]) == pCompBlock->keyLast); + return 0; _err: @@ -1227,7 +1238,6 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa terrno = TAOS_SYSTEM_ERROR(errno); goto _err; } - ASSERT(pCompData->numOfCols == pCompBlock->numOfCols); int32_t tsize = TSDB_GET_COMPCOL_LEN(pCompBlock->numOfCols); if (!taosCheckChecksumWhole((uint8_t *)pCompData, tsize)) { @@ -1236,6 +1246,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa terrno = TSDB_CODE_TDB_FILE_CORRUPTED; goto _err; } + ASSERT(pCompData->numOfCols == pCompBlock->numOfCols); pDataCols->numOfRows = pCompBlock->numOfRows; From 857788d42069b46c978314c446614f4af6fb16c6 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 16 Jul 2020 14:56:13 +0800 Subject: [PATCH 12/30] Fix debug code --- src/tsdb/src/tsdbRWHelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index 2b110656d2..0d52b7ae33 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -589,7 +589,7 @@ void tsdbGetDataStatis(SRWHelper *pHelper, SDataStatis *pStatis, int numOfCols) int tsdbLoadBlockDataCols(SRWHelper *pHelper, SCompBlock *pCompBlock, SCompInfo *pCompInfo, int16_t *colIds, int numOfColIds) { ASSERT(pCompBlock->numOfSubBlocks >= 1); // Must be super block - SCompBlock *pTCompBlock = NULL; + SCompBlock *pTCompBlock = pCompBlock; int numOfSubBlocks = pCompBlock->numOfSubBlocks; if (numOfSubBlocks > 1) @@ -615,7 +615,7 @@ _err: } int tsdbLoadBlockData(SRWHelper *pHelper, SCompBlock *pCompBlock, SCompInfo *pCompInfo) { - SCompBlock *pTCompBlock = NULL; + SCompBlock *pTCompBlock = pCompBlock; int numOfSubBlock = pCompBlock->numOfSubBlocks; if (numOfSubBlock > 1) From ebed0de405933e3fee7580442d6d026603763be9 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 02:11:36 +0800 Subject: [PATCH 13/30] [td-225] fix error in top/bottom query --- src/client/src/tscFunctionImpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 8e81462257..262b7ab3f6 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -2292,8 +2292,9 @@ static void top_func_second_merge(SQLFunctionCtx *pCtx) { // the intermediate result is binary, we only use the output data type for (int32_t i = 0; i < pInput->num; ++i) { + int16_t type = (pCtx->outputType == TSDB_DATA_TYPE_FLOAT)? TSDB_DATA_TYPE_DOUBLE:pCtx->outputType; do_top_function_add(pOutput, pCtx->param[0].i64Key, &pInput->res[i]->v.i64Key, pInput->res[i]->timestamp, - pCtx->outputType, &pCtx->tagInfo, pInput->res[i]->pTags, pCtx->currentStage); + type, &pCtx->tagInfo, pInput->res[i]->pTags, pCtx->currentStage); } SET_VAL(pCtx, pInput->num, pOutput->num); From 98e99fd45b5713b26e6a912f9780c36493b2625e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 11:30:06 +0800 Subject: [PATCH 14/30] [td-225] fix bugs in union query. --- src/client/inc/tscUtil.h | 4 +- src/client/src/tscAsync.c | 6 +- src/client/src/tscSQLParser.c | 15 +- src/client/src/tscServer.c | 2 +- src/client/src/tscSql.c | 2 +- src/client/src/tscSubquery.c | 234 ++++++++++++++------------ src/client/src/tscUtil.c | 14 +- tests/script/general/parser/union.sim | 160 +++++++++--------- 8 files changed, 234 insertions(+), 203 deletions(-) diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index 4af929bf41..6a5c2d0099 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -263,9 +263,11 @@ int16_t tscGetJoinTagColIdByUid(STagCond* pTagCond, uint64_t uid); void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex); bool hasMoreVnodesToTry(SSqlObj *pSql); +bool hasMoreClauseToTry(SSqlObj* pSql); + void tscTryQueryNextVnode(SSqlObj *pSql, __async_cb_func_t fp); void tscAsyncQuerySingleRowForNextVnode(void *param, TAOS_RES *tres, int numOfRows); -void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()); +void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp); int tscSetMgmtIpListFromCfg(const char *first, const char *second); void* malloc_throw(size_t size); diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 441480685f..9dd33e03cb 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -169,7 +169,11 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH; } - tscProcessSql(pSql); + if (pCmd->command == TSDB_SQL_TABLE_JOIN_RETRIEVE) { + tscFetchDatablockFromSubquery(pSql); + } else { + tscProcessSql(pSql); + } } /* diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 12e9769c03..f9b12f3f6d 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -485,7 +485,6 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { } case TSDB_SQL_SELECT: { - assert(pCmd->numOfClause == 1); const char* msg1 = "columns in select clause not identical"; for (int32_t i = pCmd->numOfClause; i < pInfo->subclauseInfo.numOfClause; ++i) { @@ -496,16 +495,19 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { } assert(pCmd->numOfClause == pInfo->subclauseInfo.numOfClause); - for (int32_t i = 0; i < pInfo->subclauseInfo.numOfClause; ++i) { + for (int32_t i = pCmd->clauseIndex; i < pInfo->subclauseInfo.numOfClause; ++i) { SQuerySQL* pQuerySql = pInfo->subclauseInfo.pClause[i]; - + tscTrace("%p start to parse %dth subclause, total:%d", pSql, i, pInfo->subclauseInfo.numOfClause); if ((code = doCheckForQuery(pSql, pQuerySql, i)) != TSDB_CODE_SUCCESS) { return code; } tscPrintSelectClause(pSql, i); + pCmd->clauseIndex += 1; } + // restore the clause index + pCmd->clauseIndex = 0; // set the command/global limit parameters from the first subclause to the sqlcmd object SQueryInfo* pQueryInfo1 = tscGetQueryInfoDetail(pCmd, 0); pCmd->command = pQueryInfo1->command; @@ -5867,6 +5869,8 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { pTableMetaInfo = tscAddEmptyMetaInfo(pQueryInfo); } + assert(pCmd->clauseIndex == index); + // too many result columns not support order by in query if (pQuerySql->pSelection->nExpr > TSDB_MAX_COLUMNS) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8); @@ -5980,12 +5984,11 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { pQueryInfo->window.ekey = pQueryInfo->window.ekey / 1000; } } else { // set the time rang - pQueryInfo->window.skey = TSKEY_INITIAL_VAL; - pQueryInfo->window.ekey = INT64_MAX; + pQueryInfo->window = TSWINDOW_INITIALIZER; } // user does not specified the query time window, twa is not allowed in such case. - if ((pQueryInfo->window.skey == 0 || pQueryInfo->window.ekey == INT64_MAX || + if ((pQueryInfo->window.skey == INT64_MIN || pQueryInfo->window.ekey == INT64_MAX || (pQueryInfo->window.ekey == INT64_MAX / 1000 && tinfo.precision == TSDB_TIME_PRECISION_MILLI)) && tscIsTWAQuery(pQueryInfo)) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg9); } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index d8af6d5c87..99ac2249e0 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -475,7 +475,7 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SRetrieveTableMsg *pRetrieveMsg = (SRetrieveTableMsg *) pSql->cmd.payload; pRetrieveMsg->qhandle = htobe64(pSql->res.qhandle); - SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); + SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); pRetrieveMsg->free = htons(pQueryInfo->type); // todo valid the vgroupId at the client side diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 0677463d8d..d5160cd3c6 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -424,7 +424,7 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) { } // current data set are exhausted, fetch more data from node - if (pRes->row >= pRes->numOfRows && (pRes->completed != true || hasMoreVnodesToTry(pSql)) && + if (pRes->row >= pRes->numOfRows && (pRes->completed != true || hasMoreVnodesToTry(pSql) || hasMoreClauseToTry(pSql)) && (pCmd->command == TSDB_SQL_RETRIEVE || pCmd->command == TSDB_SQL_RETRIEVE_LOCALMERGE || pCmd->command == TSDB_SQL_TABLE_JOIN_RETRIEVE || diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index dd4ed991ed..faa4a2488a 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -848,13 +848,14 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR SSqlRes* pRes = &pSql->res; SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); - - // TODO put to async res? if (taos_errno(pSql) != TSDB_CODE_SUCCESS) { assert(numOfRows == taos_errno(pSql)); pParentSql->res.code = numOfRows; tscError("%p retrieve failed, index:%d, code:%s", pSql, pSupporter->subqueryIndex, tstrerror(numOfRows)); + + tscQueueAsyncRes(pParentSql); + return; } if (numOfRows >= 0) { @@ -941,31 +942,22 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) { SSqlRes *pRes = &pSub->res; SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSub->cmd, 0); -// STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); - -// if (tscNonOrderedProjectionQueryOnSTable(pQueryInfo, 0)) { -// if (pRes->row >= pRes->numOfRows && pTableMetaInfo->vgroupIndex < pTableMetaInfo->vgroupList->numOfVgroups && -// (!tscHasReachLimitation(pQueryInfo, pRes)) && !pRes->completed) { -// numOfFetch++; -// } -// } else { - if (!tscHasReachLimitation(pQueryInfo, pRes)) { - if (pRes->row >= pRes->numOfRows) { - hasData = false; - if (!pRes->completed) { - numOfFetch++; - } - } - } else { // has reach the limitation, no data anymore - if (pRes->row >= pRes->numOfRows) { - hasData = false; - break; + if (!tscHasReachLimitation(pQueryInfo, pRes)) { + if (pRes->row >= pRes->numOfRows) { + hasData = false; + + if (!pRes->completed) { + numOfFetch++; } } - + } else { // has reach the limitation, no data anymore + if (pRes->row >= pRes->numOfRows) { + hasData = false; + break; + } } -// } + } // has data remains in client side, and continue to return data to app if (hasData) { @@ -1026,7 +1018,7 @@ void tscSetupOutputColumnIndex(SSqlObj* pSql) { SSqlCmd* pCmd = &pSql->cmd; SSqlRes* pRes = &pSql->res; - tscDebug("%p all subquery response, retrieve data", pSql); + tscDebug("%p all subquery response, retrieve data for subclause:%d", pSql, pCmd->clauseIndex); // the column transfer support struct has been built if (pRes->pColumnIndex != NULL) { @@ -1195,8 +1187,11 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter pNew->cmd.numOfCols = 0; pNewQueryInfo->intervalTime = 0; - memset(&pNewQueryInfo->limit, 0, sizeof(SLimitVal)); - + pSupporter->limit = pNewQueryInfo->limit; + + pNewQueryInfo->limit.limit = -1; + pNewQueryInfo->limit.offset = 0; + // backup the data and clear it in the sqlcmd object pSupporter->groupbyExpr = pNewQueryInfo->groupbyExpr; memset(&pNewQueryInfo->groupbyExpr, 0, sizeof(SSqlGroupbyExpr)); @@ -1307,7 +1302,7 @@ int32_t tscHandleMasterJoinQuery(SSqlObj* pSql) { break; } } - + pSql->cmd.command = (pSql->numOfSubs <= 0)? TSDB_SQL_RETRIEVE_EMPTY_RESULT:TSDB_SQL_TABLE_JOIN_RETRIEVE; return TSDB_CODE_SUCCESS; @@ -1982,88 +1977,119 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { return TSDB_CODE_TSC_OUT_OF_MEMORY; } +static char* getResultBlockPosition(SSqlCmd* pCmd, SSqlRes* pRes, int32_t columnIndex, int16_t* bytes) { + SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); + + SFieldSupInfo* pInfo = (SFieldSupInfo*) TARRAY_GET_ELEM(pQueryInfo->fieldsInfo.pSupportInfo, columnIndex); + assert(pInfo->pSqlExpr != NULL); + + *bytes = pInfo->pSqlExpr->resBytes; + char* pData = pRes->data + pInfo->pSqlExpr->offset * pRes->numOfRows; + + return pData; +} + +static void doBuildResFromSubqueries(SSqlObj* pSql) { + SSqlRes* pRes = &pSql->res; + + SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); + + int32_t numOfRes = INT32_MAX; + for (int32_t i = 0; i < pSql->numOfSubs; ++i) { + if (pSql->pSubs[i] == NULL) { + continue; + } + + numOfRes = MIN(numOfRes, pSql->pSubs[i]->res.numOfRows); + } + + int32_t totalSize = tscGetResRowLength(pQueryInfo->exprList); + pRes->pRsp = realloc(pRes->pRsp, numOfRes * totalSize); + pRes->data = pRes->pRsp; + + char* data = pRes->data; + int16_t bytes = 0; + + size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); + for(int32_t i = 0; i < numOfExprs; ++i) { + SColumnIndex* pIndex = &pRes->pColumnIndex[i]; + SSqlRes *pRes1 = &pSql->pSubs[pIndex->tableIndex]->res; + SSqlCmd *pCmd1 = &pSql->pSubs[pIndex->tableIndex]->cmd; + + char* pData = getResultBlockPosition(pCmd1, pRes1, pIndex->columnIndex, &bytes); + memcpy(data, pData, bytes * numOfRes); + + data += bytes * numOfRes; + pRes1->row = numOfRes; + } + + pRes->numOfRows = numOfRes; + pRes->numOfClauseTotal += numOfRes; +} + void tscBuildResFromSubqueries(SSqlObj *pSql) { - SSqlRes *pRes = &pSql->res; - + SSqlRes* pRes = &pSql->res; + if (pRes->code != TSDB_CODE_SUCCESS) { tscQueueAsyncRes(pSql); return; } - - while (1) { - SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); + + if (pRes->tsrow == NULL) { + SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); + size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); - - if (pRes->tsrow == NULL) { - pRes->tsrow = calloc(numOfExprs, POINTER_BYTES); - pRes->length = calloc(numOfExprs, sizeof(int32_t)); + pRes->tsrow = calloc(numOfExprs, POINTER_BYTES); + pRes->buffer = calloc(numOfExprs, POINTER_BYTES); + pRes->length = calloc(numOfExprs, sizeof(int32_t)); + + tscRestoreSQLFuncForSTableQuery(pQueryInfo); + } + + while (1) { + if (pRes->row < pRes->numOfRows) { + assert(0); } - - bool success = false; - - int32_t numOfTableHasRes = 0; - for (int32_t i = 0; i < pSql->numOfSubs; ++i) { - if (pSql->pSubs[i] != NULL) { - numOfTableHasRes++; - } - } - - if (numOfTableHasRes >= 2) { // do merge result - success = (doSetResultRowData(pSql->pSubs[0], false) != NULL) && (doSetResultRowData(pSql->pSubs[1], false) != NULL); - } else { // only one subquery - SSqlObj *pSub = pSql->pSubs[0]; - if (pSub == NULL) { - pSub = pSql->pSubs[1]; - } - - success = (doSetResultRowData(pSub, false) != NULL); - } - - if (success) { // current row of final output has been built, return to app - for (int32_t i = 0; i < numOfExprs; ++i) { - SColumnIndex* pIndex = &pRes->pColumnIndex[i]; - SSqlRes *pRes1 = &pSql->pSubs[pIndex->tableIndex]->res; - pRes->tsrow[i] = pRes1->tsrow[pIndex->columnIndex]; - pRes->length[i] = pRes1->length[pIndex->columnIndex]; - } - - pRes->numOfClauseTotal++; - break; - } else { // continue retrieve data from vnode - if (!tscHasRemainDataInSubqueryResultSet(pSql)) { - tscDebug("%p at least one subquery exhausted, free all other %d subqueries", pSql, pSql->numOfSubs - 1); - SSubqueryState *pState = NULL; - - // free all sub sqlobj - for (int32_t i = 0; i < pSql->numOfSubs; ++i) { - SSqlObj *pChildObj = pSql->pSubs[i]; - if (pChildObj == NULL) { - continue; - } - - SJoinSupporter *pSupporter = (SJoinSupporter *)pChildObj->param; - pState = pSupporter->pState; - - tscDestroyJoinSupporter(pChildObj->param); - taos_free_result(pChildObj); - } - - free(pState); - - pRes->completed = true; // set query completed - sem_post(&pSql->rspSem); - return; - } - - tscFetchDatablockFromSubquery(pSql); - if (pRes->code != TSDB_CODE_SUCCESS) { - return; - } + + doBuildResFromSubqueries(pSql); + sem_post(&pSql->rspSem); + + return; + + // continue retrieve data from vnode +// if (!tscHasRemainDataInSubqueryResultSet(pSql)) { +// tscDebug("%p at least one subquery exhausted, free all other %d subqueries", pSql, pSql->numOfSubs - 1); +// SSubqueryState* pState = NULL; +// +// // free all sub sqlobj +// for (int32_t i = 0; i < pSql->numOfSubs; ++i) { +// SSqlObj* pChildObj = pSql->pSubs[i]; +// if (pChildObj == NULL) { +// continue; +// } +// +// SJoinSupporter* pSupporter = (SJoinSupporter*)pChildObj->param; +// pState = pSupporter->pState; +// +// tscDestroyJoinSupporter(pChildObj->param); +// taos_free_result(pChildObj); +// } +// +// free(pState); +// +// pRes->completed = true; // set query completed +// sem_post(&pSql->rspSem); +// return; +// } + + tscFetchDatablockFromSubquery(pSql); + if (pRes->code != TSDB_CODE_SUCCESS) { + return; } } - + if (pSql->res.code == TSDB_CODE_SUCCESS) { - (*pSql->fp)(pSql->param, pSql, 0); + (*pSql->fp)(pSql->param, pSql, pRes->numOfRows); } else { tscQueueAsyncRes(pSql); } @@ -2117,14 +2143,6 @@ void **doSetResultRowData(SSqlObj *pSql, bool finalResult) { assert(pRes->row >= 0 && pRes->row <= pRes->numOfRows); - if(pCmd->command == TSDB_SQL_TABLE_JOIN_RETRIEVE) { - if (pRes->completed) { - tfree(pRes->tsrow); - } - - return pRes->tsrow; - } - if (pRes->row >= pRes->numOfRows) { // all the results has returned to invoker tfree(pRes->tsrow); return pRes->tsrow; @@ -2182,7 +2200,7 @@ void **doSetResultRowData(SSqlObj *pSql, bool finalResult) { return pRes->tsrow; } -static bool tscHasRemainDataInSubqueryResultSet(SSqlObj *pSql) { +static UNUSED_FUNC bool tscHasRemainDataInSubqueryResultSet(SSqlObj *pSql) { bool hasData = true; SSqlCmd *pCmd = &pSql->cmd; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 3e0fe0b4be..49d15f6499 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1994,6 +1994,10 @@ bool hasMoreVnodesToTry(SSqlObj* pSql) { (!tscHasReachLimitation(pQueryInfo, pRes)) && (pTableMetaInfo->vgroupIndex < numOfVgroups - 1); } +bool hasMoreClauseToTry(SSqlObj* pSql) { + return pSql->cmd.clauseIndex < pSql->cmd.numOfClause - 1; +} + void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) { SSqlCmd* pCmd = &pSql->cmd; SSqlRes* pRes = &pSql->res; @@ -2050,7 +2054,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) { } } -void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()) { +void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) { SSqlCmd* pCmd = &pSql->cmd; SSqlRes* pRes = &pSql->res; @@ -2070,17 +2074,13 @@ void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()) { tfree(pSql->pSubs); pSql->numOfSubs = 0; - - if (pSql->fp != NULL) { - pSql->fp = queryFp; - assert(queryFp != NULL); - } + pSql->fp = fp; tscDebug("%p try data in the next subclause:%d, total subclause:%d", pSql, pCmd->clauseIndex, pCmd->numOfClause); if (pCmd->command > TSDB_SQL_LOCAL) { tscProcessLocalCmd(pSql); } else { - tscProcessSql(pSql); + tscDoQuery(pSql); } } diff --git a/tests/script/general/parser/union.sim b/tests/script/general/parser/union.sim index 14b6c97b7c..358bcb8a40 100644 --- a/tests/script/general/parser/union.sim +++ b/tests/script/general/parser/union.sim @@ -1,10 +1,10 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c debugFlag -v 135 -system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135 -system sh/exec.sh -n dnode1 -s start +#system sh/stop_dnodes.sh +# +#system sh/deploy.sh -n dnode1 -i 1 +#system sh/cfg.sh -n dnode1 -c walLevel -v 0 +#system sh/cfg.sh -n dnode1 -c debugFlag -v 135 +#system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135 +#system sh/exec.sh -n dnode1 -s start sleep 1000 sql connect @@ -24,77 +24,77 @@ $mt = $mtPrefix . $i $j = 1 $mt1 = $mtPrefix . $j - -sql drop database if exits $db -x step1 -step1: -sql create database if not exists $db maxtables 4 +# +#sql drop database if exits $db -x step1 +#step1: +#sql create database if not exists $db maxtables 4 sql use $db -sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int) - -$i = 0 -$t = 1578203484000 - -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x * 1000 - $ms = $ms * 60 - - $c = $x / 100 - $c = $c * 100 - $c = $x - $c - $binary = 'binary . $c - $binary = $binary . ' - $nchar = 'nchar . $c - $nchar = $nchar . ' - - $t1 = $t + $ms - sql insert into $tb values ($t1 , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sql create table $mt1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int) - -$j = 0 -$t = 1578203484000 -$rowNum = 1000 -$tbNum = 5 -$i = 0 - -while $i < $tbNum - $tb1 = $tbPrefix1 . $j - sql create table $tb1 using $mt1 tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x * 1000 - $ms = $ms * 60 - - $c = $x / 100 - $c = $c * 100 - $c = $x - $c - $binary = 'binary . $c - $binary = $binary . ' - $nchar = 'nchar . $c - $nchar = $nchar . ' - - $t1 = $t + $ms - sql insert into $tb1 values ($t1 , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar ) - $x = $x + 1 - endw - - $i = $i + 1 - $j = $j + 1 -endw - -print sleep 1sec. -sleep 1000 +#sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int) +# +#$i = 0 +#$t = 1578203484000 +# +#while $i < $tbNum +# $tb = $tbPrefix . $i +# sql create table $tb using $mt tags( $i ) +# +# $x = 0 +# while $x < $rowNum +# $ms = $x * 1000 +# $ms = $ms * 60 +# +# $c = $x / 100 +# $c = $c * 100 +# $c = $x - $c +# $binary = 'binary . $c +# $binary = $binary . ' +# $nchar = 'nchar . $c +# $nchar = $nchar . ' +# +# $t1 = $t + $ms +# sql insert into $tb values ($t1 , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar ) +# $x = $x + 1 +# endw +# +# $i = $i + 1 +#endw +# +#sql create table $mt1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int) +# +#$j = 0 +#$t = 1578203484000 +#$rowNum = 1000 +#$tbNum = 5 +#$i = 0 +# +#while $i < $tbNum +# $tb1 = $tbPrefix1 . $j +# sql create table $tb1 using $mt1 tags( $i ) +# +# $x = 0 +# while $x < $rowNum +# $ms = $x * 1000 +# $ms = $ms * 60 +# +# $c = $x / 100 +# $c = $c * 100 +# $c = $x - $c +# $binary = 'binary . $c +# $binary = $binary . ' +# $nchar = 'nchar . $c +# $nchar = $nchar . ' +# +# $t1 = $t + $ms +# sql insert into $tb1 values ($t1 , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar ) +# $x = $x + 1 +# endw +# +# $i = $i + 1 +# $j = $j + 1 +#endw +# +#print sleep 1sec. +#sleep 1000 $i = 1 $tb = $tbPrefix . $i @@ -222,7 +222,7 @@ endi print ===========================================tags union # two super table tag union, limit is not active during retrieve tags query -sql select t1 from union_mt0 union all select t1 from union_mt0 limit 1 +sql select t1 from union_mt0 union all select t1 from union_mt0 if $rows != 20 then return -1 endi @@ -235,6 +235,10 @@ if $data90 != 9 then return -1 endi +#sql select t1 from union_mt0 union all select t1 from union_mt0 limit 1 +#if $row != 11 then +# return -1 +#endi #========================================== two super table join subclause print ================two super table join subclause sql select avg(union_mt0.c1) as c from union_mt0 interval(1h) limit 10 union all select union_mt1.ts, union_mt1.c1/1.0 as c from union_mt0, union_mt1 where union_mt1.ts=union_mt0.ts and union_mt1.t1=union_mt0.t1 limit 5; From 14a86b4b5eb8b21dc9b69d77203ba127387207dd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 14:14:09 +0800 Subject: [PATCH 15/30] [td-225] fix invalid assert. --- src/tsdb/src/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 2b1248c8a9..f964fa8913 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1936,6 +1936,7 @@ static void destroyHelper(void* param) { free(param); } +#define TAG_INVALID_COLUMN_INDEX -2 static int32_t getTagColumnIndex(STSchema* pTSchema, SSchema* pSchema) { // filter on table name(TBNAME) if (strcasecmp(pSchema->name, TSQL_TBNAME_L) == 0) { @@ -1967,9 +1968,8 @@ void filterPrepare(void* expr, void* param) { tVariant* pCond = pExpr->_node.pRight->pVal; SSchema* pSchema = pExpr->_node.pLeft->pSchema; - // todo : if current super table does not change schema yet, this function may fail to get correct schema, test case int32_t index = getTagColumnIndex(pTSSchema, pSchema); - assert((index >= 0 && i < TSDB_MAX_TAGS) || (index == TSDB_TBNAME_COLUMN_INDEX)); + assert((index >= 0 && i < TSDB_MAX_TAGS) || (index == TSDB_TBNAME_COLUMN_INDEX) || index == TAG_INVALID_COLUMN_INDEX); pInfo->sch = *pSchema; pInfo->colIndex = index; From 2ba89e21b3cc956ef4830ec4596f0f394a6fc4d3 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 14:27:03 +0800 Subject: [PATCH 16/30] [td-225] fix error in calculate the qualified block --- src/query/src/qExecutor.c | 5 +- src/tsdb/src/tsdbRead.c | 98 +++++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 92426633d9..52154c1ca1 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -26,7 +26,6 @@ #include "query.h" #include "queryLog.h" #include "qast.h" -#include "tfile.h" #include "tlosertree.h" #include "tscompression.h" #include "ttime.h" @@ -35,8 +34,8 @@ * check if the primary column is load by default, otherwise, the program will * forced to load primary column explicitly. */ -#define Q_STATUS_EQUAL(p, s) (((p) & (s)) != 0) -#define TSDB_COL_IS_TAG(f) (((f)&TSDB_COL_TAG) != 0) +#define Q_STATUS_EQUAL(p, s) (((p) & (s)) != 0) +#define TSDB_COL_IS_TAG(f) (((f)&TSDB_COL_TAG) != 0) #define QUERY_IS_ASC_QUERY(q) (GET_FORWARD_DIRECTION_FACTOR((q)->order.order) == QUERY_ASC_FORWARD_STEP) #define IS_MASTER_SCAN(runtime) ((runtime)->scanFlag == MASTER_SCAN) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index f964fa8913..8e69a29234 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -515,7 +515,7 @@ static int32_t binarySearchForBlock(SCompBlock* pBlock, int32_t numOfBlocks, TSK return midSlot; } -static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlocks, int32_t type) { +static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlocks) { SFileGroup* fileGroup = pQueryHandle->pFileGroup; assert(fileGroup->files[TSDB_FILE_TYPE_HEAD].fname > 0); @@ -532,52 +532,61 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo for (int32_t i = 0; i < numOfTables; ++i) { STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); + pCheckInfo->numOfBlocks = 0; SCompIdx* compIndex = &pQueryHandle->rhelper.pCompIdx[pCheckInfo->tableId.tid]; - if (compIndex->len == 0 || compIndex->numOfBlocks == 0 || - compIndex->uid != pCheckInfo->tableId.uid) { // no data block in this file, try next file - pCheckInfo->numOfBlocks = 0; - continue; // no data blocks in the file belongs to pCheckInfo->pTable - } else { - if (pCheckInfo->compSize < compIndex->len) { - assert(compIndex->len > 0); - - char* t = realloc(pCheckInfo->pCompInfo, compIndex->len); - assert(t != NULL); - - pCheckInfo->pCompInfo = (SCompInfo*) t; - pCheckInfo->compSize = compIndex->len; - } - - tsdbSetHelperTable(&pQueryHandle->rhelper, pCheckInfo->pTableObj, pQueryHandle->pTsdb); - tsdbLoadCompInfo(&(pQueryHandle->rhelper), (void *)(pCheckInfo->pCompInfo)); - SCompInfo* pCompInfo = pCheckInfo->pCompInfo; - - TSKEY s = MIN(pCheckInfo->lastKey, pQueryHandle->window.ekey); - TSKEY e = MAX(pCheckInfo->lastKey, pQueryHandle->window.ekey); - - // discard the unqualified data block based on the query time window - int32_t start = binarySearchForBlock(pCompInfo->blocks, compIndex->numOfBlocks, s, TSDB_ORDER_ASC); - int32_t end = start; - - if (s > pCompInfo->blocks[start].keyLast) { - continue; - } - - // todo speedup the procedure of located end block - while (end < compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { - end += 1; - } - - pCheckInfo->numOfBlocks = (end - start); - - if (start > 0) { - memmove(pCompInfo->blocks, &pCompInfo->blocks[start], pCheckInfo->numOfBlocks * sizeof(SCompBlock)); - } - - (*numOfBlocks) += pCheckInfo->numOfBlocks; + // no data block in this file, try next file + if (compIndex->len == 0 || compIndex->numOfBlocks == 0 || compIndex->uid != pCheckInfo->tableId.uid) { + continue; // no data blocks in the file belongs to pCheckInfo->pTable } + + if (pCheckInfo->compSize < compIndex->len) { + assert(compIndex->len > 0); + + char* t = realloc(pCheckInfo->pCompInfo, compIndex->len); + assert(t != NULL); + + pCheckInfo->pCompInfo = (SCompInfo*) t; + pCheckInfo->compSize = compIndex->len; + } + + tsdbSetHelperTable(&pQueryHandle->rhelper, pCheckInfo->pTableObj, pQueryHandle->pTsdb); + + tsdbLoadCompInfo(&(pQueryHandle->rhelper), (void *)(pCheckInfo->pCompInfo)); + SCompInfo* pCompInfo = pCheckInfo->pCompInfo; + + TSKEY s = TSKEY_INITIAL_VAL, e = TSKEY_INITIAL_VAL; + + if (ASCENDING_TRAVERSE(pQueryHandle->order)) { + assert(pCheckInfo->lastKey >= pQueryHandle->window.ekey && pQueryHandle->window.skey <= pQueryHandle->window.ekey); + } else { + assert(pCheckInfo->lastKey <= pQueryHandle->window.ekey && pQueryHandle->window.skey >= pQueryHandle->window.ekey); + } + + s = MIN(pCheckInfo->lastKey, pQueryHandle->window.ekey); + e = MAX(pCheckInfo->lastKey, pQueryHandle->window.ekey); + + // discard the unqualified data block based on the query time window + int32_t start = binarySearchForBlock(pCompInfo->blocks, compIndex->numOfBlocks, s, TSDB_ORDER_ASC); + int32_t end = start; + + if (s > pCompInfo->blocks[start].keyLast) { + continue; + } + + // todo speedup the procedure of located end block + while (end < compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { + end += 1; + } + + pCheckInfo->numOfBlocks = (end - start); + + if (start > 0) { + memmove(pCompInfo->blocks, &pCompInfo->blocks[start], pCheckInfo->numOfBlocks * sizeof(SCompBlock)); + } + + (*numOfBlocks) += pCheckInfo->numOfBlocks; } return TSDB_CODE_SUCCESS; @@ -1378,8 +1387,7 @@ static int32_t getDataBlocksInFilesImpl(STsdbQueryHandle* pQueryHandle, bool* ex int32_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); while ((pQueryHandle->pFileGroup = tsdbGetFileGroupNext(&pQueryHandle->fileIter)) != NULL) { - int32_t type = ASCENDING_TRAVERSE(pQueryHandle->order)? QUERY_RANGE_GREATER_EQUAL:QUERY_RANGE_LESS_EQUAL; - if ((code = getFileCompInfo(pQueryHandle, &numOfBlocks, type)) != TSDB_CODE_SUCCESS) { + if ((code = getFileCompInfo(pQueryHandle, &numOfBlocks)) != TSDB_CODE_SUCCESS) { break; } From 41c4edf42111a9e3ec1b6906f7bbd09b56866a5c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 14:41:58 +0800 Subject: [PATCH 17/30] [td-225] fix typo --- src/tsdb/src/tsdbRead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 8e69a29234..d63b6525bc 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -559,9 +559,9 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo TSKEY s = TSKEY_INITIAL_VAL, e = TSKEY_INITIAL_VAL; if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - assert(pCheckInfo->lastKey >= pQueryHandle->window.ekey && pQueryHandle->window.skey <= pQueryHandle->window.ekey); + assert(pCheckInfo->lastKey <= pQueryHandle->window.ekey && pQueryHandle->window.skey <= pQueryHandle->window.ekey); } else { - assert(pCheckInfo->lastKey <= pQueryHandle->window.ekey && pQueryHandle->window.skey >= pQueryHandle->window.ekey); + assert(pCheckInfo->lastKey >= pQueryHandle->window.ekey && pQueryHandle->window.skey >= pQueryHandle->window.ekey); } s = MIN(pCheckInfo->lastKey, pQueryHandle->window.ekey); From af127bb66afdb3f50da841b834c81bb3829060c6 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 17 Jul 2020 14:48:13 +0800 Subject: [PATCH 18/30] TD-944 --- src/tsdb/src/tsdbMeta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index fcf9b04e4a..c1923f5235 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -592,7 +592,7 @@ void tsdbUpdateTableSchema(STsdbRepo *pRepo, STable *pTable, STSchema *pSchema, int tlen = tsdbGetTableEncodeSize(TSDB_UPDATE_META, pCTable); void *buf = tsdbAllocBytes(pRepo, tlen); ASSERT(buf != NULL); - tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, pTable); + tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, pCTable); } } From 13e197a5623cb9a160245bd8c5f2f0a3a8648c0d Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 17 Jul 2020 15:13:15 +0800 Subject: [PATCH 19/30] fix sim script bug --- tests/script/general/alter/cached_schema_after_alter.sim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/script/general/alter/cached_schema_after_alter.sim b/tests/script/general/alter/cached_schema_after_alter.sim index bf9b9eb6a3..2d049ec595 100644 --- a/tests/script/general/alter/cached_schema_after_alter.sim +++ b/tests/script/general/alter/cached_schema_after_alter.sim @@ -68,7 +68,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != NULL then +if $data02 != 1 then return -1 endi @@ -80,7 +80,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != NULL then +if $data02 != 1 then return -1 endi From 4a18ecba236775d1c7674097af2f52287b92191e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 15:18:02 +0800 Subject: [PATCH 20/30] [td-225] fix cache perf issue. --- src/util/src/tcache.c | 46 +++---------------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index 072e9939de..92d4b2caac 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -225,7 +225,7 @@ static void doCleanupDataCache(SCacheObj *pCacheObj); * refresh cache to remove data in both hash list and trash, if any nodes' refcount == 0, every pCacheObj->refreshTime * @param handle Cache object handle */ -static void* taosCacheTimedRefresh(void *pCacheObj); +static void* taosCacheTimedRefresh(void *handle); SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInSeconds, bool extendLifespan, __cache_free_fn_t fn, const char* cacheName) { if (refreshTimeInSeconds <= 0) { @@ -455,51 +455,11 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) { __cache_unlock(pCacheObj); } else { - uDebug("cache:%s, key:%p, %p is released, refcnt:%d", pCacheObj->name, pNode->key, pNode->data, T_REF_VAL_GET(pNode) - 1); - - __cache_wr_lock(pCacheObj); - // NOTE: once refcount is decrease, pNode may be freed by other thread immediately. int32_t ref = T_REF_DEC(pNode); - - if (inTrashCan && (ref == 0)) { - // Remove it if the ref count is 0. - // The ref count does not need to load and check again after lock acquired, since ref count can not be increased when - // the node is in trashcan. - assert(pNode->pTNodeHeader->pData == pNode); - taosRemoveFromTrashCan(pCacheObj, pNode->pTNodeHeader); - } - - __cache_unlock(pCacheObj); + uDebug("cache:%s, key:%p, %p is released, refcnt:%d, in trashcan:%d", pCacheObj->name, pNode->key, pNode->data, ref, + inTrashCan); } - -// else { -// if (_remove) { // not in trash can, but need to remove it -// __cache_wr_lock(pCacheObj); -// -// /* -// * If not referenced by other users. Otherwise move this node to trashcan wait for all users -// * releasing this resources. -// * -// * NOTE: previous ref is 0, and current ref is still 0, remove it. If previous is not 0, there is another thread -// * that tries to do the same thing. -// */ -// if (ref == 0) { -// if (T_REF_VAL_GET(pNode) == 0) { -// taosCacheReleaseNode(pCacheObj, pNode); -// } else { -// taosCacheMoveToTrash(pCacheObj, pNode); -// } -// } else if (ref > 0) { -// if (!pNode->inTrashCan) { -// assert(pNode->pTNodeHeader == NULL); -// taosCacheMoveToTrash(pCacheObj, pNode); -// } -// } -// -// __cache_unlock(pCacheObj); -// } -// } } void taosCacheEmpty(SCacheObj *pCacheObj) { From 5051a9d84e71bf87ea67b451c8308e9104ea295f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 17 Jul 2020 08:15:49 +0000 Subject: [PATCH 21/30] [TD-933] enable sqls like : alter dnode 1 monitor 1 --- src/common/src/tglobal.c | 19 ++++++++++++++----- src/plugins/monitor/src/monitorMain.c | 4 ++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index f1f4db7265..5462e2f468 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -199,6 +199,9 @@ int32_t sDebugFlag = 135; int32_t wDebugFlag = 135; int32_t tsdbDebugFlag = 131; +int32_t (*monitorStartSystemFp)() = NULL; +void (*monitorStopSystemFp)() = NULL; + static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT; void taosSetAllDebugFlag() { @@ -248,11 +251,17 @@ bool taosCfgDynamicOptions(char *msg) { *((int32_t *)cfg->ptr) = vint; if (strncasecmp(cfg->option, "monitor", olen) == 0) { - // if (0 == vint) { - // monitorStartSystem(); - // } else { - // monitorStopSystem(); - // } + if (1 == vint) { + if (monitorStartSystemFp) { + (*monitorStartSystemFp)(); + uInfo("monitor is enabled"); + } + } else { + if (monitorStopSystemFp) { + (*monitorStopSystemFp)(); + uInfo("monitor is disabled"); + } + } return true; } diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index 22cb111b83..e6e8cf982b 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -76,6 +76,8 @@ static void monitorInitDatabase(); static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code); static void monitorStartTimer(); static void monitorSaveSystemInfo(); +extern int32_t (*monitorStartSystemFp)(); +extern void (*monitorStopSystemFp)(); static void monitorCheckDiskUsage(void *para, void *unused) { taosGetDisk(); @@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) { int32_t monitorInitSystem() { taos_init(); taosTmrReset(monitorCheckDiskUsage, CHECK_INTERVAL, NULL, tscTmr, &tsMonitorConn.diskTimer); + monitorStartSystemFp = monitorStartSystem; + monitorStopSystemFp = monitorStopSystem; return 0; } From 2a973bdb2da6e94753bfc4010075c0bcc06dd091 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 17 Jul 2020 09:05:19 +0000 Subject: [PATCH 22/30] [TD-952] --- src/mnode/src/mnodeDnode.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index 06d79bd7e1..28986d6886 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -452,10 +452,23 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) { return grantCode; } + char dnodeEp[TSDB_EP_LEN] = {0}; + tstrncpy(dnodeEp, ep, TSDB_EP_LEN); + strtrim(dnodeEp); + + char *temp = strchr(dnodeEp, ':'); + if (!temp) { + int len = strlen(dnodeEp); + if (dnodeEp[len - 1] == ';') dnodeEp[len - 1] = 0; + len = strlen(dnodeEp); + snprintf(dnodeEp + len, TSDB_EP_LEN - len, ":%d", tsServerPort); + } + ep = dnodeEp; + SDnodeObj *pDnode = mnodeGetDnodeByEp(ep); if (pDnode != NULL) { mnodeDecDnodeRef(pDnode); - mError("dnode:%d is alredy exist, %s:%d", pDnode->dnodeId, pDnode->dnodeFqdn, pDnode->dnodePort); + mError("dnode:%d is already exist, %s:%d", pDnode->dnodeId, pDnode->dnodeFqdn, pDnode->dnodePort); return TSDB_CODE_MND_DNODE_ALREADY_EXIST; } @@ -507,8 +520,12 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) { static int32_t mnodeDropDnodeByEp(char *ep, SMnodeMsg *pMsg) { SDnodeObj *pDnode = mnodeGetDnodeByEp(ep); if (pDnode == NULL) { - mError("dnode:%s, is not exist", ep); - return TSDB_CODE_MND_DNODE_NOT_EXIST; + int32_t dnodeId = (int32_t)strtol(ep, NULL, 10); + pDnode = mnodeGetDnode(dnodeId); + if (pDnode == NULL) { + mError("dnode:%s, is not exist", ep); + return TSDB_CODE_MND_DNODE_NOT_EXIST; + } } if (strcmp(pDnode->dnodeEp, mnodeGetMnodeMasterEp()) == 0) { From 25eb73d3841103e7c0ad1e36b29521714f47d89b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 17 Jul 2020 09:23:45 +0000 Subject: [PATCH 23/30] [TD-953] --- tests/tsim/src/simExe.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 7826735c2f..3febb927c4 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -21,7 +21,7 @@ #include "tutil.h" #include "cJSON.h" -void simLogSql(char *sql) { +void simLogSql(char *sql, bool useSharp) { static FILE *fp = NULL; char filename[256]; sprintf(filename, "%s/sim.sql", tsScriptDir); @@ -32,7 +32,12 @@ void simLogSql(char *sql) { return; } } - fprintf(fp, "%s;\n", sql); + if (useSharp) { + fprintf(fp, "# %s;\n", sql); + } else { + fprintf(fp, "%s;\n", sql); + } + fflush(fp); } @@ -300,6 +305,7 @@ bool simExecuteSystemCmd(SScript *script, char *option) { sprintf(buf, "cd %s; ", tsScriptDir); simVisuallizeOption(script, option, buf + strlen(buf)); + simLogSql(buf, true); int code = system(buf); int repeatTimes = 0; while (code < 0) { @@ -372,6 +378,10 @@ bool simExecuteSleepCmd(SScript *script, char *option) { taosMsleep(delta); simInfo("script:%s, sleep %dms finished", script->fileName, delta); + char sleepStr[32] = {0}; + sprintf(sleepStr, "sleep %d", delta); + simLogSql(sleepStr, true); + script->linePos++; return true; } @@ -655,7 +665,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { TAOS_RES* pSql = NULL; for (int attempt = 0; attempt < 3; ++attempt) { - simLogSql(rest); + simLogSql(rest, false); pSql = taos_query(script->taos, rest); ret = taos_errno(pSql); From 7748d208af40a9039eb8ef5be4f7f32506652c3a Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 17 Jul 2020 17:53:40 +0800 Subject: [PATCH 24/30] add looply test script of tdengineTest for perf test report. [TD-950] --- tests/perftest-scripts/tdengineTestQ1Loop.sh | 127 +++++++ tests/perftest-scripts/tdengineTestQ2Loop.sh | 348 ++++++++++++++++++ tests/perftest-scripts/tdengineTestQ3Loop.sh | 124 +++++++ tests/perftest-scripts/tdengineTestQ4Loop.sh | 124 +++++++ .../perftest-scripts/tdengineTestWriteLoop.sh | 113 ++++++ 5 files changed, 836 insertions(+) create mode 100755 tests/perftest-scripts/tdengineTestQ1Loop.sh create mode 100755 tests/perftest-scripts/tdengineTestQ2Loop.sh create mode 100755 tests/perftest-scripts/tdengineTestQ3Loop.sh create mode 100755 tests/perftest-scripts/tdengineTestQ4Loop.sh create mode 100755 tests/perftest-scripts/tdengineTestWriteLoop.sh diff --git a/tests/perftest-scripts/tdengineTestQ1Loop.sh b/tests/perftest-scripts/tdengineTestQ1Loop.sh new file mode 100755 index 0000000000..fb2810b00e --- /dev/null +++ b/tests/perftest-scripts/tdengineTestQ1Loop.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TDTESTQ1OUT=tdengineTestQ1.out + +function runTest { + totalG0=0 + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, $TDTEST_DIR/tdengineTest \ + -sql q1.txt" + restartTaosd + $TDTEST_DIR/tdengineTest \ + -sql $TDTEST_DIR/q1.txt > $TDTESTQ1OUT + G0=`grep "devgroup=0" $TDTESTQ1OUT| awk '{print $3}'` + totalG0=`echo "scale=4; $totalG0 + $G0" | bc` + printTo "i: $i, G0: $G0, totalG0:$totalG0" + G10=`grep "devgroup=10" $TDTESTQ1OUT| awk '{print $3}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + printTo "i: $i, G10: $G10, totalG10:$totalG10" + G20=`grep "devgroup=20" $TDTESTQ1OUT| awk '{print $3}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep "devgroup=30" $TDTESTQ1OUT| awk '{print $3}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep "devgroup=40" $TDTESTQ1OUT| awk '{print $3}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep "devgroup=50" $TDTESTQ1OUT| awk '{print $3}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep "devgroup=60" $TDTESTQ1OUT| awk '{print $3}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep "devgroup=70" $TDTESTQ1OUT| awk '{print $3}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep "devgroup=80" $TDTESTQ1OUT| awk '{print $3}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep "devgroup=90" $TDTESTQ1OUT| awk '{print $3}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + printTo "i: $i, G90: $G90, totalG90:$totalG90" + done + avgG0=`echo "scale=4; x = $totalG0 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, G-0, G-10, G-20, G-30, G-40, G-50, G-60, G-70, G-80, G-90" + echo "TDengine, $avgG0, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90" +} + +function restartTaosd { + printTo "Stop taosd" + systemctl stop taosd + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + while [ -n "$PID" ] + do + pkill -TERM -x taosd + sleep 1 + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + done + + printTo "Start taosd" + $TAOSD_DIR/taosd > /dev/null 2>&1 & + sleep 10 +} + +################ Main ################ + +master=false +develop=true +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + ;; + + master) + master=true + develop=false + ;; + + develop) + master=false + develop=true + ;; + *) + ;; + esac +done + +if $master ; then + echo "Test master branch.." + cp /mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine.master +else + echo "Test develop branch.." + cp /mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine +fi + +TAOSD_DIR=$WORK_DIR/debug/build/bin +TDTEST_DIR=$WORK_DIR/tests/comparisonTest/tdengine + +runTest + +echo "Test done!" diff --git a/tests/perftest-scripts/tdengineTestQ2Loop.sh b/tests/perftest-scripts/tdengineTestQ2Loop.sh new file mode 100755 index 0000000000..ede9d98f98 --- /dev/null +++ b/tests/perftest-scripts/tdengineTestQ2Loop.sh @@ -0,0 +1,348 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TDTESTQ2OUT=tdengineTestQ2.out + +function runTest { + totalCount10=0 + totalCount20=0 + totalCount30=0 + totalCount40=0 + totalCount50=0 + totalCount60=0 + totalCount70=0 + totalCount80=0 + totalCount90=0 + totalCount100=0 + + totalAvg10=0 + totalAvg20=0 + totalAvg30=0 + totalAvg40=0 + totalAvg50=0 + totalAvg60=0 + totalAvg70=0 + totalAvg80=0 + totalAvg90=0 + totalAvg100=0 + + totalSum10=0 + totalSum20=0 + totalSum30=0 + totalSum40=0 + totalSum50=0 + totalSum60=0 + totalSum70=0 + totalSum80=0 + totalSum90=0 + totalSum100=0 + + totalMax10=0 + totalMax20=0 + totalMax30=0 + totalMax40=0 + totalMax50=0 + totalMax60=0 + totalMax70=0 + totalMax80=0 + totalMax90=0 + totalMax100=0 + + totalMin10=0 + totalMin20=0 + totalMin30=0 + totalMin40=0 + totalMin50=0 + totalMin60=0 + totalMin70=0 + totalMin80=0 + totalMin90=0 + totalMin100=0 + + totalSpread10=0 + totalSpread20=0 + totalSpread30=0 + totalSpread40=0 + totalSpread50=0 + totalSpread60=0 + totalSpread70=0 + totalSpread80=0 + totalSpread90=0 + totalSpread100=0 + + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, $TDTEST_DIR/tdengineTest \ + -sql q2.txt" + restartTaosd + $TDTEST_DIR/tdengineTest \ + -sql $TDTEST_DIR/q2.txt > $TDTESTQ2OUT + + Count10=`cat $TDTESTQ2OUT | grep "count" | grep "devgroup<10;" | awk '{print $3}'` + totalCount10=`echo "scale=4; $totalCount10 + $Count10" | bc` + Count20=`cat $TDTESTQ2OUT | grep "count" | grep "devgroup<20;" | awk '{print $3}'` + totalCount20=`echo "scale=4; $totalCount20 + $Count20" | bc` + Count30=`cat $TDTESTQ2OUT | grep count | grep "devgroup<30;" | awk '{print $3}'` + totalCount30=`echo "scale=4; $totalCount30 + $Count30" | bc` + Count40=`cat $TDTESTQ2OUT | grep count | grep "devgroup<40;" | awk '{print $3}'` + totalCount40=`echo "scale=4; $totalCount40 + $Count40" | bc` + Count50=`cat $TDTESTQ2OUT | grep count | grep "devgroup<50;" | awk '{print $3}'` + totalCount50=`echo "scale=4; $totalCount50 + $Count50" | bc` + Count60=`cat $TDTESTQ2OUT | grep count | grep "devgroup<60;" | awk '{print $3}'` + totalCount60=`echo "scale=4; $totalCount60 + $Count60" | bc` + Count70=`cat $TDTESTQ2OUT | grep count | grep "devgroup<70;" | awk '{print $3}'` + totalCount70=`echo "scale=4; $totalCount70 + $Count70" | bc` + Count80=`cat $TDTESTQ2OUT | grep count | grep "devgroup<80;" | awk '{print $3}'` + totalCount80=`echo "scale=4; $totalCount80 + $Count80" | bc` + Count90=`cat $TDTESTQ2OUT | grep count | grep "devgroup<90;" | awk '{print $3}'` + totalCount90=`echo "scale=4; $totalCount90 + $Count90" | bc` + Count100=`cat $TDTESTQ2OUT | grep count | grep "db.devices;" | awk '{print $3}'` + totalCount100=`echo "scale=4; $totalCount100 + $Count100" | bc` + + Avg10=`cat $TDTESTQ2OUT | grep "avg" | grep "devgroup<10;" | awk '{print $3}'` + totalAvg10=`echo "scale=4; $totalAvg10 + $Avg10" | bc` + Avg20=`cat $TDTESTQ2OUT | grep "avg" | grep "devgroup<20;" | awk '{print $3}'` + totalAvg20=`echo "scale=4; $totalAvg20 + $Avg20" | bc` + Avg30=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<30;" | awk '{print $3}'` + totalAvg30=`echo "scale=4; $totalAvg30 + $Avg30" | bc` + Avg40=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<40;" | awk '{print $3}'` + totalAvg40=`echo "scale=4; $totalAvg40 + $Avg40" | bc` + Avg50=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<50;" | awk '{print $3}'` + totalAvg50=`echo "scale=4; $totalAvg50 + $Avg50" | bc` + Avg60=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<60;" | awk '{print $3}'` + totalAvg60=`echo "scale=4; $totalAvg60 + $Avg60" | bc` + Avg70=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<70;" | awk '{print $3}'` + totalAvg70=`echo "scale=4; $totalAvg70 + $Avg70" | bc` + Avg80=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<80;" | awk '{print $3}'` + totalAvg80=`echo "scale=4; $totalAvg80 + $Avg80" | bc` + Avg90=`cat $TDTESTQ2OUT | grep avg | grep "devgroup<90;" | awk '{print $3}'` + totalAvg90=`echo "scale=4; $totalAvg90 + $Avg90" | bc` + Avg100=`cat $TDTESTQ2OUT | grep avg | grep "db.devices;" | awk '{print $3}'` + totalAvg100=`echo "scale=4; $totalAvg100 + $Avg100" | bc` + + Sum10=`cat $TDTESTQ2OUT | grep "sum" | grep "devgroup<10;" | awk '{print $3}'` + totalSum10=`echo "scale=4; $totalSum10 + $Sum10" | bc` + Sum20=`cat $TDTESTQ2OUT | grep "sum" | grep "devgroup<20;" | awk '{print $3}'` + totalSum20=`echo "scale=4; $totalSum20 + $Sum20" | bc` + Sum30=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<30;" | awk '{print $3}'` + totalSum30=`echo "scale=4; $totalSum30 + $Sum30" | bc` + Sum40=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<40;" | awk '{print $3}'` + totalSum40=`echo "scale=4; $totalSum40 + $Sum40" | bc` + Sum50=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<50;" | awk '{print $3}'` + totalSum50=`echo "scale=4; $totalSum50 + $Sum50" | bc` + Sum60=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<60;" | awk '{print $3}'` + totalSum60=`echo "scale=4; $totalSum60 + $Sum60" | bc` + Sum70=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<70;" | awk '{print $3}'` + totalSum70=`echo "scale=4; $totalSum70 + $Sum70" | bc` + Sum80=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<80;" | awk '{print $3}'` + totalSum80=`echo "scale=4; $totalSum80 + $Sum80" | bc` + Sum90=`cat $TDTESTQ2OUT | grep sum | grep "devgroup<90;" | awk '{print $3}'` + totalSum90=`echo "scale=4; $totalSum90 + $Sum90" | bc` + Sum100=`cat $TDTESTQ2OUT | grep sum | grep "db.devices;" | awk '{print $3}'` + totalSum100=`echo "scale=4; $totalSum100 + $Sum100" | bc` + + Max10=`cat $TDTESTQ2OUT | grep "max" | grep "devgroup<10;" | awk '{print $3}'` + totalMax10=`echo "scale=4; $totalMax10 + $Max10" | bc` + Max20=`cat $TDTESTQ2OUT | grep "max" | grep "devgroup<20;" | awk '{print $3}'` + totalMax20=`echo "scale=4; $totalMax20 + $Max20" | bc` + Max30=`cat $TDTESTQ2OUT | grep max | grep "devgroup<30;" | awk '{print $3}'` + totalMax30=`echo "scale=4; $totalMax30 + $Max30" | bc` + Max40=`cat $TDTESTQ2OUT | grep max | grep "devgroup<40;" | awk '{print $3}'` + totalMax40=`echo "scale=4; $totalMax40 + $Max40" | bc` + Max50=`cat $TDTESTQ2OUT | grep max | grep "devgroup<50;" | awk '{print $3}'` + totalMax50=`echo "scale=4; $totalMax50 + $Max50" | bc` + Max60=`cat $TDTESTQ2OUT | grep max | grep "devgroup<60;" | awk '{print $3}'` + totalMax60=`echo "scale=4; $totalMax60 + $Max60" | bc` + Max70=`cat $TDTESTQ2OUT | grep max | grep "devgroup<70;" | awk '{print $3}'` + totalMax70=`echo "scale=4; $totalMax70 + $Max70" | bc` + Max80=`cat $TDTESTQ2OUT | grep max | grep "devgroup<80;" | awk '{print $3}'` + totalMax80=`echo "scale=4; $totalMax80 + $Max80" | bc` + Max90=`cat $TDTESTQ2OUT | grep max | grep "devgroup<90;" | awk '{print $3}'` + totalMax90=`echo "scale=4; $totalMax90 + $Max90" | bc` + Max100=`cat $TDTESTQ2OUT | grep max | grep "db.devices;" | awk '{print $3}'` + totalMax100=`echo "scale=4; $totalMax100 + $Max100" | bc` + + Min10=`cat $TDTESTQ2OUT | grep "min" | grep "devgroup<10;" | awk '{print $3}'` + totalMin10=`echo "scale=4; $totalMin10 + $Min10" | bc` + Min20=`cat $TDTESTQ2OUT | grep "min" | grep "devgroup<20;" | awk '{print $3}'` + totalMin20=`echo "scale=4; $totalMin20 + $Min20" | bc` + Min30=`cat $TDTESTQ2OUT | grep min | grep "devgroup<30;" | awk '{print $3}'` + totalMin30=`echo "scale=4; $totalMin30 + $Min30" | bc` + Min40=`cat $TDTESTQ2OUT | grep min | grep "devgroup<40;" | awk '{print $3}'` + totalMin40=`echo "scale=4; $totalMin40 + $Min40" | bc` + Min50=`cat $TDTESTQ2OUT | grep min | grep "devgroup<50;" | awk '{print $3}'` + totalMin50=`echo "scale=4; $totalMin50 + $Min50" | bc` + Min60=`cat $TDTESTQ2OUT | grep min | grep "devgroup<60;" | awk '{print $3}'` + totalMin60=`echo "scale=4; $totalMin60 + $Min60" | bc` + Min70=`cat $TDTESTQ2OUT | grep min | grep "devgroup<70;" | awk '{print $3}'` + totalMin70=`echo "scale=4; $totalMin70 + $Min70" | bc` + Min80=`cat $TDTESTQ2OUT | grep min | grep "devgroup<80;" | awk '{print $3}'` + totalMin80=`echo "scale=4; $totalMin80 + $Min80" | bc` + Min90=`cat $TDTESTQ2OUT | grep min | grep "devgroup<90;" | awk '{print $3}'` + totalMin90=`echo "scale=4; $totalMin90 + $Min90" | bc` + Min100=`cat $TDTESTQ2OUT | grep min | grep "db.devices;" | awk '{print $3}'` + totalMin100=`echo "scale=4; $totalMin100 + $Min100" | bc` + + Spread10=`cat $TDTESTQ2OUT | grep "spread" | grep "devgroup<10;" | awk '{print $3}'` + totalSpread10=`echo "scale=4; $totalSpread10 + $Spread10" | bc` + Spread20=`cat $TDTESTQ2OUT | grep "spread" | grep "devgroup<20;" | awk '{print $3}'` + totalSpread20=`echo "scale=4; $totalSpread20 + $Spread20" | bc` + Spread30=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<30;" | awk '{print $3}'` + totalSpread30=`echo "scale=4; $totalSpread30 + $Spread30" | bc` + Spread40=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<40;" | awk '{print $3}'` + totalSpread40=`echo "scale=4; $totalSpread40 + $Spread40" | bc` + Spread50=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<50;" | awk '{print $3}'` + totalSpread50=`echo "scale=4; $totalSpread50 + $Spread50" | bc` + Spread60=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<60;" | awk '{print $3}'` + totalSpread60=`echo "scale=4; $totalSpread60 + $Spread60" | bc` + Spread70=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<70;" | awk '{print $3}'` + totalSpread70=`echo "scale=4; $totalSpread70 + $Spread70" | bc` + Spread80=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<80;" | awk '{print $3}'` + totalSpread80=`echo "scale=4; $totalSpread80 + $Spread80" | bc` + Spread90=`cat $TDTESTQ2OUT | grep spread | grep "devgroup<90;" | awk '{print $3}'` + totalSpread90=`echo "scale=4; $totalSpread90 + $Spread90" | bc` + Spread100=`cat $TDTESTQ2OUT | grep spread | grep "db.devices;" | awk '{print $3}'` + totalSpread100=`echo "scale=4; $totalSpread100 + $Spread100" | bc` + + done + avgCount10=`echo "scale=4; x = $totalCount10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount20=`echo "scale=4; x = $totalCount20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount30=`echo "scale=4; x = $totalCount30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount40=`echo "scale=4; x = $totalCount40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount50=`echo "scale=4; x = $totalCount50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount60=`echo "scale=4; x = $totalCount60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount70=`echo "scale=4; x = $totalCount70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount80=`echo "scale=4; x = $totalCount80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount90=`echo "scale=4; x = $totalCount90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgCount100=`echo "scale=4; x = $totalCount100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgAvg10=`echo "scale=4; x = $totalAvg10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg20=`echo "scale=4; x = $totalAvg20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg30=`echo "scale=4; x = $totalAvg30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg40=`echo "scale=4; x = $totalAvg40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg50=`echo "scale=4; x = $totalAvg50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg60=`echo "scale=4; x = $totalAvg60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg70=`echo "scale=4; x = $totalAvg70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg80=`echo "scale=4; x = $totalAvg80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg90=`echo "scale=4; x = $totalAvg90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgAvg100=`echo "scale=4; x = $totalAvg100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgSum10=`echo "scale=4; x = $totalSum10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum20=`echo "scale=4; x = $totalSum20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum30=`echo "scale=4; x = $totalSum30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum40=`echo "scale=4; x = $totalSum40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum50=`echo "scale=4; x = $totalSum50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum60=`echo "scale=4; x = $totalSum60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum70=`echo "scale=4; x = $totalSum70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum80=`echo "scale=4; x = $totalSum80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum90=`echo "scale=4; x = $totalSum90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSum100=`echo "scale=4; x = $totalSum100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgMax10=`echo "scale=4; x = $totalMax10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax20=`echo "scale=4; x = $totalMax20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax30=`echo "scale=4; x = $totalMax30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax40=`echo "scale=4; x = $totalMax40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax50=`echo "scale=4; x = $totalMax50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax60=`echo "scale=4; x = $totalMax60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax70=`echo "scale=4; x = $totalMax70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax80=`echo "scale=4; x = $totalMax80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax90=`echo "scale=4; x = $totalMax90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMax100=`echo "scale=4; x = $totalMax100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgMin10=`echo "scale=4; x = $totalMin10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin20=`echo "scale=4; x = $totalMin20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin30=`echo "scale=4; x = $totalMin30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin40=`echo "scale=4; x = $totalMin40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin50=`echo "scale=4; x = $totalMin50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin60=`echo "scale=4; x = $totalMin60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin70=`echo "scale=4; x = $totalMin70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin80=`echo "scale=4; x = $totalMin80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin90=`echo "scale=4; x = $totalMin90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgMin100=`echo "scale=4; x = $totalMin100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + avgSpread10=`echo "scale=4; x = $totalSpread10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread20=`echo "scale=4; x = $totalSpread20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread30=`echo "scale=4; x = $totalSpread30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread40=`echo "scale=4; x = $totalSpread40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread50=`echo "scale=4; x = $totalSpread50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread60=`echo "scale=4; x = $totalSpread60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread70=`echo "scale=4; x = $totalSpread70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread80=`echo "scale=4; x = $totalSpread80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread90=`echo "scale=4; x = $totalSpread90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgSpread100=`echo "scale=4; x = $totalSpread100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "Count, $avgCount10, $avgCount20, $avgCount30, $avgCount40, $avgCount50, $avgCount60, $avgCount70, $avgCount80, $avgCount90, $avgCount100" + echo "Avg, $avgAvg10, $avgAvg20, $avgAvg30, $avgAvg40, $avgAvg50, $avgAvg60, $avgAvg70, $avgAvg80, $avgAvg90, $avgAvg100" + echo "Sum, $avgSum10, $avgSum20, $avgSum30, $avgSum40, $avgSum50, $avgSum60, $avgSum70, $avgSum80, $avgSum90, $avgSum100" + echo "Max, $avgMax10, $avgMax20, $avgMax30, $avgMax40, $avgMax50, $avgMax60, $avgMax70, $avgMax80, $avgMax90, $avgMax100" + echo "Min, $avgMin10, $avgMin20, $avgMin30, $avgMin40, $avgMin50, $avgMin60, $avgMin70, $avgMin80, $avgMin90, $avgMin100" + echo "Spread, $avgSpread10, $avgSpread20, $avgSpread30, $avgSpread40, $avgSpread50, $avgSpread60, $avgSpread70, $avgSpread80, $avgSpread90, $avgSpread100" +} + +function restartTaosd { + printTo "Stop taosd" + systemctl stop taosd + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + while [ -n "$PID" ] + do + pkill -TERM -x taosd + sleep 1 + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + done + + printTo "Start taosd" + $TAOSD_DIR/taosd > /dev/null 2>&1 & + sleep 10 +} + +################ Main ################ + +master=false +develop=true +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + ;; + + master) + master=true + develop=false + ;; + + develop) + master=false + develop=true + ;; + *) + ;; + esac +done + +if $master ; then + echo "Test master branch.." + cp /mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine.master +else + echo "Test develop branch.." + cp /mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine +fi + +TAOSD_DIR=$WORK_DIR/debug/build/bin +TDTEST_DIR=$WORK_DIR/tests/comparisonTest/tdengine + +runTest + +echo "Test done!" diff --git a/tests/perftest-scripts/tdengineTestQ3Loop.sh b/tests/perftest-scripts/tdengineTestQ3Loop.sh new file mode 100755 index 0000000000..f59f637258 --- /dev/null +++ b/tests/perftest-scripts/tdengineTestQ3Loop.sh @@ -0,0 +1,124 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TDTESTQ3OUT=tdengineTestQ3.out + +function runTest { + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + totalG100=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, $TDTEST_DIR/tdengineTest \ + -sql q3.txt" + restartTaosd + $TDTEST_DIR/tdengineTest \ + -sql $TDTEST_DIR/q3.txt > $TDTESTQ3OUT + G10=`grep "devgroup<10" $TDTESTQ3OUT| awk '{print $3}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + G20=`grep "devgroup<20" $TDTESTQ3OUT| awk '{print $3}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep "devgroup<30" $TDTESTQ3OUT| awk '{print $3}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep "devgroup<40" $TDTESTQ3OUT| awk '{print $3}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep "devgroup<50" $TDTESTQ3OUT| awk '{print $3}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep "devgroup<60" $TDTESTQ3OUT| awk '{print $3}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep "devgroup<70" $TDTESTQ3OUT| awk '{print $3}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep "devgroup<80" $TDTESTQ3OUT| awk '{print $3}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep "devgroup<90" $TDTESTQ3OUT| awk '{print $3}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + G100=`grep "db.devices group by devgroup;" $TDTESTQ3OUT| awk '{print $3}'` + totalG100=`echo "scale=4; $totalG100 + $G100" | bc` + done + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG100=`echo "scale=4; x = $totalG100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "TDengine, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90, $avgG100" +} + +function restartTaosd { + printTo "Stop taosd" + systemctl stop taosd + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + while [ -n "$PID" ] + do + pkill -TERM -x taosd + sleep 1 + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + done + + printTo "Start taosd" + $TAOSD_DIR/taosd > /dev/null 2>&1 & + sleep 10 +} + +################ Main ################ + +master=false +develop=true +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + ;; + + master) + master=true + develop=false + ;; + + develop) + master=false + develop=true + ;; + *) + ;; + esac +done + +if $master ; then + echo "Test master branch.." + cp /mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine.master +else + echo "Test develop branch.." + cp /mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine +fi + +TAOSD_DIR=$WORK_DIR/debug/build/bin +TDTEST_DIR=$WORK_DIR/tests/comparisonTest/tdengine + +runTest + +echo "Test done!" diff --git a/tests/perftest-scripts/tdengineTestQ4Loop.sh b/tests/perftest-scripts/tdengineTestQ4Loop.sh new file mode 100755 index 0000000000..8ea3cb4023 --- /dev/null +++ b/tests/perftest-scripts/tdengineTestQ4Loop.sh @@ -0,0 +1,124 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 + +function printTo { + if $verbose ; then + echo $1 + fi +} + +TDTESTQ4OUT=tdengineTestQ4.out + +function runTest { + totalG10=0 + totalG20=0 + totalG30=0 + totalG40=0 + totalG50=0 + totalG60=0 + totalG70=0 + totalG80=0 + totalG90=0 + totalG100=0 + for i in `seq 1 $NUM_LOOP`; do + printTo "loop i:$i, $TDTEST_DIR/tdengineTest \ + -sql q4.txt" + restartTaosd + $TDTEST_DIR/tdengineTest \ + -sql $TDTEST_DIR/q4.txt > $TDTESTQ4OUT + G10=`grep "devgroup<10" $TDTESTQ4OUT| awk '{print $3}'` + totalG10=`echo "scale=4; $totalG10 + $G10" | bc` + G20=`grep "devgroup<20" $TDTESTQ4OUT| awk '{print $3}'` + totalG20=`echo "scale=4; $totalG20 + $G20" | bc` + G30=`grep "devgroup<30" $TDTESTQ4OUT| awk '{print $3}'` + totalG30=`echo "scale=4; $totalG30 + $G30" | bc` + G40=`grep "devgroup<40" $TDTESTQ4OUT| awk '{print $3}'` + totalG40=`echo "scale=4; $totalG40 + $G40" | bc` + G50=`grep "devgroup<50" $TDTESTQ4OUT| awk '{print $3}'` + totalG50=`echo "scale=4; $totalG50 + $G50" | bc` + G60=`grep "devgroup<60" $TDTESTQ4OUT| awk '{print $3}'` + totalG60=`echo "scale=4; $totalG60 + $G60" | bc` + G70=`grep "devgroup<70" $TDTESTQ4OUT| awk '{print $3}'` + totalG70=`echo "scale=4; $totalG70 + $G70" | bc` + G80=`grep "devgroup<80" $TDTESTQ4OUT| awk '{print $3}'` + totalG80=`echo "scale=4; $totalG80 + $G80" | bc` + G90=`grep "devgroup<90" $TDTESTQ4OUT| awk '{print $3}'` + totalG90=`echo "scale=4; $totalG90 + $G90" | bc` + G100=`grep "db.devices interval" $TDTESTQ4OUT| awk '{print $3}'` + totalG100=`echo "scale=4; $totalG100 + $G100" | bc` + done + avgG10=`echo "scale=4; x = $totalG10 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG20=`echo "scale=4; x = $totalG20 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG30=`echo "scale=4; x = $totalG30 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG40=`echo "scale=4; x = $totalG40 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG50=`echo "scale=4; x = $totalG50 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG60=`echo "scale=4; x = $totalG60 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG70=`echo "scale=4; x = $totalG70 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG80=`echo "scale=4; x = $totalG80 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG90=`echo "scale=4; x = $totalG90 / $NUM_LOOP; if(x<1) print 0; x" | bc` + avgG100=`echo "scale=4; x = $totalG100 / $NUM_LOOP; if(x<1) print 0; x" | bc` + echo "Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%" + echo "TDengine, $avgG10, $avgG20, $avgG30, $avgG40, $avgG50, $avgG60, $avgG70, $avgG80, $avgG90, $avgG100" +} + +function restartTaosd { + printTo "Stop taosd" + systemctl stop taosd + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + while [ -n "$PID" ] + do + pkill -TERM -x taosd + sleep 1 + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + done + + printTo "Start taosd" + $TAOSD_DIR/taosd > /dev/null 2>&1 & + sleep 10 +} + +################ Main ################ + +master=false +develop=true +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + ;; + + master) + master=true + develop=false + ;; + + develop) + master=false + develop=true + ;; + *) + ;; + esac +done + +if $master ; then + echo "Test master branch.." + cp /mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine.master +else + echo "Test develop branch.." + cp /mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine +fi + +TAOSD_DIR=$WORK_DIR/debug/build/bin +TDTEST_DIR=$WORK_DIR/tests/comparisonTest/tdengine + +runTest + +echo "Test done!" diff --git a/tests/perftest-scripts/tdengineTestWriteLoop.sh b/tests/perftest-scripts/tdengineTestWriteLoop.sh new file mode 100755 index 0000000000..9f54bb6fc3 --- /dev/null +++ b/tests/perftest-scripts/tdengineTestWriteLoop.sh @@ -0,0 +1,113 @@ +#!/bin/bash + +DATA_DIR=/mnt/root/testdata +NUM_LOOP=5 +NUM_OF_FILES=100 + +rowsPerRequest=(1 100 500 1000 2000) +numOfClients=(1 2 3 4 5 6 7) + +function printTo { + if $verbose ; then + echo $1 + fi +} + +function runTest { + printf "R/R, " + for c in ${numOfClients[@]}; do + if [ "$c" == "1" ]; then + printf "$c client, " + else + printf "$c clients, " + fi + done + printf "\n" + + for r in ${rowsPerRequest[@]}; do + printf "$r, " + for c in ${numOfClients[@]}; do + totalRPR=0 + for i in `seq 1 $NUM_LOOP`; do + restartTaosd + $TAOSD_DIR/taos -s "drop database db" > /dev/null 2>&1 + printTo "loop i:$i, $TDTEST_DIR/tdengineTest \ + -dataDir $DATA_DIR \ + -numOfFiles $NUM_OF_FILES \ + -writeClients $c \ + -rowsPerRequest $r" + RPR=`$TDTEST_DIR/tdengineTest \ + -dataDir $DATA_DIR \ + -numOfFiles 1 \ + -writeClients $c \ + -rowsPerRequest $r \ + | grep speed | awk '{print $(NF-1)}'` + totalRPR=`echo "scale=4; $totalRPR + $RPR" | bc` + printTo "rows:$r, clients:$c, i:$i RPR:$RPR" + done + avgRPR=`echo "scale=4; $totalRPR / $NUM_LOOP" | bc` + printf "$avgRPR, " + done + printf "\n" + done +} + +function restartTaosd { + printTo "Stop taosd" + systemctl stop taosd + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + while [ -n "$PID" ] + do + pkill -TERM -x taosd + sleep 1 + PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + done + + printTo "Start taosd" + $TAOSD_DIR/taosd > /dev/null 2>&1 & + sleep 10 +} + +################ Main ################ + +master=false +develop=true +verbose=false + +for arg in "$@" +do + case $arg in + -v) + verbose=true + ;; + + master) + master=true + develop=false + ;; + + develop) + master=false + develop=true + ;; + *) + ;; + esac +done + +if $master ; then + echo "Test master branch.." + cp /mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine.master +else + echo "Test develop branch.." + cp /mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg + WORK_DIR=/mnt/root/TDengine +fi + +TAOSD_DIR=$WORK_DIR/debug/build/bin +TDTEST_DIR=$WORK_DIR/tests/comparisonTest/tdengine + +runTest + +echo "Test done!" From a174735c35501a58d548bfbdeaa134069cd08bab Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 19:08:22 +0800 Subject: [PATCH 25/30] [td-225] fix compiler error. --- src/tsdb/src/tsdbRead.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index d63b6525bc..884b52a54a 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1525,7 +1525,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { pQueryHandle->cur.win = (STimeWindow){pQueryHandle->window.skey, pQueryHandle->window.skey}; pQueryHandle->window = pQueryHandle->cur.win; pQueryHandle->cur.rows = 1; - pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL; + pQueryHandle->type = TSDB_QUERY_TYPE_ALL; return true; } else { STsdbQueryHandle* pSecQueryHandle = calloc(1, sizeof(STsdbQueryHandle)); @@ -1584,8 +1584,8 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { bool ret = tsdbNextDataBlock((void*) pSecQueryHandle); assert(ret); - /*SDataBlockInfo* pBlockInfo =*/ tsdbRetrieveDataBlockInfo((void*) pSecQueryHandle, &blockInfo); - /*SArray *pDataBlock = */tsdbRetrieveDataBlock((void*) pSecQueryHandle, pSecQueryHandle->defaultLoadColumn); + tsdbRetrieveDataBlockInfo((void*) pSecQueryHandle, &blockInfo); + tsdbRetrieveDataBlock((void*) pSecQueryHandle, pSecQueryHandle->defaultLoadColumn); for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); @@ -1598,15 +1598,25 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { } SColumnInfoData* pTSCol = taosArrayGet(pQueryHandle->pColumns, 0); - + + // it is ascending order pQueryHandle->cur.win = (STimeWindow){((TSKEY*)pTSCol->pData)[0], ((TSKEY*)pTSCol->pData)[1]}; pQueryHandle->window = pQueryHandle->cur.win; pQueryHandle->cur.rows = 2; - + pQueryHandle->cur.mixBlock = true; + pQueryHandle->order = TSDB_ORDER_ASC; + + int32_t step = -1; + for (int32_t j = 0; j < si; ++j) { + STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j); + pCheckInfo->lastKey = pQueryHandle->cur.win.ekey + step; + } + tsdbCleanupQueryHandle(pSecQueryHandle); } - - pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL; + +// disable it after retrieve data + pQueryHandle->type = TSDB_QUERY_TYPE_ALL; return true; } From d896fc19d691ebeccfdcb1caf70bef03d3853144 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 17 Jul 2020 14:39:47 +0000 Subject: [PATCH 26/30] [TD-913] --- src/common/inc/tglobal.h | 2 -- src/common/src/tglobal.c | 21 +------------------ src/dnode/src/dnodeMgmt.c | 1 - src/inc/taosdef.h | 3 +-- src/inc/taosmsg.h | 4 ++-- src/mnode/inc/mnodeDef.h | 6 +++--- src/mnode/src/mnodeDnode.c | 13 +++++------- src/mnode/src/mnodeVgroup.c | 11 +++++----- tests/script/sh/deploy.sh | 1 - .../arbitrator/dn2_mn1_cache_file_sync.sim | 8 +++---- .../dn3_mn1_full_createTableFail.sim | 8 +++---- .../arbitrator/dn3_mn1_full_dropDnodeFail.sim | 8 +++---- .../dn3_mn1_multiCreateDropTable.sim | 8 +++---- ...3_mn1_nw_disable_timeout_autoDropDnode.sim | 8 +++---- .../arbitrator/dn3_mn1_r2_vnode_delDir.sim | 8 +++---- .../arbitrator/dn3_mn1_r3_vnode_delDir.sim | 8 +++---- .../dn3_mn1_replica2_wal1_AddDelDnode.sim | 12 +++++------ .../arbitrator/dn3_mn1_replica_change.sim | 8 +++---- .../dn3_mn1_replica_change_dropDnod.sim | 8 +++---- .../arbitrator/dn3_mn1_stopDnode_timeout.sim | 10 ++++----- .../arbitrator/dn3_mn1_vnode_change.sim | 8 +++---- .../dn3_mn1_vnode_corruptFile_offline.sim | 8 +++---- .../dn3_mn1_vnode_corruptFile_online.sim | 8 +++---- .../dn3_mn1_vnode_createErrData_online.sim | 8 +++---- .../arbitrator/dn3_mn1_vnode_delDir.sim | 8 +++---- .../dn3_mn1_vnode_noCorruptFile_offline.sim | 8 +++---- .../arbitrator/dn3_mn1_vnode_nomaster.sim | 8 +++---- .../unique/arbitrator/dn3_mn2_killDnode.sim | 8 +++---- .../arbitrator/insert_duplicationTs.sim | 8 +++---- .../offline_replica2_alterTable_online.sim | 8 +++---- .../offline_replica2_alterTag_online.sim | 8 +++---- .../offline_replica2_createTable_online.sim | 8 +++---- .../offline_replica2_dropDb_online.sim | 8 +++---- .../offline_replica2_dropTable_online.sim | 8 +++---- .../offline_replica3_alterTable_online.sim | 8 +++---- .../offline_replica3_alterTag_online.sim | 8 +++---- .../offline_replica3_createTable_online.sim | 8 +++---- .../offline_replica3_dropDb_online.sim | 8 +++---- .../offline_replica3_dropTable_online.sim | 8 +++---- .../replica_changeWithArbitrator.sim | 12 +++++------ .../sync_replica2_alterTable_add.sim | 8 +++---- .../sync_replica2_alterTable_drop.sim | 8 +++---- .../arbitrator/sync_replica2_dropDb.sim | 8 +++---- .../arbitrator/sync_replica2_dropTable.sim | 8 +++---- .../sync_replica3_alterTable_add.sim | 8 +++---- .../sync_replica3_alterTable_drop.sim | 8 +++---- .../arbitrator/sync_replica3_createTable.sim | 8 +++---- ...ca3_dnodeChang_DropAddAlterTableDropDb.sim | 8 +++---- .../arbitrator/sync_replica3_dropDb.sim | 8 +++---- .../arbitrator/sync_replica3_dropTable.sim | 8 +++---- tests/script/unique/cluster/cluster_main.sim | 10 ++++----- tests/script/unique/cluster/cluster_main0.sim | 10 ++++----- tests/script/unique/cluster/cluster_main1.sim | 10 ++++----- tests/script/unique/cluster/cluster_main2.sim | 10 ++++----- tests/script/unique/dnode/alternativeRole.sim | 6 +++--- .../migrate/mn2_vn2_repl2_rmMnodeDir.sim | 8 +++---- .../migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim | 8 +++---- ..._repl2_rmMnodeVnodeDir_stopAll_starAll.sim | 8 +++---- .../migrate/mn2_vn2_repl2_rmVnodeDir.sim | 8 +++---- 59 files changed, 226 insertions(+), 252 deletions(-) diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index c42fccc372..6506707457 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -30,8 +30,6 @@ extern uint16_t tsDnodeShellPort; extern uint16_t tsDnodeDnodePort; extern uint16_t tsSyncPort; extern int32_t tsStatusInterval; -extern int16_t tsNumOfVnodesPerCore; -extern int16_t tsNumOfTotalVnodes; extern int32_t tsNumOfMnodes; extern int32_t tsEnableVnodeBak; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 5462e2f468..56c63ee49d 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -38,12 +38,9 @@ uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035] uint16_t tsDnodeDnodePort = 6035; // udp/tcp uint16_t tsSyncPort = 6040; int32_t tsStatusInterval = 1; // second -int16_t tsNumOfVnodesPerCore = 32; -int16_t tsNumOfTotalVnodes = TSDB_INVALID_VNODE_NUM; int32_t tsNumOfMnodes = 3; int32_t tsEnableVnodeBak = 1; - // common int32_t tsRpcTimer = 1000; int32_t tsRpcMaxTime = 600; // seconds; @@ -402,16 +399,6 @@ static void doInitGlobalConfig() { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - cfg.option = "numOfTotalVnodes"; - cfg.ptr = &tsNumOfTotalVnodes; - cfg.valType = TAOS_CFG_VTYPE_INT16; - cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; - cfg.minValue = 0; - cfg.maxValue = TSDB_MAX_VNODES; - cfg.ptrLength = 0; - cfg.unitType = TAOS_CFG_UTYPE_NONE; - taosInitConfigOption(cfg); - cfg.option = "numOfMnodes"; cfg.ptr = &tsNumOfMnodes; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -453,7 +440,7 @@ static void doInitGlobalConfig() { taosInitConfigOption(cfg); // 0-any; 1-mnode; 2-vnode - cfg.option = "alternativeRole"; + cfg.option = "role"; cfg.ptr = &tsAlternativeRole; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; @@ -1280,12 +1267,6 @@ bool taosCheckGlobalCfg() { tsNumOfCores = 1; } - if (tsNumOfTotalVnodes == TSDB_INVALID_VNODE_NUM) { - tsNumOfTotalVnodes = tsNumOfCores * tsNumOfVnodesPerCore; - tsNumOfTotalVnodes = tsNumOfTotalVnodes > TSDB_MAX_VNODES ? TSDB_MAX_VNODES : tsNumOfTotalVnodes; - tsNumOfTotalVnodes = tsNumOfTotalVnodes < TSDB_MIN_VNODES ? TSDB_MIN_VNODES : tsNumOfTotalVnodes; - } - // todo refactor tsVersion = 0; for (int i = 0; i < 10; i++) { diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index 8e1696c802..7d3ef9926d 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -699,7 +699,6 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) { pStatus->dnodeId = htonl(tsDnodeCfg.dnodeId); strcpy(pStatus->dnodeEp, tsLocalEp); pStatus->lastReboot = htonl(tsRebootTime); - pStatus->numOfTotalVnodes = htons((uint16_t) tsNumOfTotalVnodes); pStatus->numOfCores = htons((uint16_t) tsNumOfCores); pStatus->diskAvailable = tsAvailDataDirGB; pStatus->alternativeRole = (uint8_t) tsAlternativeRole; diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index db0333a7c5..30523dc25c 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -274,9 +274,8 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value #define TSDB_EXTRA_PAYLOAD_SIZE 128 // extra bytes for auth #define TSDB_CQ_SQL_SIZE 1024 +#define TSDB_MIN_VNODES 64 #define TSDB_MAX_VNODES 2048 -#define TSDB_MIN_VNODES 256 -#define TSDB_INVALID_VNODE_NUM 0 #define TSDB_DNODE_ROLE_ANY 0 #define TSDB_DNODE_ROLE_MGMT 1 diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index b7afaf1e06..a367d6b93b 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -581,12 +581,12 @@ typedef struct { char dnodeEp[TSDB_EP_LEN]; uint32_t moduleStatus; uint32_t lastReboot; // time stamp for last reboot - uint16_t numOfTotalVnodes; // from config file + uint16_t reserve1; // from config file uint16_t openVnodes; uint16_t numOfCores; float diskAvailable; // GB uint8_t alternativeRole; - uint8_t reserve[15]; + uint8_t reserve2[15]; SClusterCfg clusterCfg; SVnodeLoad load[]; } SDMStatusMsg; diff --git a/src/mnode/inc/mnodeDef.h b/src/mnode/inc/mnodeDef.h index b7489a9fc5..3154a441ca 100644 --- a/src/mnode/inc/mnodeDef.h +++ b/src/mnode/inc/mnodeDef.h @@ -40,7 +40,7 @@ typedef struct SDnodeObj { int32_t dnodeId; int32_t openVnodes; int64_t createdTime; - int32_t totalVnodes; // from dnode status msg, config information + int32_t resever0; // from dnode status msg, config information int32_t customScore; // config by user uint32_t lastAccess; uint16_t numOfCores; // from dnode status msg @@ -50,7 +50,7 @@ typedef struct SDnodeObj { int8_t alternativeRole; // from dnode status msg, 0-any, 1-mgmt, 2-dnode int8_t status; // set in balance function int8_t isMgmt; - int8_t reserved0[14]; + int8_t reserve1[14]; int8_t updateEnd[1]; int32_t refCount; uint32_t moduleStatus; @@ -61,7 +61,7 @@ typedef struct SDnodeObj { int16_t cpuAvgUsage; // calc from sys.cpu int16_t memoryAvgUsage; // calc from sys.mem int16_t bandwidthUsage; // calc from sys.band - int8_t reserved1[2]; + int8_t reserved2[2]; } SDnodeObj; typedef struct SMnodeObj { diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index 28986d6886..9085f1a9f7 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -345,8 +345,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { pStatus->moduleStatus = htonl(pStatus->moduleStatus); pStatus->lastReboot = htonl(pStatus->lastReboot); pStatus->numOfCores = htons(pStatus->numOfCores); - pStatus->numOfTotalVnodes = htons(pStatus->numOfTotalVnodes); - + uint32_t version = htonl(pStatus->version); if (version != tsVersion) { mError("status msg version:%d not equal with mnode:%d", version, tsVersion); @@ -372,7 +371,6 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { pDnode->numOfCores = pStatus->numOfCores; pDnode->diskAvailable = pStatus->diskAvailable; pDnode->alternativeRole = pStatus->alternativeRole; - pDnode->totalVnodes = pStatus->numOfTotalVnodes; pDnode->moduleStatus = pStatus->moduleStatus; if (pStatus->dnodeId == 0) { @@ -475,7 +473,6 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) { pDnode = (SDnodeObj *) calloc(1, sizeof(SDnodeObj)); pDnode->createdTime = taosGetTimestampMs(); pDnode->status = TAOS_DN_STATUS_OFFLINE; - pDnode->totalVnodes = TSDB_INVALID_VNODE_NUM; tstrncpy(pDnode->dnodeEp, ep, TSDB_EP_LEN); taosGetFqdnPortFromEp(ep, pDnode->dnodeFqdn, &pDnode->dnodePort); @@ -592,13 +589,13 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC pShow->bytes[cols] = 2; pSchema[cols].type = TSDB_DATA_TYPE_SMALLINT; - strcpy(pSchema[cols].name, "open_vnodes"); + strcpy(pSchema[cols].name, "vnodes"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; pShow->bytes[cols] = 2; pSchema[cols].type = TSDB_DATA_TYPE_SMALLINT; - strcpy(pSchema[cols].name, "total_vnodes"); + strcpy(pSchema[cols].name, "cores"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; @@ -610,7 +607,7 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC pShow->bytes[cols] = 6 + VARSTR_HEADER_SIZE; pSchema[cols].type = TSDB_DATA_TYPE_BINARY; - strcpy(pSchema[cols].name, "alternativeRole"); + strcpy(pSchema[cols].name, "role"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; @@ -662,7 +659,7 @@ static int32_t mnodeRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, vo cols++; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - *(int16_t *)pWrite = pDnode->totalVnodes; + *(int16_t *)pWrite = pDnode->numOfCores; cols++; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index 8c8aa5fb31..5f24981b50 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -585,9 +585,9 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; - pShow->bytes[cols] = 4; - pSchema[cols].type = TSDB_DATA_TYPE_INT; - strcpy(pSchema[cols].name, "poolSize"); + pShow->bytes[cols] = 12 + VARSTR_HEADER_SIZE; + pSchema[cols].type = TSDB_DATA_TYPE_BINARY; + strcpy(pSchema[cols].name, "status"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; @@ -688,8 +688,9 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v *(int32_t *) pWrite = pVgroup->numOfTables; cols++; - pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - *(int32_t *)pWrite = taosIdPoolMaxSize(pVgroup->idPool); + pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; + char* status = vgroupStatus[pVgroup->status]; + STR_TO_VARSTR(pWrite, status); cols++; int32_t onlineVnodes = 0; diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh index b9a9e4f024..adbb8207be 100755 --- a/tests/script/sh/deploy.sh +++ b/tests/script/sh/deploy.sh @@ -139,7 +139,6 @@ echo "clog 2" >> $TAOS_CFG #echo "cache 1" >> $TAOS_CFG #echo "block 2" >> $TAOS_CFG echo "statusInterval 1" >> $TAOS_CFG -echo "numOfTotalVnodes 4" >> $TAOS_CFG echo "maxVgroupsPerDb 4" >> $TAOS_CFG echo "minTablesPerVnode 4" >> $TAOS_CFG echo "maxTablesPerVnode 1000" >> $TAOS_CFG diff --git a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim index 193a54ac6a..fd7b55a4fc 100644 --- a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim +++ b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim @@ -34,10 +34,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim b/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim index c373bce188..24276f436b 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim b/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim index 29fa60de94..8d4da4d2bf 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim b/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim index 5827b25ff4..092e49659d 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim b/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim index ac2b8365f9..c30a1fd1bc 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim @@ -29,10 +29,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator diff --git a/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim index dd101bc97c..00c95d7a02 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim index 6cd2e0cca3..9b823755d8 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim b/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim index 26f45cf645..4873577782 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim @@ -47,11 +47,11 @@ system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 200 system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode5 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 +system sh/cfg.sh -n dnode5 -c role -v 2 system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator @@ -217,7 +217,7 @@ system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1 diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim b/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim index 8abd4460c5..ccc23406c9 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim b/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim index 654983bb0f..792a4d42c3 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim b/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim index 32674acade..972a156e3a 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim @@ -29,10 +29,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator @@ -180,7 +180,7 @@ system sh/cfg.sh -n dnode4 -c walLevel -v 1 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator system sh/cfg.sh -n dnode4 -c offlineThreshold -v 5 system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim index 3c47fdf93b..5002a79652 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim index 6b107aed60..333755d091 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim index 7e71fe3a8d..c34da0b2db 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim index 8cd31e4de6..aca03789cd 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim index 43538cf95a..de219082d7 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim index 5b5a9deffa..f392acada6 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim index 7696168bb9..22c5b6d6d6 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim b/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim index acf157a93a..b5aacfc718 100644 --- a/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode1 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +#system sh/cfg.sh -n dnode1 -c role -v 2 +#system sh/cfg.sh -n dnode2 -c role -v 2 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/insert_duplicationTs.sim b/tests/script/unique/arbitrator/insert_duplicationTs.sim index b9aff29f0c..67db91f1ac 100644 --- a/tests/script/unique/arbitrator/insert_duplicationTs.sim +++ b/tests/script/unique/arbitrator/insert_duplicationTs.sim @@ -34,10 +34,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim index ea5e7608ee..1375d3d9e2 100644 --- a/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim b/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim index 6fa1da4e1d..10d2c0b2a5 100644 --- a/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -#system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +#system sh/cfg.sh -n dnode1 -c role -v 1 +#system sh/cfg.sh -n dnode2 -c role -v 2 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim index 1d2a83c825..9e0c4e5a89 100644 --- a/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 diff --git a/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim b/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim index 630b4eaab8..41cd8bdd90 100644 --- a/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim index 43dba536c7..127468993b 100644 --- a/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim index 09a2424c85..d50a049926 100644 --- a/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim b/tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim index d94f341236..13d88f0f38 100644 --- a/tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim @@ -19,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -#system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -#system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +#system sh/cfg.sh -n dnode1 -c role -v 1 +#system sh/cfg.sh -n dnode2 -c role -v 2 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 diff --git a/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim index fc1c69709a..396fb43178 100644 --- a/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 diff --git a/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim b/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim index 72727f3df0..20d9e9c958 100644 --- a/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim index 7e57b0a971..bad158b003 100644 --- a/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim b/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim index a16e765a30..f4a4e01e63 100644 --- a/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim +++ b/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim @@ -29,10 +29,10 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +system sh/cfg.sh -n dnode3 -c role -v 0 +system sh/cfg.sh -n dnode4 -c role -v 0 $totalTableNum = 12 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum @@ -150,8 +150,8 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2 system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 0 system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s start diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim b/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim index 8775da607c..cf39adf19e 100644 --- a/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim +++ b/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim b/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim index 84ae9554f3..90297660c4 100644 --- a/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim +++ b/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica2_dropDb.sim b/tests/script/unique/arbitrator/sync_replica2_dropDb.sim index c9dc302d3c..18b9173400 100644 --- a/tests/script/unique/arbitrator/sync_replica2_dropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica2_dropDb.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica2_dropTable.sim b/tests/script/unique/arbitrator/sync_replica2_dropTable.sim index b7392eb960..b7874fa60c 100644 --- a/tests/script/unique/arbitrator/sync_replica2_dropTable.sim +++ b/tests/script/unique/arbitrator/sync_replica2_dropTable.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim b/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim index 2fde90f3db..b48f5f1a95 100644 --- a/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim +++ b/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim b/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim index f31d01b327..776bc8a66d 100644 --- a/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim +++ b/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_createTable.sim b/tests/script/unique/arbitrator/sync_replica3_createTable.sim index a07e6dc93d..c67dcb94f9 100644 --- a/tests/script/unique/arbitrator/sync_replica3_createTable.sim +++ b/tests/script/unique/arbitrator/sync_replica3_createTable.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim b/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim index c8663b0009..3b517145a6 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 40 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_dropDb.sim b/tests/script/unique/arbitrator/sync_replica3_dropDb.sim index fd07fda2d4..c9c82ae965 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dropDb.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/arbitrator/sync_replica3_dropTable.sim b/tests/script/unique/arbitrator/sync_replica3_dropTable.sim index 1749477d64..b24348db68 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dropTable.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dropTable.sim @@ -24,10 +24,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 2 +system sh/cfg.sh -n dnode4 -c role -v 2 $totalTableNum = 10 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum diff --git a/tests/script/unique/cluster/cluster_main.sim b/tests/script/unique/cluster/cluster_main.sim index 4c02d416f3..e0b555e412 100644 --- a/tests/script/unique/cluster/cluster_main.sim +++ b/tests/script/unique/cluster/cluster_main.sim @@ -29,11 +29,11 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode5 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +system sh/cfg.sh -n dnode3 -c role -v 0 +system sh/cfg.sh -n dnode4 -c role -v 0 +system sh/cfg.sh -n dnode5 -c role -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000 diff --git a/tests/script/unique/cluster/cluster_main0.sim b/tests/script/unique/cluster/cluster_main0.sim index f3cce9fd45..771edd9fe7 100644 --- a/tests/script/unique/cluster/cluster_main0.sim +++ b/tests/script/unique/cluster/cluster_main0.sim @@ -29,11 +29,11 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode5 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +system sh/cfg.sh -n dnode3 -c role -v 0 +system sh/cfg.sh -n dnode4 -c role -v 0 +system sh/cfg.sh -n dnode5 -c role -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000 diff --git a/tests/script/unique/cluster/cluster_main1.sim b/tests/script/unique/cluster/cluster_main1.sim index e05c30aa6d..ac3d5f9b13 100644 --- a/tests/script/unique/cluster/cluster_main1.sim +++ b/tests/script/unique/cluster/cluster_main1.sim @@ -29,11 +29,11 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode5 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +system sh/cfg.sh -n dnode3 -c role -v 0 +system sh/cfg.sh -n dnode4 -c role -v 0 +system sh/cfg.sh -n dnode5 -c role -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000 diff --git a/tests/script/unique/cluster/cluster_main2.sim b/tests/script/unique/cluster/cluster_main2.sim index 9c682de041..6cff232021 100644 --- a/tests/script/unique/cluster/cluster_main2.sim +++ b/tests/script/unique/cluster/cluster_main2.sim @@ -29,11 +29,11 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode4 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode5 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +system sh/cfg.sh -n dnode3 -c role -v 0 +system sh/cfg.sh -n dnode4 -c role -v 0 +system sh/cfg.sh -n dnode5 -c role -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000 diff --git a/tests/script/unique/dnode/alternativeRole.sim b/tests/script/unique/dnode/alternativeRole.sim index e123ffa426..fb9d344d20 100644 --- a/tests/script/unique/dnode/alternativeRole.sim +++ b/tests/script/unique/dnode/alternativeRole.sim @@ -4,9 +4,9 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 1 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 2 -system sh/cfg.sh -n dnode3 -c alternativeRole -v 0 +system sh/cfg.sh -n dnode1 -c role -v 1 +system sh/cfg.sh -n dnode2 -c role -v 2 +system sh/cfg.sh -n dnode3 -c role -v 0 system sh/cfg.sh -n dnode1 -c wallevel -v 1 system sh/cfg.sh -n dnode2 -c wallevel -v 1 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim index 9d53c9968e..abdff2a294 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim @@ -31,10 +31,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim index af457f4cba..fa302dc6f7 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim @@ -31,10 +31,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim index e4ff2c23c8..caa213803a 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim @@ -31,10 +31,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim index 6736530240..f994fc2a1a 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim @@ -31,10 +31,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 #system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c alternativeRole -v 0 -system sh/cfg.sh -n dnode2 -c alternativeRole -v 0 -#system sh/cfg.sh -n dnode3 -c alternativeRole -v 2 -#system sh/cfg.sh -n dnode4 -c alternativeRole -v 2 +system sh/cfg.sh -n dnode1 -c role -v 0 +system sh/cfg.sh -n dnode2 -c role -v 0 +#system sh/cfg.sh -n dnode3 -c role -v 2 +#system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 From 6309c8efdbdf585ec7de415def50ede0b200414e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 17 Jul 2020 15:16:32 +0000 Subject: [PATCH 27/30] scripts --- .../src/main/java/com/taosdata/jdbc/utils/TDNode.java | 1 - tests/pytest/util/dnodes-no-random-fail.py | 1 - tests/pytest/util/dnodes-random-fail.py | 1 - tests/pytest/util/dnodes.py | 1 - tests/script/general/db/alter_option.sim | 1 - tests/script/general/db/basic.sim | 4 +--- tests/script/general/db/delete.sim | 1 - tests/script/general/db/delete_reuse1.sim | 5 ----- tests/script/general/db/delete_reuse2.sim | 5 ----- tests/script/general/db/delete_reusevnode.sim | 7 ------- tests/script/general/db/delete_reusevnode2.sim | 3 --- tests/script/general/db/delete_writing1.sim | 5 ----- tests/script/general/db/delete_writing2.sim | 1 - tests/script/general/db/len.sim | 1 - tests/script/general/db/repeat.sim | 1 - tests/script/general/db/vnodes.sim | 1 - tests/script/general/parser/bug.sim | 1 - tests/script/general/parser/select_across_vnodes.sim | 1 - tests/script/general/parser/select_from_cache_disk.sim | 1 - tests/script/general/parser/slimit.sim | 1 - tests/script/general/parser/slimit1.sim | 1 - tests/script/general/parser/slimit_alter_tags.sim | 1 - tests/script/general/parser/timestamp.sim | 1 - tests/script/general/stable/disk.sim | 1 - tests/script/general/stable/dnode3.sim | 4 ---- tests/script/general/stable/metrics.sim | 1 - tests/script/general/stable/refcount.sim | 1 - tests/script/general/stable/show.sim | 1 - tests/script/general/stable/values.sim | 1 - tests/script/general/stable/vnode3.sim | 2 -- .../script/general/stream/metrics_replica1_vnoden.sim | 1 - tests/script/general/stream/table_replica1_vnoden.sim | 1 - tests/script/general/table/delete_reuse1.sim | 5 ----- tests/script/general/table/delete_reuse2.sim | 5 ----- tests/script/general/table/delete_writing.sim | 5 ----- tests/script/general/table/limit.sim | 1 - tests/script/general/table/vgroup.sim | 1 - tests/script/sh/clear.sh | 1 - tests/script/tmp/http.sim | 5 ----- tests/script/tmp/mnodes.sim | 4 ---- tests/script/unique/account/authority.sim | 1 - .../unique/arbitrator/dn2_mn1_cache_file_sync.sim | 5 ----- .../unique/arbitrator/dn3_mn1_full_createTableFail.sim | 5 ----- .../unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim | 5 ----- .../unique/arbitrator/dn3_mn1_multiCreateDropTable.sim | 5 ----- .../dn3_mn1_nw_disable_timeout_autoDropDnode.sim | 5 ----- .../unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim | 5 ----- .../unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim | 5 ----- .../arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim | 7 ------- .../unique/arbitrator/dn3_mn1_replica_change.sim | 5 ----- .../arbitrator/dn3_mn1_replica_change_dropDnod.sim | 5 ----- .../unique/arbitrator/dn3_mn1_stopDnode_timeout.sim | 5 ----- .../script/unique/arbitrator/dn3_mn1_vnode_change.sim | 5 ----- .../arbitrator/dn3_mn1_vnode_corruptFile_offline.sim | 5 ----- .../arbitrator/dn3_mn1_vnode_corruptFile_online.sim | 5 ----- .../arbitrator/dn3_mn1_vnode_createErrData_online.sim | 5 ----- .../script/unique/arbitrator/dn3_mn1_vnode_delDir.sim | 5 ----- .../arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim | 5 ----- .../unique/arbitrator/dn3_mn1_vnode_nomaster.sim | 5 ----- tests/script/unique/arbitrator/dn3_mn2_killDnode.sim | 5 ----- .../script/unique/arbitrator/insert_duplicationTs.sim | 5 ----- .../arbitrator/offline_replica2_alterTable_online.sim | 5 ----- .../arbitrator/offline_replica2_alterTag_online.sim | 5 ----- .../arbitrator/offline_replica2_createTable_online.sim | 5 ----- .../arbitrator/offline_replica2_dropDb_online.sim | 5 ----- .../arbitrator/offline_replica2_dropTable_online.sim | 5 ----- .../arbitrator/offline_replica3_alterTable_online.sim | 5 ----- .../arbitrator/offline_replica3_createTable_online.sim | 5 ----- .../arbitrator/offline_replica3_dropDb_online.sim | 5 ----- .../arbitrator/offline_replica3_dropTable_online.sim | 5 ----- .../unique/arbitrator/replica_changeWithArbitrator.sim | 5 ----- .../unique/arbitrator/sync_replica2_alterTable_add.sim | 5 ----- .../arbitrator/sync_replica2_alterTable_drop.sim | 5 ----- .../script/unique/arbitrator/sync_replica2_dropDb.sim | 5 ----- .../unique/arbitrator/sync_replica2_dropTable.sim | 5 ----- .../unique/arbitrator/sync_replica3_alterTable_add.sim | 5 ----- .../arbitrator/sync_replica3_alterTable_drop.sim | 5 ----- .../unique/arbitrator/sync_replica3_createTable.sim | 5 ----- ...ync_replica3_dnodeChang_DropAddAlterTableDropDb.sim | 5 ----- .../script/unique/arbitrator/sync_replica3_dropDb.sim | 5 ----- .../unique/arbitrator/sync_replica3_dropTable.sim | 5 ----- tests/script/unique/big/balance.sim | 5 ----- tests/script/unique/big/maxvnodes.sim | 2 -- tests/script/unique/big/restartSpeed.sim | 2 -- tests/script/unique/cluster/balance1.sim | 9 --------- tests/script/unique/cluster/balance2.sim | 9 --------- tests/script/unique/cluster/balance3.sim | 9 --------- tests/script/unique/cluster/client1_0.sim | 5 ----- tests/script/unique/cluster/cluster_main.sim | 6 ------ tests/script/unique/cluster/cluster_main0.sim | 6 ------ tests/script/unique/cluster/cluster_main1.sim | 6 ------ tests/script/unique/cluster/cluster_main2.sim | 6 ------ tests/script/unique/cluster/main1_client1_0.sim | 3 +-- tests/script/unique/cluster/main2_client1_0.sim | 1 - tests/script/unique/db/delete.sim | 3 --- tests/script/unique/db/delete_part.sim | 5 ----- tests/script/unique/db/replica_add12.sim | 5 ----- tests/script/unique/db/replica_add13.sim | 5 ----- tests/script/unique/db/replica_add23.sim | 5 ----- tests/script/unique/db/replica_part.sim | 3 --- tests/script/unique/db/replica_reduce21.sim | 3 --- tests/script/unique/db/replica_reduce31.sim | 3 --- tests/script/unique/db/replica_reduce32.sim | 3 --- .../script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim | 5 ----- .../unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim | 5 ----- .../mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim | 5 ----- .../script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim | 5 ----- tests/script/unique/stable/balance_replica1.sim | 2 -- tests/script/unique/stable/dnode2.sim | 2 -- tests/script/unique/stable/dnode2_stop.sim | 2 -- tests/script/unique/stable/dnode3.sim | 3 --- tests/script/unique/stable/replica2_dnode4.sim | 4 ---- tests/script/unique/stable/replica2_vnode3.sim | 2 -- tests/script/unique/stable/replica3_dnode6.sim | 7 ------- tests/script/unique/stable/replica3_vnode3.sim | 4 ---- tests/script/unique/stream/metrics_balance.sim | 2 -- tests/script/unique/stream/metrics_replica1_dnode2.sim | 2 -- .../unique/stream/metrics_replica2_dnode2_vnoden.sim | 2 -- tests/script/unique/stream/metrics_replica2_dnode3.sim | 3 --- tests/script/unique/stream/metrics_replica3_dnode4.sim | 4 ---- tests/script/unique/stream/table_balance.sim | 4 ---- tests/script/unique/stream/table_move.sim | 10 ---------- tests/script/unique/stream/table_replica1_dnode2.sim | 4 ---- .../unique/stream/table_replica2_dnode2_vnoden.sim | 2 -- tests/script/unique/stream/table_replica2_dnode3.sim | 3 --- tests/script/unique/stream/table_replica3_dnode4.sim | 4 ---- tests/script/unique/vnode/many.sim | 4 ---- tests/script/unique/vnode/replica2_basic2.sim | 5 ----- 128 files changed, 2 insertions(+), 486 deletions(-) diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java index 273bc6920c..df25076a95 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java @@ -208,7 +208,6 @@ public class TDNode { setCfgConfig("mnodeEqualVnodeNum", "0"); setCfgConfig("walLevel", "1"); setCfgConfig("statusInterval", "1"); - setCfgConfig("numOfTotalVnodes", "64"); setCfgConfig("numOfMnodes", "3"); setCfgConfig("numOfThreadsPerCore", "2.0"); setCfgConfig("monitor", "0"); diff --git a/tests/pytest/util/dnodes-no-random-fail.py b/tests/pytest/util/dnodes-no-random-fail.py index 88b2049464..150b8f0c81 100644 --- a/tests/pytest/util/dnodes-no-random-fail.py +++ b/tests/pytest/util/dnodes-no-random-fail.py @@ -178,7 +178,6 @@ class TDDnode: self.cfg("walLevel", "2") self.cfg("fsync", "1000") self.cfg("statusInterval", "1") - self.cfg("numOfTotalVnodes", "64") self.cfg("numOfMnodes", "3") self.cfg("numOfThreadsPerCore", "2.0") self.cfg("monitor", "0") diff --git a/tests/pytest/util/dnodes-random-fail.py b/tests/pytest/util/dnodes-random-fail.py index df4af0c58b..36c0f9d796 100644 --- a/tests/pytest/util/dnodes-random-fail.py +++ b/tests/pytest/util/dnodes-random-fail.py @@ -178,7 +178,6 @@ class TDDnode: self.cfg("walLevel", "2") self.cfg("fsync", "1000") self.cfg("statusInterval", "1") - self.cfg("numOfTotalVnodes", "64") self.cfg("numOfMnodes", "3") self.cfg("numOfThreadsPerCore", "2.0") self.cfg("monitor", "0") diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 56e63bae11..582bd0abae 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -180,7 +180,6 @@ class TDDnode: self.cfg("walLevel", "2") self.cfg("fsync", "1000") self.cfg("statusInterval", "1") - self.cfg("numOfTotalVnodes", "64") self.cfg("numOfMnodes", "3") self.cfg("numOfThreadsPerCore", "2.0") self.cfg("monitor", "0") diff --git a/tests/script/general/db/alter_option.sim b/tests/script/general/db/alter_option.sim index 076f7364ee..46fc3a4ff7 100644 --- a/tests/script/general/db/alter_option.sim +++ b/tests/script/general/db/alter_option.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/basic.sim b/tests/script/general/db/basic.sim index 9983df378e..a7c4358aff 100644 --- a/tests/script/general/db/basic.sim +++ b/tests/script/general/db/basic.sim @@ -99,9 +99,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i sql create database $db sql use $db -sql create table $tb (ts timestamp, speed int) -x step6 - return -1 -step6: +sql create table $tb (ts timestamp, speed int) print =============== step7 $i = 0 diff --git a/tests/script/general/db/delete.sim b/tests/script/general/db/delete.sim index 477962a32d..059ab2e353 100644 --- a/tests/script/general/db/delete.sim +++ b/tests/script/general/db/delete.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 10 system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000 diff --git a/tests/script/general/db/delete_reuse1.sim b/tests/script/general/db/delete_reuse1.sim index 7b8687d340..feeb0152c1 100644 --- a/tests/script/general/db/delete_reuse1.sim +++ b/tests/script/general/db/delete_reuse1.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sleep 3000 diff --git a/tests/script/general/db/delete_reuse2.sim b/tests/script/general/db/delete_reuse2.sim index d27a54ad95..9053e8af01 100644 --- a/tests/script/general/db/delete_reuse2.sim +++ b/tests/script/general/db/delete_reuse2.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes sleep 2000 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/delete_reusevnode.sim b/tests/script/general/db/delete_reusevnode.sim index c76a2e8bc7..79783d6dda 100644 --- a/tests/script/general/db/delete_reusevnode.sim +++ b/tests/script/general/db/delete_reusevnode.sim @@ -2,10 +2,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -44,9 +40,6 @@ system sh/stop_dnodes.sh sleep 3000 system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/general/db/delete_reusevnode2.sim b/tests/script/general/db/delete_reusevnode2.sim index ff9361260c..e54266e312 100644 --- a/tests/script/general/db/delete_reusevnode2.sim +++ b/tests/script/general/db/delete_reusevnode2.sim @@ -1,8 +1,5 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/delete_writing1.sim b/tests/script/general/db/delete_writing1.sim index 96783be030..93d41b2fa3 100644 --- a/tests/script/general/db/delete_writing1.sim +++ b/tests/script/general/db/delete_writing1.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sleep 3000 diff --git a/tests/script/general/db/delete_writing2.sim b/tests/script/general/db/delete_writing2.sim index 00383d1341..3ea220cb8c 100644 --- a/tests/script/general/db/delete_writing2.sim +++ b/tests/script/general/db/delete_writing2.sim @@ -2,7 +2,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/len.sim b/tests/script/general/db/len.sim index 6082f891b2..30abcbe100 100644 --- a/tests/script/general/db/len.sim +++ b/tests/script/general/db/len.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/repeat.sim b/tests/script/general/db/repeat.sim index ca68e6d883..aaa103234d 100644 --- a/tests/script/general/db/repeat.sim +++ b/tests/script/general/db/repeat.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/db/vnodes.sim b/tests/script/general/db/vnodes.sim index 769eec3241..ef505b25c1 100644 --- a/tests/script/general/db/vnodes.sim +++ b/tests/script/general/db/vnodes.sim @@ -8,7 +8,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v $maxTables system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v $totalVnodes system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 100000 system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 100000 system sh/cfg.sh -n dnode1 -c maxShellConns -v 100000 diff --git a/tests/script/general/parser/bug.sim b/tests/script/general/parser/bug.sim index 0e97acb453..82f6518d73 100644 --- a/tests/script/general/parser/bug.sim +++ b/tests/script/general/parser/bug.sim @@ -20,7 +20,6 @@ system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000 system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000 system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000 system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 60 system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/general/parser/select_across_vnodes.sim b/tests/script/general/parser/select_across_vnodes.sim index 65e8cbb7b1..ac3a8f2b2b 100644 --- a/tests/script/general/parser/select_across_vnodes.sim +++ b/tests/script/general/parser/select_across_vnodes.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/parser/select_from_cache_disk.sim b/tests/script/general/parser/select_from_cache_disk.sim index 629d456761..4fdfa7b55b 100644 --- a/tests/script/general/parser/select_from_cache_disk.sim +++ b/tests/script/general/parser/select_from_cache_disk.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/parser/slimit.sim b/tests/script/general/parser/slimit.sim index 3d28ac3d54..2ce3d0c2ac 100644 --- a/tests/script/general/parser/slimit.sim +++ b/tests/script/general/parser/slimit.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/parser/slimit1.sim b/tests/script/general/parser/slimit1.sim index 05e34bc7f4..9e26a2882a 100644 --- a/tests/script/general/parser/slimit1.sim +++ b/tests/script/general/parser/slimit1.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/parser/slimit_alter_tags.sim b/tests/script/general/parser/slimit_alter_tags.sim index fb48dddba7..eccd4a6815 100644 --- a/tests/script/general/parser/slimit_alter_tags.sim +++ b/tests/script/general/parser/slimit_alter_tags.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/parser/timestamp.sim b/tests/script/general/parser/timestamp.sim index fbe0f24a47..0a86e39de0 100644 --- a/tests/script/general/parser/timestamp.sim +++ b/tests/script/general/parser/timestamp.sim @@ -2,7 +2,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect diff --git a/tests/script/general/stable/disk.sim b/tests/script/general/stable/disk.sim index c7ddfb0591..8fc7931a73 100644 --- a/tests/script/general/stable/disk.sim +++ b/tests/script/general/stable/disk.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stable/dnode3.sim b/tests/script/general/stable/dnode3.sim index 7e85641598..76652229d2 100644 --- a/tests/script/general/stable/dnode3.sim +++ b/tests/script/general/stable/dnode3.sim @@ -8,10 +8,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/general/stable/metrics.sim b/tests/script/general/stable/metrics.sim index b9367469b3..b94c76429d 100644 --- a/tests/script/general/stable/metrics.sim +++ b/tests/script/general/stable/metrics.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stable/refcount.sim b/tests/script/general/stable/refcount.sim index 99d943b4d9..5fe95dde9f 100644 --- a/tests/script/general/stable/refcount.sim +++ b/tests/script/general/stable/refcount.sim @@ -2,7 +2,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stable/show.sim b/tests/script/general/stable/show.sim index b25418cc2a..66755edea7 100644 --- a/tests/script/general/stable/show.sim +++ b/tests/script/general/stable/show.sim @@ -2,7 +2,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/exec.sh -n dnode1 -s start sleep 3000 diff --git a/tests/script/general/stable/values.sim b/tests/script/general/stable/values.sim index f524eee411..d0c1783851 100644 --- a/tests/script/general/stable/values.sim +++ b/tests/script/general/stable/values.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stable/vnode3.sim b/tests/script/general/stable/vnode3.sim index 73be7a1195..ffe046d94a 100644 --- a/tests/script/general/stable/vnode3.sim +++ b/tests/script/general/stable/vnode3.sim @@ -1,9 +1,7 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stream/metrics_replica1_vnoden.sim b/tests/script/general/stream/metrics_replica1_vnoden.sim index abe3e2ffdf..dcbc8ae7de 100644 --- a/tests/script/general/stream/metrics_replica1_vnoden.sim +++ b/tests/script/general/stream/metrics_replica1_vnoden.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/stream/table_replica1_vnoden.sim b/tests/script/general/stream/table_replica1_vnoden.sim index ee0c871d98..13a4a56fb3 100644 --- a/tests/script/general/stream/table_replica1_vnoden.sim +++ b/tests/script/general/stream/table_replica1_vnoden.sim @@ -3,7 +3,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/table/delete_reuse1.sim b/tests/script/general/table/delete_reuse1.sim index 753d1e8a35..17974ccf4d 100644 --- a/tests/script/general/table/delete_reuse1.sim +++ b/tests/script/general/table/delete_reuse1.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/table/delete_reuse2.sim b/tests/script/general/table/delete_reuse2.sim index 1c74399348..917893b2d2 100644 --- a/tests/script/general/table/delete_reuse2.sim +++ b/tests/script/general/table/delete_reuse2.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/table/delete_writing.sim b/tests/script/general/table/delete_writing.sim index 853637967d..868936dda7 100644 --- a/tests/script/general/table/delete_writing.sim +++ b/tests/script/general/table/delete_writing.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/table/limit.sim b/tests/script/general/table/limit.sim index 067182e1c8..6287807954 100644 --- a/tests/script/general/table/limit.sim +++ b/tests/script/general/table/limit.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/general/table/vgroup.sim b/tests/script/general/table/vgroup.sim index 7efa3e9f73..201ecaaad4 100644 --- a/tests/script/general/table/vgroup.sim +++ b/tests/script/general/table/vgroup.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/exec.sh -n dnode1 -s start sleep 3000 diff --git a/tests/script/sh/clear.sh b/tests/script/sh/clear.sh index d8af2dd10b..0238ceec5d 100755 --- a/tests/script/sh/clear.sh +++ b/tests/script/sh/clear.sh @@ -122,7 +122,6 @@ echo "numOfLogLines 100000000" >> $TAOS_CFG echo "mnodeEqualVnodeNum 0" >> $TAOS_CFG echo "clog 0" >> $TAOS_CFG echo "statusInterval 1" >> $TAOS_CFG -echo "numOfTotalVnodes 4" >> $TAOS_CFG echo "asyncLog 0" >> $TAOS_CFG echo "numOfMnodes 1" >> $TAOS_CFG echo "locale en_US.UTF-8" >> $TAOS_CFG diff --git a/tests/script/tmp/http.sim b/tests/script/tmp/http.sim index c863f4b8d8..a5212905ae 100644 --- a/tests/script/tmp/http.sim +++ b/tests/script/tmp/http.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode2 -c http -v 1 system sh/cfg.sh -n dnode3 -c http -v 1 diff --git a/tests/script/tmp/mnodes.sim b/tests/script/tmp/mnodes.sim index b4e176f221..5cb0d72920 100644 --- a/tests/script/tmp/mnodes.sim +++ b/tests/script/tmp/mnodes.sim @@ -16,10 +16,6 @@ system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 20 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 20 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 20 - system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode2 -c http -v 1 system sh/cfg.sh -n dnode3 -c http -v 1 diff --git a/tests/script/unique/account/authority.sim b/tests/script/unique/account/authority.sim index 2270c28887..f88f254a79 100644 --- a/tests/script/unique/account/authority.sim +++ b/tests/script/unique/account/authority.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/exec.sh -n dnode1 -s start sleep 3000 diff --git a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim index fd7b55a4fc..6f0f61d2e2 100644 --- a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim +++ b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim @@ -29,11 +29,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim b/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim index 24276f436b..97433741f5 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim b/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim index 8d4da4d2bf..a6a9129090 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim b/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim index 092e49659d..7bb37c5ebb 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim b/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim index c30a1fd1bc..e11dd69598 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim index 00c95d7a02..3df21a1c5d 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim index 9b823755d8..97b77aa66f 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim b/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim index 4873577782..986df81bf6 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim @@ -29,12 +29,6 @@ system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 16 system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 16 system sh/cfg.sh -n dnode5 -c maxVgroupsPerDb -v 16 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 @@ -214,7 +208,6 @@ system sh/deploy.sh -n dnode3 -i 3 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode3 -c walLevel -v 1 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim b/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim index ccc23406c9..95fb21a017 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim b/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim index 792a4d42c3..c36e9f015e 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim b/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim index 972a156e3a..438e4af34f 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim @@ -19,10 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 @@ -178,7 +174,6 @@ system sh/deploy.sh -n dnode4 -i 4 system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode4 -c walLevel -v 1 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode4 -c role -v 2 system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim index 5002a79652..ee974ad6db 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim index 333755d091..6a8d69c271 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim index c34da0b2db..1642e8a322 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim index aca03789cd..59a62aa63d 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim index de219082d7..a0629abab8 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim index f392acada6..e2fa1fbe2f 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim b/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim index 22c5b6d6d6..a425bc3e92 100644 --- a/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim +++ b/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim b/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim index b5aacfc718..7906718b08 100644 --- a/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim +++ b/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - #system sh/cfg.sh -n dnode1 -c role -v 2 #system sh/cfg.sh -n dnode2 -c role -v 2 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/insert_duplicationTs.sim b/tests/script/unique/arbitrator/insert_duplicationTs.sim index 67db91f1ac..a873bf02ae 100644 --- a/tests/script/unique/arbitrator/insert_duplicationTs.sim +++ b/tests/script/unique/arbitrator/insert_duplicationTs.sim @@ -29,11 +29,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim index 1375d3d9e2..12d0a19f73 100644 --- a/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim b/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim index 10d2c0b2a5..be032dfa76 100644 --- a/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - #system sh/cfg.sh -n dnode1 -c role -v 1 #system sh/cfg.sh -n dnode2 -c role -v 2 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim index 9e0c4e5a89..d79ba724f7 100644 --- a/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim b/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim index 41cd8bdd90..20f4552fe3 100644 --- a/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim b/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim index 127468993b..7131df5d24 100644 --- a/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim index d50a049926..48eb9512c8 100644 --- a/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim index 396fb43178..c96d7f5b6e 100644 --- a/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim b/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim index 20d9e9c958..1392e6c8a7 100644 --- a/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim b/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim index bad158b003..729aff56c0 100644 --- a/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim +++ b/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim b/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim index f4a4e01e63..10964b9209 100644 --- a/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim +++ b/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 8 - system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim b/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim index cf39adf19e..25da315be4 100644 --- a/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim +++ b/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim b/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim index 90297660c4..a26c1b04ed 100644 --- a/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim +++ b/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica2_dropDb.sim b/tests/script/unique/arbitrator/sync_replica2_dropDb.sim index 18b9173400..1556a03b67 100644 --- a/tests/script/unique/arbitrator/sync_replica2_dropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica2_dropDb.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica2_dropTable.sim b/tests/script/unique/arbitrator/sync_replica2_dropTable.sim index b7874fa60c..669b41becb 100644 --- a/tests/script/unique/arbitrator/sync_replica2_dropTable.sim +++ b/tests/script/unique/arbitrator/sync_replica2_dropTable.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim b/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim index b48f5f1a95..00c42cb7e3 100644 --- a/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim +++ b/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim b/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim index 776bc8a66d..1d774e195e 100644 --- a/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim +++ b/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_createTable.sim b/tests/script/unique/arbitrator/sync_replica3_createTable.sim index c67dcb94f9..db29eaf838 100644 --- a/tests/script/unique/arbitrator/sync_replica3_createTable.sim +++ b/tests/script/unique/arbitrator/sync_replica3_createTable.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim b/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim index 3b517145a6..5b751e96f8 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_dropDb.sim b/tests/script/unique/arbitrator/sync_replica3_dropDb.sim index c9c82ae965..83f1d16856 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dropDb.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dropDb.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/arbitrator/sync_replica3_dropTable.sim b/tests/script/unique/arbitrator/sync_replica3_dropTable.sim index b24348db68..e874afeaed 100644 --- a/tests/script/unique/arbitrator/sync_replica3_dropTable.sim +++ b/tests/script/unique/arbitrator/sync_replica3_dropTable.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 1 system sh/cfg.sh -n dnode2 -c role -v 2 system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/big/balance.sim b/tests/script/unique/big/balance.sim index 259951581e..a9092ac790 100644 --- a/tests/script/unique/big/balance.sim +++ b/tests/script/unique/big/balance.sim @@ -1,26 +1,21 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4 system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000 system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 4 system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 1000 system sh/deploy.sh -n dnode3 -i 3 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 4 system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 1000 system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 4 system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 1000 system sh/deploy.sh -n dnode5 -i 5 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode5 -c maxVgroupsPerDb -v 4 system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 1000 diff --git a/tests/script/unique/big/maxvnodes.sim b/tests/script/unique/big/maxvnodes.sim index 9603b5de64..a4959aab3f 100644 --- a/tests/script/unique/big/maxvnodes.sim +++ b/tests/script/unique/big/maxvnodes.sim @@ -8,11 +8,9 @@ $totalRows = $totalVnodes * $maxTables system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v $totalVnodes system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v $totalVnodes system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v $totalVnodes diff --git a/tests/script/unique/big/restartSpeed.sim b/tests/script/unique/big/restartSpeed.sim index 94c687d329..ef32cec585 100644 --- a/tests/script/unique/big/restartSpeed.sim +++ b/tests/script/unique/big/restartSpeed.sim @@ -8,10 +8,8 @@ $totalRows = $totalVnodes * $maxTables system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v $totalVnodes system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v $totalVnodes print ========== prepare data diff --git a/tests/script/unique/cluster/balance1.sim b/tests/script/unique/cluster/balance1.sim index c402c111cf..44f44e3976 100644 --- a/tests/script/unique/cluster/balance1.sim +++ b/tests/script/unique/cluster/balance1.sim @@ -8,15 +8,6 @@ system sh/deploy.sh -n dnode6 -i 6 system sh/deploy.sh -n dnode7 -i 7 system sh/deploy.sh -n dnode8 -i 8 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 diff --git a/tests/script/unique/cluster/balance2.sim b/tests/script/unique/cluster/balance2.sim index 4c4339a78b..0c880d36ff 100644 --- a/tests/script/unique/cluster/balance2.sim +++ b/tests/script/unique/cluster/balance2.sim @@ -8,15 +8,6 @@ system sh/deploy.sh -n dnode6 -i 6 system sh/deploy.sh -n dnode7 -i 7 system sh/deploy.sh -n dnode8 -i 8 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 diff --git a/tests/script/unique/cluster/balance3.sim b/tests/script/unique/cluster/balance3.sim index 8920ec9fc1..cd669b69b6 100644 --- a/tests/script/unique/cluster/balance3.sim +++ b/tests/script/unique/cluster/balance3.sim @@ -9,15 +9,6 @@ system sh/deploy.sh -n dnode6 -i 6 system sh/deploy.sh -n dnode7 -i 7 system sh/deploy.sh -n dnode8 -i 8 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 diff --git a/tests/script/unique/cluster/client1_0.sim b/tests/script/unique/cluster/client1_0.sim index 184f0263e3..ad48e6dc93 100644 --- a/tests/script/unique/cluster/client1_0.sim +++ b/tests/script/unique/cluster/client1_0.sim @@ -1,7 +1,6 @@ #system sh/stop_dnodes.sh #system sh/deploy.sh -n dnode1 -i 1 #system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 10000 -#system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 #system sh/exec.sh -n dnode1 -s start #sql connect #$db = db1 @@ -10,10 +9,6 @@ #$stb = stb1 #sql create table $stb (ts timestamp, c1 int) tags(t1 int, t2 binary(8)) - - - - $tblStart = 0 $tblEnd = 1000 $tsStart = 1325347200000 # 2012-01-01 00:00:00.000 diff --git a/tests/script/unique/cluster/cluster_main.sim b/tests/script/unique/cluster/cluster_main.sim index e0b555e412..7d4a35c7f2 100644 --- a/tests/script/unique/cluster/cluster_main.sim +++ b/tests/script/unique/cluster/cluster_main.sim @@ -23,12 +23,6 @@ system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 system sh/cfg.sh -n dnode3 -c role -v 0 diff --git a/tests/script/unique/cluster/cluster_main0.sim b/tests/script/unique/cluster/cluster_main0.sim index 771edd9fe7..ef76f8823f 100644 --- a/tests/script/unique/cluster/cluster_main0.sim +++ b/tests/script/unique/cluster/cluster_main0.sim @@ -23,12 +23,6 @@ system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 system sh/cfg.sh -n dnode3 -c role -v 0 diff --git a/tests/script/unique/cluster/cluster_main1.sim b/tests/script/unique/cluster/cluster_main1.sim index ac3d5f9b13..4537b09091 100644 --- a/tests/script/unique/cluster/cluster_main1.sim +++ b/tests/script/unique/cluster/cluster_main1.sim @@ -23,12 +23,6 @@ system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 system sh/cfg.sh -n dnode3 -c role -v 0 diff --git a/tests/script/unique/cluster/cluster_main2.sim b/tests/script/unique/cluster/cluster_main2.sim index 6cff232021..84ea3871ef 100644 --- a/tests/script/unique/cluster/cluster_main2.sim +++ b/tests/script/unique/cluster/cluster_main2.sim @@ -23,12 +23,6 @@ system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 256 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 system sh/cfg.sh -n dnode3 -c role -v 0 diff --git a/tests/script/unique/cluster/main1_client1_0.sim b/tests/script/unique/cluster/main1_client1_0.sim index d4f2aa4294..e54fd7f1a7 100644 --- a/tests/script/unique/cluster/main1_client1_0.sim +++ b/tests/script/unique/cluster/main1_client1_0.sim @@ -1,7 +1,6 @@ #system sh/stop_dnodes.sh #system sh/deploy.sh -n dnode1 -i 1 -#system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 10000 -#system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 +#system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 10000\ #system sh/exec.sh -n dnode1 -s start #sql connect #$db = db1 diff --git a/tests/script/unique/cluster/main2_client1_0.sim b/tests/script/unique/cluster/main2_client1_0.sim index a7fd181363..240c22aacc 100644 --- a/tests/script/unique/cluster/main2_client1_0.sim +++ b/tests/script/unique/cluster/main2_client1_0.sim @@ -1,7 +1,6 @@ #system sh/stop_dnodes.sh #system sh/deploy.sh -n dnode1 -i 1 #system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 10000 -#system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 256 #system sh/exec.sh -n dnode1 -s start #sql connect #$db = db1 diff --git a/tests/script/unique/db/delete.sim b/tests/script/unique/db/delete.sim index f05d64e635..49732cdf91 100644 --- a/tests/script/unique/db/delete.sim +++ b/tests/script/unique/db/delete.sim @@ -9,9 +9,6 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 2 system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 2 system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 2 system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 2 diff --git a/tests/script/unique/db/delete_part.sim b/tests/script/unique/db/delete_part.sim index bf74e04b7f..d55899a22f 100644 --- a/tests/script/unique/db/delete_part.sim +++ b/tests/script/unique/db/delete_part.sim @@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8 system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 8 system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 8 diff --git a/tests/script/unique/db/replica_add12.sim b/tests/script/unique/db/replica_add12.sim index 89502ce419..e29cf1ba73 100644 --- a/tests/script/unique/db/replica_add12.sim +++ b/tests/script/unique/db/replica_add12.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/unique/db/replica_add13.sim b/tests/script/unique/db/replica_add13.sim index 9cc1545bfa..1df49ba658 100644 --- a/tests/script/unique/db/replica_add13.sim +++ b/tests/script/unique/db/replica_add13.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/unique/db/replica_add23.sim b/tests/script/unique/db/replica_add23.sim index 67131173d9..5da73cd117 100644 --- a/tests/script/unique/db/replica_add23.sim +++ b/tests/script/unique/db/replica_add23.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/unique/db/replica_part.sim b/tests/script/unique/db/replica_part.sim index 0de5732853..de3f6203d2 100644 --- a/tests/script/unique/db/replica_part.sim +++ b/tests/script/unique/db/replica_part.sim @@ -13,9 +13,6 @@ system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/db/replica_reduce21.sim b/tests/script/unique/db/replica_reduce21.sim index a61cb84c11..8d4d9fc8c3 100644 --- a/tests/script/unique/db/replica_reduce21.sim +++ b/tests/script/unique/db/replica_reduce21.sim @@ -13,9 +13,6 @@ system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/db/replica_reduce31.sim b/tests/script/unique/db/replica_reduce31.sim index af9bcb17bc..3ed0a1e3b9 100644 --- a/tests/script/unique/db/replica_reduce31.sim +++ b/tests/script/unique/db/replica_reduce31.sim @@ -13,9 +13,6 @@ system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/db/replica_reduce32.sim b/tests/script/unique/db/replica_reduce32.sim index 5516009369..664a286be4 100644 --- a/tests/script/unique/db/replica_reduce32.sim +++ b/tests/script/unique/db/replica_reduce32.sim @@ -13,9 +13,6 @@ system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim index abdff2a294..7dd911a63e 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim @@ -26,11 +26,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim index fa302dc6f7..bcbf388946 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim @@ -26,11 +26,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim index caa213803a..ab76affafc 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim @@ -26,11 +26,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim index f994fc2a1a..f6a60d6b08 100644 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim +++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim @@ -26,11 +26,6 @@ system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 #system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -#system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c role -v 0 system sh/cfg.sh -n dnode2 -c role -v 0 #system sh/cfg.sh -n dnode3 -c role -v 2 diff --git a/tests/script/unique/stable/balance_replica1.sim b/tests/script/unique/stable/balance_replica1.sim index 35b5efe154..362f8ccf7f 100644 --- a/tests/script/unique/stable/balance_replica1.sim +++ b/tests/script/unique/stable/balance_replica1.sim @@ -1,8 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c statusInterval -v 1 system sh/cfg.sh -n dnode2 -c statusInterval -v 1 system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 diff --git a/tests/script/unique/stable/dnode2.sim b/tests/script/unique/stable/dnode2.sim index ce80792082..441323ff3c 100644 --- a/tests/script/unique/stable/dnode2.sim +++ b/tests/script/unique/stable/dnode2.sim @@ -3,8 +3,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stable/dnode2_stop.sim b/tests/script/unique/stable/dnode2_stop.sim index cb7df5a3cf..d25c68cbba 100644 --- a/tests/script/unique/stable/dnode2_stop.sim +++ b/tests/script/unique/stable/dnode2_stop.sim @@ -3,8 +3,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stable/dnode3.sim b/tests/script/unique/stable/dnode3.sim index 714927c1bd..712ec04b8c 100644 --- a/tests/script/unique/stable/dnode3.sim +++ b/tests/script/unique/stable/dnode3.sim @@ -5,9 +5,6 @@ system sh/deploy.sh -n dnode3 -i 3 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stable/replica2_dnode4.sim b/tests/script/unique/stable/replica2_dnode4.sim index b40d5d378b..c7a9767fcc 100644 --- a/tests/script/unique/stable/replica2_dnode4.sim +++ b/tests/script/unique/stable/replica2_dnode4.sim @@ -7,10 +7,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 system sh/cfg.sh -n dnode3 -c walLevel -v 2 system sh/cfg.sh -n dnode4 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stable/replica2_vnode3.sim b/tests/script/unique/stable/replica2_vnode3.sim index 6acdec7394..84af380106 100644 --- a/tests/script/unique/stable/replica2_vnode3.sim +++ b/tests/script/unique/stable/replica2_vnode3.sim @@ -3,8 +3,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stable/replica3_dnode6.sim b/tests/script/unique/stable/replica3_dnode6.sim index 6ae6cbde2c..83ef334301 100644 --- a/tests/script/unique/stable/replica3_dnode6.sim +++ b/tests/script/unique/stable/replica3_dnode6.sim @@ -13,13 +13,6 @@ system sh/cfg.sh -n dnode4 -c walLevel -v 2 system sh/cfg.sh -n dnode5 -c walLevel -v 2 system sh/cfg.sh -n dnode6 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4 - system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stable/replica3_vnode3.sim b/tests/script/unique/stable/replica3_vnode3.sim index 80372d25a5..3cd7b92477 100644 --- a/tests/script/unique/stable/replica3_vnode3.sim +++ b/tests/script/unique/stable/replica3_vnode3.sim @@ -8,10 +8,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/cfg.sh -n dnode2 -c walLevel -v 2 system sh/cfg.sh -n dnode3 -c walLevel -v 2 system sh/cfg.sh -n dnode4 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stream/metrics_balance.sim b/tests/script/unique/stream/metrics_balance.sim index e306da3cce..c043044499 100644 --- a/tests/script/unique/stream/metrics_balance.sim +++ b/tests/script/unique/stream/metrics_balance.sim @@ -4,8 +4,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c statusInterval -v 1 system sh/cfg.sh -n dnode2 -c statusInterval -v 1 system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 diff --git a/tests/script/unique/stream/metrics_replica1_dnode2.sim b/tests/script/unique/stream/metrics_replica1_dnode2.sim index 78b9165681..bbc4d5174c 100644 --- a/tests/script/unique/stream/metrics_replica1_dnode2.sim +++ b/tests/script/unique/stream/metrics_replica1_dnode2.sim @@ -6,8 +6,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim b/tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim index 47454501c6..f60355cd6a 100644 --- a/tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim +++ b/tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim @@ -6,8 +6,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stream/metrics_replica2_dnode3.sim b/tests/script/unique/stream/metrics_replica2_dnode3.sim index a8c986cce9..3f8ae46e6b 100644 --- a/tests/script/unique/stream/metrics_replica2_dnode3.sim +++ b/tests/script/unique/stream/metrics_replica2_dnode3.sim @@ -9,9 +9,6 @@ system sh/deploy.sh -n dnode3 -i 3 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stream/metrics_replica3_dnode4.sim b/tests/script/unique/stream/metrics_replica3_dnode4.sim index 8ff7a3738e..70cd371e2c 100644 --- a/tests/script/unique/stream/metrics_replica3_dnode4.sim +++ b/tests/script/unique/stream/metrics_replica3_dnode4.sim @@ -12,10 +12,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stream/table_balance.sim b/tests/script/unique/stream/table_balance.sim index 992b4c08ee..6c8958aa48 100644 --- a/tests/script/unique/stream/table_balance.sim +++ b/tests/script/unique/stream/table_balance.sim @@ -1,11 +1,7 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c statusInterval -v 1 system sh/cfg.sh -n dnode2 -c statusInterval -v 1 system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 diff --git a/tests/script/unique/stream/table_move.sim b/tests/script/unique/stream/table_move.sim index 0f264ade33..d3ea375e1f 100644 --- a/tests/script/unique/stream/table_move.sim +++ b/tests/script/unique/stream/table_move.sim @@ -1,20 +1,10 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 8 - system sh/cfg.sh -n dnode1 -c statusInterval -v 1 system sh/cfg.sh -n dnode2 -c statusInterval -v 1 system sh/cfg.sh -n dnode3 -c statusInterval -v 1 diff --git a/tests/script/unique/stream/table_replica1_dnode2.sim b/tests/script/unique/stream/table_replica1_dnode2.sim index 3d88493f40..aaab2990b4 100644 --- a/tests/script/unique/stream/table_replica1_dnode2.sim +++ b/tests/script/unique/stream/table_replica1_dnode2.sim @@ -1,13 +1,9 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stream/table_replica2_dnode2_vnoden.sim b/tests/script/unique/stream/table_replica2_dnode2_vnoden.sim index 809627432b..0717e6f965 100644 --- a/tests/script/unique/stream/table_replica2_dnode2_vnoden.sim +++ b/tests/script/unique/stream/table_replica2_dnode2_vnoden.sim @@ -6,8 +6,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/unique/stream/table_replica2_dnode3.sim b/tests/script/unique/stream/table_replica2_dnode3.sim index abee70d048..9c65a427c7 100644 --- a/tests/script/unique/stream/table_replica2_dnode3.sim +++ b/tests/script/unique/stream/table_replica2_dnode3.sim @@ -9,9 +9,6 @@ system sh/deploy.sh -n dnode3 -i 3 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/stream/table_replica3_dnode4.sim b/tests/script/unique/stream/table_replica3_dnode4.sim index effdd38c2e..0affffe92c 100644 --- a/tests/script/unique/stream/table_replica3_dnode4.sim +++ b/tests/script/unique/stream/table_replica3_dnode4.sim @@ -12,10 +12,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 8 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 diff --git a/tests/script/unique/vnode/many.sim b/tests/script/unique/vnode/many.sim index 2ac203a9b7..8bd6372ae9 100644 --- a/tests/script/unique/vnode/many.sim +++ b/tests/script/unique/vnode/many.sim @@ -16,10 +16,6 @@ system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 system sh/exec.sh -n dnode1 -s start sql connect diff --git a/tests/script/unique/vnode/replica2_basic2.sim b/tests/script/unique/vnode/replica2_basic2.sim index 2aa470843a..bf540c11fd 100644 --- a/tests/script/unique/vnode/replica2_basic2.sim +++ b/tests/script/unique/vnode/replica2_basic2.sim @@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 - print ========= start dnodes system sh/exec.sh -n dnode1 -s start sleep 3000 From ae57aaae1c9b81d67591e68603471182a5db6b63 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 18 Jul 2020 00:02:52 +0800 Subject: [PATCH 28/30] [td-225] fix bugs in interp --- src/inc/tsdb.h | 7 +------ src/query/src/qExecutor.c | 4 ++-- src/tsdb/src/tsdbRead.c | 23 +++++++++++++++-------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index a1e87a7437..2c67973298 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -175,11 +175,6 @@ typedef struct { SHashObj *map; // speedup acquire the tableQueryInfo from STableId } STableGroupInfo; -typedef struct SQueryRowCond { - int32_t rel; - TSKEY ts; -} SQueryRowCond; - /** * Get the data block iterator, starting from position according to the query condition * @@ -276,7 +271,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T *tsdb, uint64_t uid, const char *pT * destory the created table group list, which is generated by tag query * @param pGroupList */ -void tsdbDestoryTableGroup(STableGroupInfo *pGroupList); +void tsdbDestroyTableGroup(STableGroupInfo *pGroupList); /** * create the table group result including only one table, used to handle the normal table query diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 52154c1ca1..cf13ace11f 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -5859,7 +5859,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList, return pQInfo; _cleanup_qinfo: - tsdbDestoryTableGroup(pTableGroupInfo); + tsdbDestroyTableGroup(pTableGroupInfo); _cleanup_query: taosArrayDestroy(pGroupbyExpr->columnInfo); @@ -6009,7 +6009,7 @@ static void freeQInfo(SQInfo *pQInfo) { tfree(pQInfo->pBuf); taosArrayDestroy(pQInfo->tableqinfoGroupInfo.pGroupList); taosHashCleanup(pQInfo->tableqinfoGroupInfo.map); - tsdbDestoryTableGroup(&pQInfo->tableGroupInfo); + tsdbDestroyTableGroup(&pQInfo->tableGroupInfo); taosArrayDestroy(pQInfo->arrTableIdInfo); if (pQuery->pGroupbyExpr != NULL) { diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 884b52a54a..eb34805de4 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -107,7 +107,7 @@ typedef struct STsdbQueryHandle { bool locateStart; int32_t outputCapacity; int32_t realNumOfRows; - SArray* pTableCheckInfo; //SArray + SArray* pTableCheckInfo; // SArray int32_t activeIndex; bool checkFiles; // check file stage void* qinfo; // query info handle, for debug purpose @@ -191,6 +191,7 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab free(pQueryHandle); return NULL; } + tsdbTakeMemSnapshot(pQueryHandle->pTsdb, &pQueryHandle->mem, &pQueryHandle->imem); size_t sizeOfGroup = taosArrayGetSize(groupList->pGroupList); @@ -348,6 +349,11 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh return true; } +static void destroyTableMemIterator(STableCheckInfo* pCheckInfo) { + tSkipListDestroyIter(pCheckInfo->iter); + tSkipListDestroyIter(pCheckInfo->iiter); +} + SDataRow getSDataRowInTableMem(STableCheckInfo* pCheckInfo) { SDataRow rmem = NULL, rimem = NULL; if (pCheckInfo->iter) { @@ -1543,6 +1549,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { free(pSecQueryHandle); return false; } + tsdbTakeMemSnapshot(pSecQueryHandle->pTsdb, &pSecQueryHandle->mem, &pSecQueryHandle->imem); // allocate buffer in order to load data blocks from file @@ -1567,7 +1574,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { for (int32_t j = 0; j < si; ++j) { STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j); - STableCheckInfo info = { .lastKey = pSecQueryHandle->window.skey, .tableId = pCheckInfo->tableId, @@ -1604,9 +1610,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { pQueryHandle->window = pQueryHandle->cur.win; pQueryHandle->cur.rows = 2; pQueryHandle->cur.mixBlock = true; - pQueryHandle->order = TSDB_ORDER_ASC; + pQueryHandle->order = TSDB_ORDER_DESC; - int32_t step = -1; + int32_t step = -1;// one step for ascending order traverse for (int32_t j = 0; j < si; ++j) { STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j); pCheckInfo->lastKey = pQueryHandle->cur.win.ekey + step; @@ -1615,8 +1621,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { tsdbCleanupQueryHandle(pSecQueryHandle); } -// disable it after retrieve data - pQueryHandle->type = TSDB_QUERY_TYPE_ALL; + //disable it after retrieve data + pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL; + pQueryHandle->checkFiles = false; return true; } @@ -2365,7 +2372,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) { size_t size = taosArrayGetSize(pQueryHandle->pTableCheckInfo); for (int32_t i = 0; i < size; ++i) { STableCheckInfo* pTableCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); - tSkipListDestroyIter(pTableCheckInfo->iter); + destroyTableMemIterator(pTableCheckInfo); if (pTableCheckInfo->pDataCols != NULL) { tfree(pTableCheckInfo->pDataCols->buf); @@ -2401,7 +2408,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) { tfree(pQueryHandle); } -void tsdbDestoryTableGroup(STableGroupInfo *pGroupList) { +void tsdbDestroyTableGroup(STableGroupInfo *pGroupList) { assert(pGroupList != NULL); size_t numOfGroup = taosArrayGetSize(pGroupList->pGroupList); From 92608f0231580a068904f932c6210819f04804b5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 18 Jul 2020 00:20:02 +0800 Subject: [PATCH 29/30] scripts --- tests/script/general/table/vgroup.sim | 8 +------- tests/script/unique/db/delete_part.sim | 8 ++++---- tests/script/unique/db/replica_reduce21.sim | 3 --- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/script/general/table/vgroup.sim b/tests/script/general/table/vgroup.sim index 201ecaaad4..9a86c3ef31 100644 --- a/tests/script/general/table/vgroup.sim +++ b/tests/script/general/table/vgroup.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -77,10 +78,6 @@ if $rows != 0 then return -1 endi -sql create table table1 (ts timestamp, speed int) -x error2 - return -1 -error2: - $i = 0 $db = $dbPrefix . $i sql drop database $db @@ -133,9 +130,6 @@ $i = 4 $db = $dbPrefix . $i sql create database $db sql use $db -sql create table table5 (ts timestamp, speed int) -x error3 - return -1 -error3: sql show databases if $rows != 5 then diff --git a/tests/script/unique/db/delete_part.sim b/tests/script/unique/db/delete_part.sim index d55899a22f..fd92c160d9 100644 --- a/tests/script/unique/db/delete_part.sim +++ b/tests/script/unique/db/delete_part.sim @@ -14,10 +14,10 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 +system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0 +system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0 +system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 0 +system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 0 system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8 system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 8 diff --git a/tests/script/unique/db/replica_reduce21.sim b/tests/script/unique/db/replica_reduce21.sim index 8d4d9fc8c3..a64f4370c8 100644 --- a/tests/script/unique/db/replica_reduce21.sim +++ b/tests/script/unique/db/replica_reduce21.sim @@ -59,9 +59,6 @@ endi print ======== step2 create d5 sql create database d5 replica 1 -sql create table d5.t5 (ts timestamp, i int) -x error1 - return -1 -error1: print ========= step3 alter d1 sql alter database d1 replica 1 From 4a57740698f00a38b39cd61a14b76abb196c0982 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 18 Jul 2020 00:34:11 +0800 Subject: [PATCH 30/30] fix compile error --- src/mnode/src/mnodeBalance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mnode/src/mnodeBalance.c b/src/mnode/src/mnodeBalance.c index 36078115f7..23fc10d0bd 100644 --- a/src/mnode/src/mnodeBalance.c +++ b/src/mnode/src/mnodeBalance.c @@ -39,11 +39,11 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) { pIter = mnodeGetNextDnode(pIter, &pDnode); if (pDnode == NULL) break; - if (pDnode->totalVnodes > 0 && pDnode->openVnodes < pDnode->totalVnodes) { + if (pDnode->numOfCores > 0 && pDnode->openVnodes < TSDB_MAX_VNODES) { float openVnodes = pDnode->openVnodes; if (pDnode->isMgmt) openVnodes += tsMnodeEqualVnodeNum; - float usage = openVnodes / pDnode->totalVnodes; + float usage = openVnodes / pDnode->numOfCores; if (usage <= vnodeUsage) { pSelDnode = pDnode; vnodeUsage = usage;