diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 3a26d294a4..cafb0b8fb1 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -300,7 +300,6 @@ typedef struct STscObj { char sversion[TSDB_VERSION_LEN]; char writeAuth : 1; char superAuth : 1; - void* pMgmtConn; struct SSqlObj * pSql; struct SSqlObj * pHb; struct SSqlObj * sqlList; @@ -360,7 +359,7 @@ typedef struct SSqlStream { struct SSqlStream *prev, *next; } SSqlStream; -int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn); +int32_t tscInitRpc(const char *user, const char *secret); void tscInitMsgsFp(); int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion); @@ -426,7 +425,7 @@ void tscQueueAsyncFreeResult(SSqlObj *pSql); int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo); void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column); -extern void * pVnodeConn; +extern void * pDnodeConn; extern void * tscCacheHandle; extern void * tscTmr; extern void * tscQhandle; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 79916c4991..6c23b079d1 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -191,7 +191,6 @@ void tscProcessActivityTimer(void *handle, void *tmrId) { } int tscSendMsgToServer(SSqlObj *pSql) { - STscObj* pObj = pSql->pTscObj; SSqlCmd* pCmd = &pSql->cmd; char *pMsg = rpcMallocCont(pCmd->payloadLen); @@ -201,30 +200,22 @@ int tscSendMsgToServer(SSqlObj *pSql) { } if (pSql->cmd.command < TSDB_SQL_MGMT) { - tscTrace("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList.port[0]); memcpy(pMsg, pSql->cmd.payload + tsRpcHeadSize, pSql->cmd.payloadLen); + } else { + pSql->ipList = tscMgmtIpSet; + memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); + } - SRpcMsg rpcMsg = { + tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]); + + SRpcMsg rpcMsg = { .msgType = pSql->cmd.msgType, .pCont = pMsg, .contLen = pSql->cmd.payloadLen, .handle = pSql, .code = 0 - }; - rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg); - } else { - pSql->ipList = tscMgmtIpSet; - memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); - SRpcMsg rpcMsg = { - .msgType = pSql->cmd.msgType, - .pCont = pMsg, - .contLen = pSql->cmd.payloadLen, - .handle = pSql, - .code = 0 - }; - tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]); - rpcSendRequest(pObj->pMgmtConn, &pSql->ipList, &rpcMsg); - } + }; + rpcSendRequest(pDnodeConn, &pSql->ipList, &rpcMsg); return TSDB_CODE_SUCCESS; } @@ -485,7 +476,7 @@ void tscKillSTableQuery(SSqlObj *pSql) { tscTrace("%p super table query cancelled", pSql); } -int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { +int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) { char *pMsg, *pStart; pStart = pSql->cmd.payload + tsRpcHeadSize; @@ -514,7 +505,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pRetrieveMsg->header.contLen = htonl(pSql->cmd.payloadLen); - pSql->cmd.msgType = TSDB_MSG_TYPE_RETRIEVE; + pSql->cmd.msgType = TSDB_MSG_TYPE_FETCH; return TSDB_CODE_SUCCESS; } @@ -1353,7 +1344,7 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &pSql->cmd; - pCmd->msgType = TSDB_MSG_TYPE_RETRIEVE; + pCmd->msgType = TSDB_MSG_TYPE_CM_RETRIEVE; pCmd->payloadLen = sizeof(SRetrieveTableMsg); if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { @@ -2569,7 +2560,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) { void tscInitMsgsFp() { tscBuildMsg[TSDB_SQL_SELECT] = tscBuildQueryMsg; tscBuildMsg[TSDB_SQL_INSERT] = tscBuildSubmitMsg; - tscBuildMsg[TSDB_SQL_FETCH] = tscBuildRetrieveMsg; + tscBuildMsg[TSDB_SQL_FETCH] = tscBuildFetchMsg; tscBuildMsg[TSDB_SQL_CREATE_DB] = tscBuildCreateDbMsg; tscBuildMsg[TSDB_SQL_CREATE_USER] = tscBuildUserMsg; diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index a39b1a86bd..15d7e76b9a 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -66,8 +66,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con return NULL; } - void* pMgmtConn = NULL; - if (tscInitRpc(user, pass, &pMgmtConn) != 0) { + if (tscInitRpc(user, pass) != 0) { terrno = TSDB_CODE_NETWORK_UNAVAIL; return NULL; } @@ -78,7 +77,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con tscMgmtIpSet.inUse = 0; tscMgmtIpSet.numOfIps = 1; strcpy(tscMgmtIpSet.fqdn[0], ip); - tscMgmtIpSet.port[0] = port? port: tsMnodeShellPort; + tscMgmtIpSet.port[0] = port? port: tsDnodeShellPort; } else { if (tsFirst[0] != 0) { taosGetFqdnPortFromEp(tsFirst, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]); @@ -101,7 +100,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con strncpy(pObj->user, user, TSDB_USER_LEN); taosEncryptPass((uint8_t *)pass, strlen(pass), pObj->pass); - pObj->mgmtPort = port ? port : tsMnodeShellPort; + pObj->mgmtPort = port ? port : tsDnodeShellPort; if (db) { int32_t len = strlen(db); @@ -119,7 +118,6 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con strtolower(pObj->db, tmp); } - pObj->pMgmtConn = pMgmtConn; pthread_mutex_init(&pObj->mutex, NULL); SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj)); @@ -168,13 +166,6 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) { TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) { tscTrace("try to create a connection to %s", ip); - if (port != 0) { - tsServerPort = port; - tsMnodeShellPort = tsServerPort + TSDB_PORT_MNODESHELL; - tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; - tsMnodeDnodePort = tsServerPort + TSDB_PORT_MNODEDNODE; - tsDnodeMnodePort = tsServerPort + TSDB_PORT_DNODEMNODE; - } STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL); if (pObj != NULL) { diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 89c185f199..f7254468b6 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -30,7 +30,7 @@ #include "tlocale.h" // global, not configurable -void * pVnodeConn; +void * pDnodeConn; void * tscCacheHandle; void * tscTmr; void * tscQhandle; @@ -48,15 +48,15 @@ void tscCheckDiskUsage(void *UNUSED_PARAM(para), void* UNUSED_PARAM(param)) { taosTmrReset(tscCheckDiskUsage, 1000, NULL, tscTmr, &tscCheckDiskUsageTmr); } -int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) { +int32_t tscInitRpc(const char *user, const char *secret) { SRpcInit rpcInit; char secretEncrypt[32] = {0}; taosEncryptPass((uint8_t *)secret, strlen(secret), secretEncrypt); - if (pVnodeConn == NULL) { + if (pDnodeConn == NULL) { memset(&rpcInit, 0, sizeof(rpcInit)); rpcInit.localPort = 0; - rpcInit.label = "TSC-vnode"; + rpcInit.label = "TSC"; rpcInit.numOfThreads = tscNumOfThreads; rpcInit.cfp = tscProcessMsgFromServer; rpcInit.sessions = tsMaxVnodeConnections; @@ -66,35 +66,13 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) { rpcInit.ckey = "key"; rpcInit.secret = secretEncrypt; - pVnodeConn = rpcOpen(&rpcInit); - if (pVnodeConn == NULL) { + pDnodeConn = rpcOpen(&rpcInit); + if (pDnodeConn == NULL) { tscError("failed to init connection to vnode"); return -1; } } - if (*pMgmtConn == NULL) { - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.localPort = 0; - rpcInit.label = "TSC-mgmt"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = tscProcessMsgFromServer; - rpcInit.ufp = tscUpdateIpSet; - rpcInit.sessions = tsMaxMgmtConnections; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = 2000; - rpcInit.user = (char*)user; - rpcInit.ckey = "key"; - rpcInit.spi = 1; - rpcInit.secret = secretEncrypt; - - *pMgmtConn = rpcOpen(&rpcInit); - if (*pMgmtConn == NULL) { - tscError("failed to init connection to mgmt"); - return -1; - } - } - return 0; } @@ -190,9 +168,9 @@ void taos_cleanup() { taosCloseLog(); - if (pVnodeConn != NULL) { - rpcClose(pVnodeConn); - pVnodeConn = NULL; + if (pDnodeConn != NULL) { + rpcClose(pDnodeConn); + pDnodeConn = NULL; } taosTmrCleanUp(tscTmr); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 0b11305082..47d4de9f21 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -756,7 +756,10 @@ void tscCloseTscObj(STscObj* pObj) { taosTmrStopA(&(pObj->pTimer)); tscFreeSqlObj(pSql); - rpcClose(pObj->pMgmtConn); + if (pSql) { + sem_destroy(&pSql->rspSem); + } + pthread_mutex_destroy(&pObj->mutex); tscTrace("%p DB connection is closed", pObj); diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 40c4e049d2..05afbab642 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -55,10 +55,8 @@ extern char tsFirst[]; extern char tsSecond[]; extern char tsLocalEp[]; extern uint16_t tsServerPort; -extern uint16_t tsMnodeDnodePort; -extern uint16_t tsMnodeShellPort; extern uint16_t tsDnodeShellPort; -extern uint16_t tsDnodeMnodePort; +extern uint16_t tsDnodeDnodePort; extern uint16_t tsSyncPort; extern int32_t tsStatusInterval; @@ -141,7 +139,8 @@ extern int32_t tsMonitorInterval; extern int32_t tsAsyncLog; extern int32_t tsNumOfLogLines; -extern int32_t ddebugFlag; +extern int32_t dDebugFlag; +extern int32_t vDebugFlag; extern int32_t mdebugFlag; extern int32_t cdebugFlag; extern int32_t jnidebugFlag; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index b50e7b97f1..9828906532 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -66,11 +66,9 @@ char tsSecond[TSDB_FQDN_LEN] = {0}; char tsArbitrator[TSDB_FQDN_LEN] = {0}; char tsLocalEp[TSDB_FQDN_LEN] = {0}; // Local End Point, hostname:port uint16_t tsServerPort = 6030; -uint16_t tsMnodeShellPort = 6030; // udp[6030-6034] tcp[6030] -uint16_t tsDnodeShellPort = 6035; // udp[6035-6039] tcp[6035] -uint16_t tsMnodeDnodePort = 6040; // udp/tcp -uint16_t tsDnodeMnodePort = 6045; // udp/tcp -uint16_t tsSyncPort = 6050; +uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035] +uint16_t tsDnodeDnodePort = 6035; // udp/tcp +uint16_t tsSyncPort = 6040; int32_t tsStatusInterval = 1; // second int32_t tsShellActivityTimer = 3; // second @@ -131,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN; int32_t tsNumOfLogLines = 10000000; int32_t mdebugFlag = 135; int32_t sdbDebugFlag = 135; -int32_t ddebugFlag = 131; -int32_t cdebugFlag = 131; +int32_t dDebugFlag = 135; +int32_t vDebugFlag = 135; +int32_t cdebugFlag = 135; int32_t jnidebugFlag = 131; int32_t odbcdebugFlag = 131; int32_t httpDebugFlag = 131; int32_t monitorDebugFlag = 131; int32_t qdebugFlag = 131; -int32_t rpcDebugFlag = 131; +int32_t rpcDebugFlag = 135; int32_t uDebugFlag = 131; int32_t debugFlag = 131; -int32_t sDebugFlag = 131; +int32_t sDebugFlag = 135; // the maximum number of results for projection query on super table that are returned from // one virtual node, to order according to timestamp @@ -1004,7 +1003,7 @@ static void doInitGlobalConfig() { taosInitConfigOption(cfg); cfg.option = "dDebugFlag"; - cfg.ptr = &ddebugFlag; + cfg.ptr = &dDebugFlag; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG; cfg.minValue = 0; @@ -1233,10 +1232,8 @@ bool taosCheckGlobalCfg() { tsVersion = 10 * tsVersion; - tsMnodeShellPort = tsServerPort + TSDB_PORT_MNODESHELL; // udp[6030-6034] tcp[6030] tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] - tsMnodeDnodePort = tsServerPort + TSDB_PORT_MNODEDNODE; // udp/tcp - tsDnodeMnodePort = tsServerPort + TSDB_PORT_DNODEMNODE; // udp/tcp + tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp tsSyncPort = tsServerPort + TSDB_PORT_SYNC; return true; diff --git a/src/cq/src/cqMain.c b/src/cq/src/cqMain.c index 62b9a41494..e4f3142b89 100644 --- a/src/cq/src/cqMain.c +++ b/src/cq/src/cqMain.c @@ -26,10 +26,10 @@ #include "tcq.h" #include "taos.h" -#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__);} -#define cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);} -#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);} -#define cPrint(...) {taosPrintLog("WAL ", 255, __VA_ARGS__);} +#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__);} +#define cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);} +#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);} +#define cPrint(...) {taosPrintLog("CQ ", 255, __VA_ARGS__);} typedef struct { int vgId; diff --git a/src/cq/test/cqtest.c b/src/cq/test/cqtest.c index f620f44382..7977bd85bc 100644 --- a/src/cq/test/cqtest.c +++ b/src/cq/test/cqtest.c @@ -33,13 +33,13 @@ int main(int argc, char *argv[]) { for (int i=1; i + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_DNODE_LOG_H +#define TDENGINE_DNODE_LOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "tlog.h" + +extern int32_t dDebugFlag; + +#define dError(...) if (dDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR DND ", 255, __VA_ARGS__); } +#define dWarn(...) if (dDebugFlag & DEBUG_WARN) {taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); } +#define dTrace(...) if (dDebugFlag & DEBUG_TRACE) {taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); } +#define dPrint(...) {taosPrintLog("DND ", 255, __VA_ARGS__); } + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/dnode/inc/dnodeLog.h b/src/dnode/inc/dnodeLog.h deleted file mode 100644 index 18a5874e44..0000000000 --- a/src/dnode/inc/dnodeLog.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef TDENGINE_DNODE_LOG_H -#define TDENGINE_DNODE_LOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tlog.h" - -extern int32_t ddebugFlag; - -#define dError(...) \ - if (ddebugFlag & DEBUG_ERROR) { \ - taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \ - } -#define dWarn(...) \ - if (ddebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \ - } -#define dTrace(...) \ - if (ddebugFlag & DEBUG_TRACE) { \ - taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \ - } -#define dPrint(...) \ - { taosPrintLog("DND ", 255, __VA_ARGS__); } - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/dnode/inc/dnodeMgmt.h b/src/dnode/inc/dnodeMgmt.h index b8d01916fe..6f2af423bc 100644 --- a/src/dnode/inc/dnodeMgmt.h +++ b/src/dnode/inc/dnodeMgmt.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitMgmt(); void dnodeCleanupMgmt(); -void dnodeMgmt(SRpcMsg *rpcMsg); +void dnodeDispatchToDnodeMgmt(SRpcMsg *rpcMsg); void* dnodeGetVnode(int32_t vgId); int32_t dnodeGetVnodeStatus(void *pVnode); diff --git a/src/dnode/inc/dnodeMClient.h b/src/dnode/inc/dnodePeer.h similarity index 80% rename from src/dnode/inc/dnodeMClient.h rename to src/dnode/inc/dnodePeer.h index 6d413ada88..2ce8d80c0f 100644 --- a/src/dnode/inc/dnodeMClient.h +++ b/src/dnode/inc/dnodePeer.h @@ -13,16 +13,17 @@ * along with this program. If not, see . */ -#ifndef TDENGINE_DNODE_MCLIENT_H -#define TDENGINE_DNODE_MCLIENT_H +#ifndef TDENGINE_DNODE_DNODE_H +#define TDENGINE_DNODE_DNODE_H #ifdef __cplusplus extern "C" { #endif -int32_t dnodeInitMClient(); -void dnodeCleanupMClient(); -void dnodeSendMsgToMnode(SRpcMsg *rpcMsg); +int32_t dnodeInitServer(); +void dnodeCleanupServer(); +int32_t dnodeInitClient(); +void dnodeCleanupClient(); #ifdef __cplusplus } diff --git a/src/dnode/inc/dnodeRead.h b/src/dnode/inc/dnodeVRead.h similarity index 93% rename from src/dnode/inc/dnodeRead.h rename to src/dnode/inc/dnodeVRead.h index 0d521b6bb5..9e0c7b3120 100644 --- a/src/dnode/inc/dnodeRead.h +++ b/src/dnode/inc/dnodeVRead.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitRead(); void dnodeCleanupRead(); -void dnodeRead(SRpcMsg *pMsg); +void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg); #ifdef __cplusplus } diff --git a/src/dnode/inc/dnodeWrite.h b/src/dnode/inc/dnodeVWrite.h similarity index 94% rename from src/dnode/inc/dnodeWrite.h rename to src/dnode/inc/dnodeVWrite.h index 028eaa95c2..461e51983f 100644 --- a/src/dnode/inc/dnodeWrite.h +++ b/src/dnode/inc/dnodeVWrite.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitWrite(); void dnodeCleanupWrite(); -void dnodeWrite(SRpcMsg *pMsg); +void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg); void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code); #ifdef __cplusplus diff --git a/src/dnode/src/dnodeMClient.c b/src/dnode/src/dnodeMClient.c deleted file mode 100644 index 3aa863799b..0000000000 --- a/src/dnode/src/dnodeMClient.c +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#define _DEFAULT_SOURCE -#include "os.h" -#include "cJSON.h" -#include "taosmsg.h" -#include "trpc.h" -#include "tutil.h" -#include "tsync.h" -#include "ttime.h" -#include "ttimer.h" -#include "tbalance.h" -#include "tglobal.h" -#include "vnode.h" -#include "mnode.h" -#include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" -#include "dnodeModule.h" -#include "dnodeMgmt.h" - -#define MPEER_CONTENT_LEN 2000 - -static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes); -static bool dnodeReadMnodeInfos(); -static void dnodeSaveMnodeInfos(); -static void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg); -static bool dnodeReadDnodeCfg(); -static void dnodeSaveDnodeCfg(); -static void dnodeProcessRspFromMnode(SRpcMsg *pMsg); -static void dnodeProcessStatusRsp(SRpcMsg *pMsg); -static void dnodeSendStatusMsg(void *handle, void *tmrId); -static void (*tsDnodeProcessMgmtRspFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); - -static void *tsDnodeMClientRpc = NULL; -static void *tsDnodeTmr = NULL; -static void *tsStatusTimer = NULL; -static uint32_t tsRebootTime; - -static SRpcIpSet tsMnodeIpSet = {0}; -static SDMMnodeInfos tsMnodeInfos = {0}; -static SDMDnodeCfg tsDnodeCfg = {0}; - -void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { - dTrace("mgmt IP list is changed for ufp is called"); - tsMnodeIpSet = *pIpSet; -} - -void dnodeGetMnodeDnodeIpSet(void *ipSetRaw) { - SRpcIpSet *ipSet = ipSetRaw; - ipSet->numOfIps = tsMnodeInfos.nodeNum; - ipSet->inUse = tsMnodeInfos.inUse; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; ++i) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, ipSet->fqdn[i], &ipSet->port[i]); - ipSet->port[i] += TSDB_PORT_MNODEDNODE; - } -} - -int32_t dnodeInitMClient() { - dnodeReadDnodeCfg(); - tsRebootTime = taosGetTimestampSec(); - - tsDnodeTmr = taosTmrInit(100, 200, 60000, "DND-DM"); - if (tsDnodeTmr == NULL) { - dError("failed to init dnode timer"); - return -1; - } - - if (!dnodeReadMnodeInfos()) { - memset(&tsMnodeIpSet, 0, sizeof(SRpcIpSet)); - memset(&tsMnodeInfos, 0, sizeof(SDMMnodeInfos)); - tsMnodeIpSet.numOfIps = 1; - taosGetFqdnPortFromEp(tsFirst, tsMnodeIpSet.fqdn[0], &tsMnodeIpSet.port[0]); - tsMnodeIpSet.port[0] += TSDB_PORT_MNODEDNODE; - if (strcmp(tsSecond, tsFirst) != 0) { - tsMnodeIpSet.numOfIps = 2; - taosGetFqdnPortFromEp(tsSecond, tsMnodeIpSet.fqdn[1], &tsMnodeIpSet.port[1]); - tsMnodeIpSet.port[1] += TSDB_PORT_MNODEDNODE; - } - } else { - tsMnodeIpSet.inUse = tsMnodeInfos.inUse; - tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); - tsMnodeIpSet.port[i] += TSDB_PORT_MNODEDNODE; - } - } - - SRpcInit rpcInit; - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.label = "DND-MC"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = dnodeProcessRspFromMnode; - rpcInit.ufp = dnodeUpdateIpSet; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = tsShellActivityTimer * 2000; - rpcInit.user = "t"; - rpcInit.ckey = "key"; - rpcInit.secret = "secret"; - - tsDnodeMClientRpc = rpcOpen(&rpcInit); - if (tsDnodeMClientRpc == NULL) { - dError("failed to init mnode rpc client"); - return -1; - } - - tsDnodeProcessMgmtRspFp[TSDB_MSG_TYPE_DM_STATUS_RSP] = dnodeProcessStatusRsp; - taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer); - - dPrint("mnode rpc client is opened"); - return 0; -} - -void dnodeCleanupMClient() { - if (tsStatusTimer != NULL) { - taosTmrStopA(&tsStatusTimer); - tsStatusTimer = NULL; - } - - if (tsDnodeTmr != NULL) { - taosTmrCleanUp(tsDnodeTmr); - tsDnodeTmr = NULL; - } - - if (tsDnodeMClientRpc) { - rpcClose(tsDnodeMClientRpc); - tsDnodeMClientRpc = NULL; - dPrint("mnode rpc client is closed"); - } -} - -static void dnodeProcessRspFromMnode(SRpcMsg *pMsg) { - if (tsDnodeProcessMgmtRspFp[pMsg->msgType]) { - (*tsDnodeProcessMgmtRspFp[pMsg->msgType])(pMsg); - } else { - dError("%s is not processed in dnode mclient", taosMsg[pMsg->msgType]); - SRpcMsg rpcRsp = {.pCont = 0, .contLen = 0, .code = TSDB_CODE_OPS_NOT_SUPPORT, .handle = pMsg->handle}; - rpcSendResponse(&rpcRsp); - } - - rpcFreeCont(pMsg->pCont); -} - -static void dnodeProcessStatusRsp(SRpcMsg *pMsg) { - if (pMsg->code != TSDB_CODE_SUCCESS) { - dError("status rsp is received, error:%s", tstrerror(pMsg->code)); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - return; - } - - SDMStatusRsp *pStatusRsp = pMsg->pCont; - SDMMnodeInfos *pMnodes = &pStatusRsp->mnodes; - if (pMnodes->nodeNum <= 0) { - dError("status msg is invalid, num of ips is %d", pMnodes->nodeNum); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - return; - } - - SDMDnodeCfg *pCfg = &pStatusRsp->dnodeCfg; - pCfg->numOfVnodes = htonl(pCfg->numOfVnodes); - pCfg->moduleStatus = htonl(pCfg->moduleStatus); - pCfg->dnodeId = htonl(pCfg->dnodeId); - - for (int32_t i = 0; i < pMnodes->nodeNum; ++i) { - SDMMnodeInfo *pMnodeInfo = &pMnodes->nodeInfos[i]; - pMnodeInfo->nodeId = htonl(pMnodeInfo->nodeId); - } - - SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess; - for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) { - pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId); - } - - dnodeProcessModuleStatus(pCfg->moduleStatus); - dnodeUpdateDnodeCfg(pCfg); - dnodeUpdateMnodeInfos(pMnodes); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); -} - -static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) { - bool mnodesChanged = (memcmp(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)) != 0); - bool mnodesNotInit = (tsMnodeInfos.nodeNum == 0); - if (!(mnodesChanged || mnodesNotInit)) return; - - memcpy(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)); - - tsMnodeIpSet.inUse = tsMnodeInfos.inUse; - tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); - tsMnodeIpSet.port[i] += TSDB_PORT_MNODEDNODE; - } - - dPrint("mnodes is changed, nodeNum:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); - } - - dnodeSaveMnodeInfos(); - sdbUpdateSync(); -} - -void dnodeSendMsgToMnode(SRpcMsg *rpcMsg) { - if (tsDnodeMClientRpc) { - rpcSendRequest(tsDnodeMClientRpc, &tsMnodeIpSet, rpcMsg); - } -} - -static bool dnodeReadMnodeInfos() { - char ipFile[TSDB_FILENAME_LEN] = {0}; - sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); - FILE *fp = fopen(ipFile, "r"); - if (!fp) { - dTrace("failed to read mnode mgmtIpList.json, file not exist"); - return false; - } - - bool ret = false; - int maxLen = 2000; - char *content = calloc(1, maxLen + 1); - int len = fread(content, 1, maxLen, fp); - if (len <= 0) { - free(content); - fclose(fp); - dError("failed to read mnode mgmtIpList.json, content is null"); - return false; - } - - cJSON* root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read mnode mgmtIpList.json, invalid json format"); - goto PARSE_OVER; - } - - cJSON* inUse = cJSON_GetObjectItem(root, "inUse"); - if (!inUse || inUse->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, inUse not found"); - goto PARSE_OVER; - } - tsMnodeInfos.inUse = inUse->valueint; - - cJSON* nodeNum = cJSON_GetObjectItem(root, "nodeNum"); - if (!nodeNum || nodeNum->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, nodeNum not found"); - goto PARSE_OVER; - } - tsMnodeInfos.nodeNum = nodeNum->valueint; - - cJSON* nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); - if (!nodeInfos || nodeInfos->type != cJSON_Array) { - dError("failed to read mnode mgmtIpList.json, nodeInfos not found"); - goto PARSE_OVER; - } - - int size = cJSON_GetArraySize(nodeInfos); - if (size != tsMnodeInfos.nodeNum) { - dError("failed to read mnode mgmtIpList.json, nodeInfos size not matched"); - goto PARSE_OVER; - } - - for (int i = 0; i < size; ++i) { - cJSON* nodeInfo = cJSON_GetArrayItem(nodeInfos, i); - if (nodeInfo == NULL) continue; - - cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); - if (!nodeId || nodeId->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, nodeId not found"); - goto PARSE_OVER; - } - tsMnodeInfos.nodeInfos[i].nodeId = nodeId->valueint; - - cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); - if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { - dError("failed to read mnode mgmtIpList.json, nodeName not found"); - goto PARSE_OVER; - } - strncpy(tsMnodeInfos.nodeInfos[i].nodeEp, nodeEp->valuestring, TSDB_FQDN_LEN); - } - - ret = true; - - dPrint("read mnode iplist successed, numOfIps:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); - } - -PARSE_OVER: - free(content); - cJSON_Delete(root); - fclose(fp); - return ret; -} - -static void dnodeSaveMnodeInfos() { - char ipFile[TSDB_FILENAME_LEN] = {0}; - sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); - FILE *fp = fopen(ipFile, "w"); - if (!fp) return; - - int32_t len = 0; - int32_t maxLen = 2000; - char * content = calloc(1, maxLen + 1); - - len += snprintf(content + len, maxLen - len, "{\n"); - len += snprintf(content + len, maxLen - len, " \"inUse\": %d,\n", tsMnodeInfos.inUse); - len += snprintf(content + len, maxLen - len, " \"nodeNum\": %d,\n", tsMnodeInfos.nodeNum); - len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n"); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", tsMnodeInfos.nodeInfos[i].nodeId); - len += snprintf(content + len, maxLen - len, " \"nodeEp\": \"%s\"\n", tsMnodeInfos.nodeInfos[i].nodeEp); - if (i < tsMnodeInfos.nodeNum -1) { - len += snprintf(content + len, maxLen - len, " },{\n"); - } else { - len += snprintf(content + len, maxLen - len, " }]\n"); - } - } - len += snprintf(content + len, maxLen - len, "}\n"); - - fwrite(content, 1, len, fp); - fclose(fp); - free(content); - - dPrint("save mnode iplist successed"); -} - -char *dnodeGetMnodeMasterEp() { - return tsMnodeInfos.nodeInfos[tsMnodeIpSet.inUse].nodeEp; -} - -void* dnodeGetMnodeInfos() { - return &tsMnodeInfos; -} - -static void dnodeSendStatusMsg(void *handle, void *tmrId) { - if (tsDnodeTmr == NULL) { - dError("dnode timer is already released"); - return; - } - - if (tsStatusTimer == NULL) { - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - dError("failed to start status timer"); - return; - } - - int32_t contLen = sizeof(SDMStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); - SDMStatusMsg *pStatus = rpcMallocCont(contLen); - if (pStatus == NULL) { - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - dError("failed to malloc status message"); - return; - } - - //strcpy(pStatus->dnodeName, tsDnodeName); - pStatus->version = htonl(tsVersion); - 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; - - vnodeBuildStatusMsg(pStatus); - contLen = sizeof(SDMStatusMsg) + pStatus->openVnodes * sizeof(SVnodeLoad); - pStatus->openVnodes = htons(pStatus->openVnodes); - - SRpcMsg rpcMsg = { - .pCont = pStatus, - .contLen = contLen, - .msgType = TSDB_MSG_TYPE_DM_STATUS - }; - - dnodeSendMsgToMnode(&rpcMsg); -} - -static bool dnodeReadDnodeCfg() { - char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; - sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); - - FILE *fp = fopen(dnodeCfgFile, "r"); - if (!fp) { - dTrace("failed to read dnodeCfg.json, file not exist"); - return false; - } - - bool ret = false; - int maxLen = 100; - char *content = calloc(1, maxLen + 1); - int len = fread(content, 1, maxLen, fp); - if (len <= 0) { - free(content); - fclose(fp); - dError("failed to read dnodeCfg.json, content is null"); - return false; - } - - cJSON* root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read dnodeCfg.json, invalid json format"); - goto PARSE_CFG_OVER; - } - - cJSON* dnodeId = cJSON_GetObjectItem(root, "dnodeId"); - if (!dnodeId || dnodeId->type != cJSON_Number) { - dError("failed to read dnodeCfg.json, dnodeId not found"); - goto PARSE_CFG_OVER; - } - tsDnodeCfg.dnodeId = dnodeId->valueint; - - ret = true; - - dPrint("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId); - -PARSE_CFG_OVER: - free(content); - cJSON_Delete(root); - fclose(fp); - return ret; -} - -static void dnodeSaveDnodeCfg() { - char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; - sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); - - FILE *fp = fopen(dnodeCfgFile, "w"); - if (!fp) return; - - int32_t len = 0; - int32_t maxLen = 100; - char * content = calloc(1, maxLen + 1); - - len += snprintf(content + len, maxLen - len, "{\n"); - len += snprintf(content + len, maxLen - len, " \"dnodeId\": %d\n", tsDnodeCfg.dnodeId); - len += snprintf(content + len, maxLen - len, "}\n"); - - fwrite(content, 1, len, fp); - fclose(fp); - free(content); - - dPrint("save dnodeId successed"); -} - -void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) { - if (tsDnodeCfg.dnodeId == 0) { - dPrint("dnodeId is set to %d", pCfg->dnodeId); - tsDnodeCfg.dnodeId = pCfg->dnodeId; - dnodeSaveDnodeCfg(); - } -} - -int32_t dnodeGetDnodeId() { - return tsDnodeCfg.dnodeId; -} diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index 940b884927..5b62192fa8 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -22,14 +22,13 @@ #include "tconfig.h" #include "tglobal.h" #include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeMnode.h" +#include "dnodePeer.h" #include "dnodeModule.h" -#include "dnodeRead.h" +#include "dnodeVRead.h" #include "dnodeShell.h" -#include "dnodeWrite.h" +#include "dnodeVWrite.h" #include "tgrant.h" static int32_t dnodeInitSystem(); @@ -167,9 +166,9 @@ static int32_t dnodeInitSystem() { if (dnodeInitStorage() != 0) return -1; if (dnodeInitRead() != 0) return -1; if (dnodeInitWrite() != 0) return -1; - if (dnodeInitMClient() != 0) return -1; + if (dnodeInitClient() != 0) return -1; if (dnodeInitModules() != 0) return -1; - if (dnodeInitMnode() != 0) return -1; + if (dnodeInitServer() != 0) return -1; if (dnodeInitMgmt() != 0) return -1; if (dnodeInitShell() != 0) return -1; @@ -185,9 +184,9 @@ static void dnodeCleanUpSystem() { if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) { dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED); dnodeCleanupShell(); - dnodeCleanupMnode(); + dnodeCleanupServer(); dnodeCleanupMgmt(); - dnodeCleanupMClient(); + dnodeCleanupClient(); dnodeCleanupWrite(); dnodeCleanupRead(); dnodeCleanUpModules(); diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index fbf1ceea71..62d22573ff 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -15,19 +15,47 @@ #define _DEFAULT_SOURCE #include "os.h" +#include "cJSON.h" #include "ihash.h" #include "taoserror.h" #include "taosmsg.h" +#include "ttime.h" +#include "ttimer.h" #include "trpc.h" #include "tsdb.h" #include "twal.h" -#include "vnode.h" +#include "tsync.h" +#include "ttime.h" +#include "ttimer.h" +#include "tbalance.h" #include "tglobal.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" +#include "dnode.h" +#include "vnode.h" +#include "mnode.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeRead.h" -#include "dnodeWrite.h" +#include "dnodeVRead.h" +#include "dnodeVWrite.h" +#include "dnodeModule.h" + +#define MPEER_CONTENT_LEN 2000 + +static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes); +static bool dnodeReadMnodeInfos(); +static void dnodeSaveMnodeInfos(); +static void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg); +static bool dnodeReadDnodeCfg(); +static void dnodeSaveDnodeCfg(); +static void dnodeProcessStatusRsp(SRpcMsg *pMsg); +static void dnodeSendStatusMsg(void *handle, void *tmrId); + +static void *tsDnodeTmr = NULL; +static void *tsStatusTimer = NULL; +static uint32_t tsRebootTime; + +static SRpcIpSet tsMnodeIpSet = {0}; +static SDMMnodeInfos tsMnodeInfos = {0}; +static SDMDnodeCfg tsDnodeCfg = {0}; static int32_t dnodeOpenVnodes(); static void dnodeCloseVnodes(); @@ -43,19 +71,63 @@ int32_t dnodeInitMgmt() { dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeProcessConfigDnodeMsg; + dnodeAddClientRspHandle(TSDB_MSG_TYPE_DM_STATUS_RSP, dnodeProcessStatusRsp); + dnodeReadDnodeCfg(); + tsRebootTime = taosGetTimestampSec(); + + tsDnodeTmr = taosTmrInit(100, 200, 60000, "DND-DM"); + if (tsDnodeTmr == NULL) { + dError("failed to init dnode timer"); + return -1; + } + + if (!dnodeReadMnodeInfos()) { + memset(&tsMnodeIpSet, 0, sizeof(SRpcIpSet)); + memset(&tsMnodeInfos, 0, sizeof(SDMMnodeInfos)); + tsMnodeIpSet.numOfIps = 1; + taosGetFqdnPortFromEp(tsFirst, tsMnodeIpSet.fqdn[0], &tsMnodeIpSet.port[0]); + tsMnodeIpSet.port[0] += TSDB_PORT_DNODEDNODE; + if (strcmp(tsSecond, tsFirst) != 0) { + tsMnodeIpSet.numOfIps = 2; + taosGetFqdnPortFromEp(tsSecond, tsMnodeIpSet.fqdn[1], &tsMnodeIpSet.port[1]); + tsMnodeIpSet.port[1] += TSDB_PORT_DNODEDNODE; + } + } else { + tsMnodeIpSet.inUse = tsMnodeInfos.inUse; + tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); + tsMnodeIpSet.port[i] += TSDB_PORT_DNODEDNODE; + } + } + int32_t code = dnodeOpenVnodes(); if (code != TSDB_CODE_SUCCESS) { return -1; } + taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer); + + dPrint("dnode mgmt is initialized"); + return TSDB_CODE_SUCCESS; } void dnodeCleanupMgmt() { + if (tsStatusTimer != NULL) { + taosTmrStopA(&tsStatusTimer); + tsStatusTimer = NULL; + } + + if (tsDnodeTmr != NULL) { + taosTmrCleanUp(tsDnodeTmr); + tsDnodeTmr = NULL; + } + dnodeCloseVnodes(); } -void dnodeMgmt(SRpcMsg *pMsg) { +void dnodeDispatchToDnodeMgmt(SRpcMsg *pMsg) { SRpcMsg rsp; if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { @@ -116,7 +188,7 @@ static int32_t dnodeOpenVnodes() { free(vnodeList); - dPrint("there are total vnodes:%d, failed to open:%d", numOfVnodes, failed); + dPrint("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, numOfVnodes-failed, failed); return TSDB_CODE_SUCCESS; } @@ -193,3 +265,326 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) { SMDCfgDnodeMsg *pCfg = (SMDCfgDnodeMsg *)pMsg->pCont; return taosCfgDynamicOptions(pCfg->config); } + + +void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { + dTrace("mgmt IP list is changed for ufp is called"); + tsMnodeIpSet = *pIpSet; +} + +void dnodeGetMnodeDnodeIpSet(void *ipSetRaw) { + SRpcIpSet *ipSet = ipSetRaw; + ipSet->numOfIps = tsMnodeInfos.nodeNum; + ipSet->inUse = tsMnodeInfos.inUse; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; ++i) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, ipSet->fqdn[i], &ipSet->port[i]); + ipSet->port[i] += TSDB_PORT_DNODEDNODE; + } +} + +static void dnodeProcessStatusRsp(SRpcMsg *pMsg) { + if (pMsg->code != TSDB_CODE_SUCCESS) { + dError("status rsp is received, error:%s", tstrerror(pMsg->code)); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + return; + } + + SDMStatusRsp *pStatusRsp = pMsg->pCont; + SDMMnodeInfos *pMnodes = &pStatusRsp->mnodes; + if (pMnodes->nodeNum <= 0) { + dError("status msg is invalid, num of ips is %d", pMnodes->nodeNum); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + return; + } + + SDMDnodeCfg *pCfg = &pStatusRsp->dnodeCfg; + pCfg->numOfVnodes = htonl(pCfg->numOfVnodes); + pCfg->moduleStatus = htonl(pCfg->moduleStatus); + pCfg->dnodeId = htonl(pCfg->dnodeId); + + for (int32_t i = 0; i < pMnodes->nodeNum; ++i) { + SDMMnodeInfo *pMnodeInfo = &pMnodes->nodeInfos[i]; + pMnodeInfo->nodeId = htonl(pMnodeInfo->nodeId); + } + + SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess; + for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) { + pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId); + } + + dnodeProcessModuleStatus(pCfg->moduleStatus); + dnodeUpdateDnodeCfg(pCfg); + dnodeUpdateMnodeInfos(pMnodes); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); +} + +static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) { + bool mnodesChanged = (memcmp(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)) != 0); + bool mnodesNotInit = (tsMnodeInfos.nodeNum == 0); + if (!(mnodesChanged || mnodesNotInit)) return; + + memcpy(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)); + + tsMnodeIpSet.inUse = tsMnodeInfos.inUse; + tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); + tsMnodeIpSet.port[i] += TSDB_PORT_DNODEDNODE; + } + + dPrint("mnodes is changed, nodeNum:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); + } + + dnodeSaveMnodeInfos(); + sdbUpdateSync(); +} + +static bool dnodeReadMnodeInfos() { + char ipFile[TSDB_FILENAME_LEN] = {0}; + sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); + FILE *fp = fopen(ipFile, "r"); + if (!fp) { + dTrace("failed to read mnode mgmtIpList.json, file not exist"); + return false; + } + + bool ret = false; + int maxLen = 2000; + char *content = calloc(1, maxLen + 1); + int len = fread(content, 1, maxLen, fp); + if (len <= 0) { + free(content); + fclose(fp); + dError("failed to read mnode mgmtIpList.json, content is null"); + return false; + } + + cJSON* root = cJSON_Parse(content); + if (root == NULL) { + dError("failed to read mnode mgmtIpList.json, invalid json format"); + goto PARSE_OVER; + } + + cJSON* inUse = cJSON_GetObjectItem(root, "inUse"); + if (!inUse || inUse->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, inUse not found"); + goto PARSE_OVER; + } + tsMnodeInfos.inUse = inUse->valueint; + + cJSON* nodeNum = cJSON_GetObjectItem(root, "nodeNum"); + if (!nodeNum || nodeNum->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, nodeNum not found"); + goto PARSE_OVER; + } + tsMnodeInfos.nodeNum = nodeNum->valueint; + + cJSON* nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); + if (!nodeInfos || nodeInfos->type != cJSON_Array) { + dError("failed to read mnode mgmtIpList.json, nodeInfos not found"); + goto PARSE_OVER; + } + + int size = cJSON_GetArraySize(nodeInfos); + if (size != tsMnodeInfos.nodeNum) { + dError("failed to read mnode mgmtIpList.json, nodeInfos size not matched"); + goto PARSE_OVER; + } + + for (int i = 0; i < size; ++i) { + cJSON* nodeInfo = cJSON_GetArrayItem(nodeInfos, i); + if (nodeInfo == NULL) continue; + + cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); + if (!nodeId || nodeId->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, nodeId not found"); + goto PARSE_OVER; + } + tsMnodeInfos.nodeInfos[i].nodeId = nodeId->valueint; + + cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); + if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { + dError("failed to read mnode mgmtIpList.json, nodeName not found"); + goto PARSE_OVER; + } + strncpy(tsMnodeInfos.nodeInfos[i].nodeEp, nodeEp->valuestring, TSDB_FQDN_LEN); + } + + ret = true; + + dPrint("read mnode iplist successed, numOfIps:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); + } + +PARSE_OVER: + free(content); + cJSON_Delete(root); + fclose(fp); + return ret; +} + +static void dnodeSaveMnodeInfos() { + char ipFile[TSDB_FILENAME_LEN] = {0}; + sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); + FILE *fp = fopen(ipFile, "w"); + if (!fp) return; + + int32_t len = 0; + int32_t maxLen = 2000; + char * content = calloc(1, maxLen + 1); + + len += snprintf(content + len, maxLen - len, "{\n"); + len += snprintf(content + len, maxLen - len, " \"inUse\": %d,\n", tsMnodeInfos.inUse); + len += snprintf(content + len, maxLen - len, " \"nodeNum\": %d,\n", tsMnodeInfos.nodeNum); + len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n"); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", tsMnodeInfos.nodeInfos[i].nodeId); + len += snprintf(content + len, maxLen - len, " \"nodeEp\": \"%s\"\n", tsMnodeInfos.nodeInfos[i].nodeEp); + if (i < tsMnodeInfos.nodeNum -1) { + len += snprintf(content + len, maxLen - len, " },{\n"); + } else { + len += snprintf(content + len, maxLen - len, " }]\n"); + } + } + len += snprintf(content + len, maxLen - len, "}\n"); + + fwrite(content, 1, len, fp); + fclose(fp); + free(content); + + dPrint("save mnode iplist successed"); +} + +char *dnodeGetMnodeMasterEp() { + return tsMnodeInfos.nodeInfos[tsMnodeIpSet.inUse].nodeEp; +} + +void* dnodeGetMnodeInfos() { + return &tsMnodeInfos; +} + +static void dnodeSendStatusMsg(void *handle, void *tmrId) { + if (tsDnodeTmr == NULL) { + dError("dnode timer is already released"); + return; + } + + if (tsStatusTimer == NULL) { + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + dError("failed to start status timer"); + return; + } + + int32_t contLen = sizeof(SDMStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); + SDMStatusMsg *pStatus = rpcMallocCont(contLen); + if (pStatus == NULL) { + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + dError("failed to malloc status message"); + return; + } + + //strcpy(pStatus->dnodeName, tsDnodeName); + pStatus->version = htonl(tsVersion); + 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; + + vnodeBuildStatusMsg(pStatus); + contLen = sizeof(SDMStatusMsg) + pStatus->openVnodes * sizeof(SVnodeLoad); + pStatus->openVnodes = htons(pStatus->openVnodes); + + SRpcMsg rpcMsg = { + .pCont = pStatus, + .contLen = contLen, + .msgType = TSDB_MSG_TYPE_DM_STATUS + }; + + dnodeSendMsgToDnode(&tsMnodeIpSet, &rpcMsg); +} + +static bool dnodeReadDnodeCfg() { + char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; + sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); + + FILE *fp = fopen(dnodeCfgFile, "r"); + if (!fp) { + dTrace("failed to read dnodeCfg.json, file not exist"); + return false; + } + + bool ret = false; + int maxLen = 100; + char *content = calloc(1, maxLen + 1); + int len = fread(content, 1, maxLen, fp); + if (len <= 0) { + free(content); + fclose(fp); + dError("failed to read dnodeCfg.json, content is null"); + return false; + } + + cJSON* root = cJSON_Parse(content); + if (root == NULL) { + dError("failed to read dnodeCfg.json, invalid json format"); + goto PARSE_CFG_OVER; + } + + cJSON* dnodeId = cJSON_GetObjectItem(root, "dnodeId"); + if (!dnodeId || dnodeId->type != cJSON_Number) { + dError("failed to read dnodeCfg.json, dnodeId not found"); + goto PARSE_CFG_OVER; + } + tsDnodeCfg.dnodeId = dnodeId->valueint; + + ret = true; + + dPrint("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId); + +PARSE_CFG_OVER: + free(content); + cJSON_Delete(root); + fclose(fp); + return ret; +} + +static void dnodeSaveDnodeCfg() { + char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; + sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); + + FILE *fp = fopen(dnodeCfgFile, "w"); + if (!fp) return; + + int32_t len = 0; + int32_t maxLen = 100; + char * content = calloc(1, maxLen + 1); + + len += snprintf(content + len, maxLen - len, "{\n"); + len += snprintf(content + len, maxLen - len, " \"dnodeId\": %d\n", tsDnodeCfg.dnodeId); + len += snprintf(content + len, maxLen - len, "}\n"); + + fwrite(content, 1, len, fp); + fclose(fp); + free(content); + + dPrint("save dnodeId successed"); +} + +void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) { + if (tsDnodeCfg.dnodeId == 0) { + dPrint("dnodeId is set to %d", pCfg->dnodeId); + tsDnodeCfg.dnodeId = pCfg->dnodeId; + dnodeSaveDnodeCfg(); + } +} + +int32_t dnodeGetDnodeId() { + return tsDnodeCfg.dnodeId; +} + diff --git a/src/dnode/src/dnodeMnode.c b/src/dnode/src/dnodeMnode.c deleted file mode 100644 index 75c09d43ba..0000000000 --- a/src/dnode/src/dnodeMnode.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "os.h" -#include "taosmsg.h" -#include "tglobal.h" -#include "trpc.h" -#include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMgmt.h" -#include "dnodeWrite.h" - -static void (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); -static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg); -static void *tsDnodeMnodeRpc = NULL; - -int32_t dnodeInitMnode() { - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeMgmt; - - SRpcInit rpcInit; - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.localPort = tsDnodeMnodePort; - rpcInit.label = "DND-MS"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = dnodeProcessMsgFromMnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 2000; - - tsDnodeMnodeRpc = rpcOpen(&rpcInit); - if (tsDnodeMnodeRpc == NULL) { - dError("failed to init mnode rpc server"); - return -1; - } - - dPrint("mnode rpc server is opened"); - return 0; -} - -void dnodeCleanupMnode() { - if (tsDnodeMnodeRpc) { - rpcClose(tsDnodeMnodeRpc); - tsDnodeMnodeRpc = NULL; - dPrint("mnode rpc server is closed"); - } -} - -static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg) { - SRpcMsg rspMsg; - rspMsg.handle = pMsg->handle; - rspMsg.pCont = NULL; - rspMsg.contLen = 0; - - if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { - rspMsg.code = TSDB_CODE_NOT_READY; - rpcSendResponse(&rspMsg); - rpcFreeCont(pMsg->pCont); - dTrace("thandle:%p, query msg is ignored since dnode not running", pMsg->handle); - return; - } - - if (pMsg->pCont == NULL) { - rspMsg.code = TSDB_CODE_INVALID_MSG_LEN; - rpcSendResponse(&rspMsg); - return; - } - - if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { - (*dnodeProcessMgmtMsgFp[pMsg->msgType])(pMsg); - } else { - dError("%s is not processed in dnode mserver", taosMsg[pMsg->msgType]); - rspMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; - rpcSendResponse(&rspMsg); - rpcFreeCont(pMsg->pCont); - } -} - - diff --git a/src/dnode/src/dnodeModule.c b/src/dnode/src/dnodeModule.c index e1aa48d477..2e081de2a8 100644 --- a/src/dnode/src/dnodeModule.c +++ b/src/dnode/src/dnodeModule.c @@ -17,10 +17,11 @@ #include "os.h" #include "taosdef.h" #include "tglobal.h" +#include "trpc.h" #include "mnode.h" #include "http.h" #include "monitor.h" -#include "dnodeLog.h" +#include "dnodeInt.h" #include "dnodeModule.h" typedef struct { diff --git a/src/dnode/src/dnodePeer.c b/src/dnode/src/dnodePeer.c new file mode 100644 index 0000000000..b1e5d9fd38 --- /dev/null +++ b/src/dnode/src/dnodePeer.c @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* this file is mainly responsible for the communication between DNODEs. Each + * dnode works as both server and client. Dnode may send status, grant, config + * messages to mnode, mnode may send create/alter/drop table/vnode messages + * to dnode. All theses messages are handled from here + */ + +#include "os.h" +#include "taosmsg.h" +#include "tglobal.h" +#include "trpc.h" +#include "dnode.h" +#include "dnodeInt.h" +#include "dnodeMgmt.h" +#include "dnodeVWrite.h" +#include "mnode.h" + +extern void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet); +static void (*dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); +static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg); +static void (*dnodeProcessRspMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); +static void dnodeProcessRspFromDnode(SRpcMsg *pMsg); +static void *tsDnodeServerRpc = NULL; +static void *tsDnodeClientRpc = NULL; + +int32_t dnodeInitServer() { + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = dnodeDispatchToVnodeWriteQueue; + + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeDispatchToDnodeMgmt; + + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_TABLE] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_VNODE] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_GRANT] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_STATUS] = mgmtProcessReqMsgFromDnode; + + SRpcInit rpcInit; + memset(&rpcInit, 0, sizeof(rpcInit)); + rpcInit.localPort = tsDnodeDnodePort; + rpcInit.label = "DND-S"; + rpcInit.numOfThreads = 1; + rpcInit.cfp = dnodeProcessReqMsgFromDnode; + rpcInit.sessions = 100; + rpcInit.connType = TAOS_CONN_SERVER; + rpcInit.idleTime = tsShellActivityTimer * 2000; + + tsDnodeServerRpc = rpcOpen(&rpcInit); + if (tsDnodeServerRpc == NULL) { + dError("failed to init inter-dnodes RPC server"); + return -1; + } + + dPrint("inter-dnodes RPC server is opened"); + return 0; +} + +void dnodeCleanupServer() { + if (tsDnodeServerRpc) { + rpcClose(tsDnodeServerRpc); + tsDnodeServerRpc = NULL; + dPrint("inter-dnodes RPC server is closed"); + } +} + +static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg) { + SRpcMsg rspMsg; + rspMsg.handle = pMsg->handle; + rspMsg.pCont = NULL; + rspMsg.contLen = 0; + + if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { + rspMsg.code = TSDB_CODE_NOT_READY; + rpcSendResponse(&rspMsg); + rpcFreeCont(pMsg->pCont); + dTrace("RPC %p, msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]); + return; + } + + if (pMsg->pCont == NULL) { + rspMsg.code = TSDB_CODE_INVALID_MSG_LEN; + rpcSendResponse(&rspMsg); + return; + } + + if (dnodeProcessReqMsgFp[pMsg->msgType]) { + (*dnodeProcessReqMsgFp[pMsg->msgType])(pMsg); + } else { + rspMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; + rpcSendResponse(&rspMsg); + rpcFreeCont(pMsg->pCont); + dTrace("RPC %p, message:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]); + return; + + } +} + +int32_t dnodeInitClient() { + SRpcInit rpcInit; + memset(&rpcInit, 0, sizeof(rpcInit)); + rpcInit.label = "DND-C"; + rpcInit.numOfThreads = 1; + rpcInit.cfp = dnodeProcessRspFromDnode; + rpcInit.ufp = dnodeUpdateIpSet; + rpcInit.sessions = 100; + rpcInit.connType = TAOS_CONN_CLIENT; + rpcInit.idleTime = tsShellActivityTimer * 2000; + rpcInit.user = "t"; + rpcInit.ckey = "key"; + rpcInit.secret = "secret"; + + tsDnodeClientRpc = rpcOpen(&rpcInit); + if (tsDnodeClientRpc == NULL) { + dError("failed to init mnode rpc client"); + return -1; + } + + dPrint("inter-dnodes rpc client is opened"); + return 0; +} + +void dnodeCleanupClient() { + if (tsDnodeClientRpc) { + rpcClose(tsDnodeClientRpc); + tsDnodeClientRpc = NULL; + dPrint("inter-dnodes rpc client is closed"); + } +} + +static void dnodeProcessRspFromDnode(SRpcMsg *pMsg) { + + if (dnodeProcessRspMsgFp[pMsg->msgType]) { + (*dnodeProcessRspMsgFp[pMsg->msgType])(pMsg); + } else { + dError("RPC %p, msg:%s is not processed", pMsg->handle, taosMsg[pMsg->msgType]); + } + + rpcFreeCont(pMsg->pCont); +} + +void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { + dnodeProcessRspMsgFp[msgType] = fp; +} + +void dnodeSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg) { + rpcSendRequest(tsDnodeClientRpc, ipSet, rpcMsg); +} diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index 544d443bc0..8ca3aa12e1 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -22,9 +22,9 @@ #include "tglobal.h" #include "http.h" #include "dnode.h" -#include "dnodeLog.h" -#include "dnodeRead.h" -#include "dnodeWrite.h" +#include "dnodeInt.h" +#include "dnodeVRead.h" +#include "dnodeVWrite.h" #include "dnodeShell.h" static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); @@ -34,10 +34,43 @@ static void * tsDnodeShellRpc = NULL; static int32_t tsDnodeQueryReqNum = 0; static int32_t tsDnodeSubmitReqNum = 0; +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg); + int32_t dnodeInitShell() { - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeWrite; - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeRead; - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_RETRIEVE] = dnodeRead; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeDispatchToVnodeReadQueue; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_FETCH] = dnodeDispatchToVnodeReadQueue; + + // the following message shall be treated as mnode write + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CONNECT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DNODE]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DNODE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_TABLE]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_TABLE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_TABLE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_STREAM]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_QUERY] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_STREAM] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_CONN] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_HEARTBEAT] = mgmtProcessMsgFromShell; + + // the following message shall be treated as mnode query + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_USE_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_TABLE_META] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_STABLE_VGROUP]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_TABLES_META] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_SHOW] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_RETRIEVE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CONFIG_DNODE]= mgmtProcessMsgFromShell; int32_t numOfThreads = tsNumOfCores * tsNumOfThreadsPerCore; numOfThreads = (int32_t) ((1.0 - tsRatioOfQueryThreads) * numOfThreads / 2.0); @@ -48,7 +81,7 @@ int32_t dnodeInitShell() { SRpcInit rpcInit; memset(&rpcInit, 0, sizeof(rpcInit)); rpcInit.localPort = tsDnodeShellPort; - rpcInit.label = "DND-shell"; + rpcInit.label = "SHELL"; rpcInit.numOfThreads = numOfThreads; rpcInit.cfp = dnodeProcessMsgFromShell; rpcInit.sessions = TSDB_SESSIONS_PER_DNODE; @@ -80,7 +113,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { rpcMsg.contLen = 0; if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { - dError("RPC %p, shell msg is ignored since dnode not running", pMsg->handle); + dError("RPC %p, shell msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]); rpcMsg.code = TSDB_CODE_NOT_READY; rpcSendResponse(&rpcMsg); rpcFreeCont(pMsg->pCont); @@ -96,13 +129,15 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { if ( dnodeProcessShellMsgFp[pMsg->msgType] ) { (*dnodeProcessShellMsgFp[pMsg->msgType])(pMsg); } else { - dError("RPC %p, msg:%s from shell is not handled", pMsg->handle, taosMsg[pMsg->msgType]); + dError("RPC %p, shell msg:%s is not processed", pMsg->handle, taosMsg[pMsg->msgType]); rpcMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; rpcSendResponse(&rpcMsg); rpcFreeCont(pMsg->pCont); + return; } } + static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) { return TSDB_CODE_SUCCESS; } diff --git a/src/dnode/src/dnodeRead.c b/src/dnode/src/dnodeVRead.c similarity index 97% rename from src/dnode/src/dnodeRead.c rename to src/dnode/src/dnodeVRead.c index efa5dc7695..ff211bf1b2 100644 --- a/src/dnode/src/dnodeRead.c +++ b/src/dnode/src/dnodeVRead.c @@ -21,9 +21,9 @@ #include "trpc.h" #include "twal.h" #include "tglobal.h" -#include "dnodeLog.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeRead.h" +#include "dnodeVRead.h" #include "vnode.h" typedef struct { @@ -84,7 +84,7 @@ void dnodeCleanupRead() { dPrint("dnode read is closed"); } -void dnodeRead(SRpcMsg *pMsg) { +void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) { int32_t queuedMsgNum = 0; int32_t leftLen = pMsg->contLen; char *pCont = (char *) pMsg->pCont; @@ -97,7 +97,7 @@ void dnodeRead(SRpcMsg *pMsg) { pHead->vgId = htonl(pHead->vgId); pHead->contLen = htonl(pHead->contLen); - if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { + if (pMsg->msgType == TSDB_MSG_TYPE_FETCH) { pVnode = vnodeGetVnode(pHead->vgId); } else { pVnode = vnodeAccquireVnode(pHead->vgId); diff --git a/src/dnode/src/dnodeWrite.c b/src/dnode/src/dnodeVWrite.c similarity index 98% rename from src/dnode/src/dnodeWrite.c rename to src/dnode/src/dnodeVWrite.c index 4ca9b1935d..147d2bdfbb 100644 --- a/src/dnode/src/dnodeWrite.c +++ b/src/dnode/src/dnodeVWrite.c @@ -24,8 +24,8 @@ #include "tglobal.h" #include "vnode.h" #include "tdataformat.h" -#include "dnodeLog.h" -#include "dnodeWrite.h" +#include "dnodeInt.h" +#include "dnodeVWrite.h" #include "dnodeMgmt.h" typedef struct { @@ -82,7 +82,7 @@ void dnodeCleanupWrite() { dPrint("dnode write is closed"); } -void dnodeWrite(SRpcMsg *pMsg) { +void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) { char *pCont = (char *)pMsg->pCont; if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) { diff --git a/src/inc/dnode.h b/src/inc/dnode.h index c4b893ab86..5145a46831 100644 --- a/src/inc/dnode.h +++ b/src/inc/dnode.h @@ -20,6 +20,8 @@ extern "C" { #endif +#include "trpc.h" + typedef struct { int32_t queryReqNum; int32_t submitReqNum; @@ -47,6 +49,10 @@ void dnodeGetMnodeDnodeIpSet(void *ipSet); void * dnodeGetMnodeInfos(); int32_t dnodeGetDnodeId(); +void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); +void dnodeAddServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); +void dnodeSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg); + #ifdef __cplusplus } #endif diff --git a/src/inc/mnode.h b/src/inc/mnode.h index 35f7650c20..37fec24c20 100644 --- a/src/inc/mnode.h +++ b/src/inc/mnode.h @@ -26,6 +26,9 @@ void mgmtCleanUpSystem(); void mgmtStopSystem(); void sdbUpdateSync(); +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg); +void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg); + #ifdef __cplusplus } #endif diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 499f19b76d..571b551368 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -339,11 +339,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MAX_NORMAL_TABLES 1000 #define TSDB_MAX_CHILD_TABLES 100000 -#define TSDB_PORT_MNODESHELL 0 -#define TSDB_PORT_DNODESHELL 5 -#define TSDB_PORT_DNODEMNODE 10 -#define TSDB_PORT_MNODEDNODE 15 -#define TSDB_PORT_SYNC 20 +#define TSDB_PORT_DNODESHELL 0 +#define TSDB_PORT_DNODEDNODE 5 +#define TSDB_PORT_SYNC 10 #define TAOS_QTYPE_RPC 0 #define TAOS_QTYPE_FWD 1 diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 19bd96a063..fec14bd938 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -39,56 +39,70 @@ enum { TSDB_MESSAGE_NULL = 0, #endif -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_REG, "registration" ) // 1 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" ) // 3 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" ) // 5 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_RETRIEVE, "retrieve" ) // 7 +// message from client to dnode +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_FETCH, "fetch" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY0, "dummy0" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY1, "dummy1" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY2, "dummy2" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY3, "dummy3" ) // message from mnode to dnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_TABLE, "create-table" ) // 9 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" ) // 11 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" ) // 13 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" ) // 15 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" ) // 17 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" ) // 19 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" ) // 21 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) // 23 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_TABLE, "create-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY4, "dummy4" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY5, "dummy5" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY6, "dummy6" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY7, "dummy7" ) // message from client to mnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) // 31 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) // 33 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" ) // 35 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" ) // 37 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" ) // 39 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" ) // 41 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" ) // 43 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" ) // 45 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" ) // 47 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" ) // 49 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" ) // 51 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" ) // 53 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" ) // 55 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" ) // 57 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) // 59 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) // 61 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) // 63 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) // 65 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" ) // 67 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) // 69 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) // 71 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" ) // 73 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" ) // 75 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_CONN, "kill-conn" ) // 77 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_HEARTBEAT, "heartbeat" ) // 79 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_RETRIEVE, "retrieve" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_CONN, "kill-conn" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONFIG_DNODE, "cm-config-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_HEARTBEAT, "heartbeat" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY8, "dummy8" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY9, "dummy9" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY10, "dummy10" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY11, "dummy11" ) // message from dnode to mnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_TABLE, "config-table" ) // 91 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" ) // 93 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" ) // 95 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_GRANT, "grant" ) // 97 - -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_SYNC, "sdb-sync" ) // 101 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 103 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_TABLE, "config-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_GRANT, "grant" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY12, "dummy12" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY13, "dummy13" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" ) #ifndef TAOS_MESSAGE_C TSDB_MSG_TYPE_MAX // 105 @@ -96,9 +110,6 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 10 }; -#define TSDB_MSG_TYPE_CM_CONFIG_DNODE TSDB_MSG_TYPE_MD_CONFIG_DNODE -#define TSDB_MSG_TYPE_CM_CONFIG_DNODE_RSP TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP - // IE type #define TSDB_IE_TYPE_SEC 1 #define TSDB_IE_TYPE_META 2 diff --git a/src/inc/tsync.h b/src/inc/tsync.h index 797de063b9..0d6004bba5 100644 --- a/src/inc/tsync.h +++ b/src/inc/tsync.h @@ -54,8 +54,8 @@ typedef struct { int role[TAOS_SYNC_MAX_REPLICA]; } SNodesRole; -// if name is null, get the file from index or after, used by master -// if name is provided, get the named file at the specified index, used by unsynced node +// if name is empty(name[0] is zero), get the file from index or after, used by master +// if name is provided(name[0] is not zero), get the named file at the specified index, used by unsynced node // it returns the file magic number and size, if file not there, magic shall be 0. typedef uint32_t (*FGetFileInfo)(void *ahandle, char *name, uint32_t *index, int32_t *size); @@ -72,6 +72,9 @@ typedef void (*FConfirmForward)(void *ahandle, void *mhandle, int32_t code); // when role is changed, call this to notify app typedef void (*FNotifyRole)(void *ahandle, int8_t role); +// when data file is synced successfully, notity app +typedef void (*FNotifyFileSynced)(void *ahandle); + typedef struct { int32_t vgId; // vgroup ID uint64_t version; // initial version @@ -84,7 +87,7 @@ typedef struct { FWriteToCache writeToCache; FConfirmForward confirmForward; FNotifyRole notifyRole; - + FNotifyFileSynced notifyFileSynced; } SSyncInfo; typedef void* tsync_h; diff --git a/src/kit/shell/src/shellImport.c b/src/kit/shell/src/shellImport.c index e5c50bb74e..b29b96379b 100644 --- a/src/kit/shell/src/shellImport.c +++ b/src/kit/shell/src/shellImport.c @@ -229,7 +229,7 @@ static void shellRunImportThreads(struct arguments* args) ShellThreadObj *pThread = threadObj + t; pThread->threadIndex = t; pThread->totalThreads = args->threadNum; - pThread->taos = taos_connect(args->host, args->user, args->password, args->database, tsMnodeShellPort); + pThread->taos = taos_connect(args->host, args->user, args->password, args->database, tsDnodeShellPort); if (pThread->taos == NULL) { fprintf(stderr, "ERROR: thread:%d failed connect to TDengine, error:%s\n", pThread->threadIndex, taos_errstr(pThread->taos)); exit(0); diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 0d9458e00c..f5a1145cf8 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -63,7 +63,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { break; case 'P': if (arg) { - arguments->port = atoi(arg); + tsDnodeShellPort = atoi(arg); } else { fprintf(stderr, "Invalid port\n"); return -1; diff --git a/src/mnode/inc/mgmtDServer.h b/src/mnode/inc/mgmtDServer.h deleted file mode 100644 index 937ae8f1ac..0000000000 --- a/src/mnode/inc/mgmtDServer.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef TDENGINE_MGMT_DSERVER_H -#define TDENGINE_MGMT_DSERVER_H - -#ifdef __cplusplus -extern "C" { -#endif - -int32_t mgmtInitDServer(); -void mgmtCleanupDServer(); -void mgmtAddDServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/dnode/inc/dnodeMnode.h b/src/mnode/inc/mgmtServer.h similarity index 85% rename from src/dnode/inc/dnodeMnode.h rename to src/mnode/inc/mgmtServer.h index 76a65a06c9..08e4463ad8 100644 --- a/src/dnode/inc/dnodeMnode.h +++ b/src/mnode/inc/mgmtServer.h @@ -13,15 +13,15 @@ * along with this program. If not, see . */ -#ifndef TDENGINE_DNODE_MNODE_H -#define TDENGINE_DNODE_MNODE_H +#ifndef TDENGINE_MGMT_DSERVER_H +#define TDENGINE_MGMT_DSERVER_H #ifdef __cplusplus extern "C" { #endif -int32_t dnodeInitMnode(); -void dnodeCleanupMnode(); +int32_t mgmtInitServer(); +void mgmtCleanupServer(); #ifdef __cplusplus } diff --git a/src/mnode/src/mgmtDClient.c b/src/mnode/src/mgmtDClient.c deleted file mode 100644 index 229964e1d6..0000000000 --- a/src/mnode/src/mgmtDClient.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#define _DEFAULT_SOURCE -#include "os.h" -#include "taoserror.h" -#include "tsched.h" -#include "tsystem.h" -#include "tutil.h" -#include "tglobal.h" -#include "dnode.h" -#include "tgrant.h" -#include "mgmtDef.h" -#include "mgmtLog.h" -#include "mgmtMnode.h" -#include "mgmtDb.h" -#include "mgmtDnode.h" -#include "mgmtProfile.h" -#include "mgmtShell.h" -#include "mgmtTable.h" -#include "mgmtVgroup.h" - -static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg); -static void (*mgmtProcessDnodeRspFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); -static void *tsMgmtDClientRpc = NULL; - -int32_t mgmtInitDClient() { - SRpcInit rpcInit = {0}; - rpcInit.localPort = 0; - rpcInit.label = "MND-DC"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = mgmtProcessRspFromDnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.user = "mgmtDClient"; - rpcInit.ckey = "key"; - rpcInit.secret = "secret"; - - tsMgmtDClientRpc = rpcOpen(&rpcInit); - if (tsMgmtDClientRpc == NULL) { - mError("failed to init client connection to dnode"); - return -1; - } - - mPrint("client connection to dnode is opened"); - return 0; -} - -void mgmtCleanupDClient() { - if (tsMgmtDClientRpc) { - rpcClose(tsMgmtDClientRpc); - tsMgmtDClientRpc = NULL; - } -} - -void mgmtAddDClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { - mgmtProcessDnodeRspFp[msgType] = fp; -} - -void mgmtSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg) { - rpcSendRequest(tsMgmtDClientRpc, ipSet, rpcMsg); -} - -static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg) { - if (mgmtProcessDnodeRspFp[rpcMsg->msgType]) { - (*mgmtProcessDnodeRspFp[rpcMsg->msgType])(rpcMsg); - } else { - mError("%s is not processed in mgmt dclient", taosMsg[rpcMsg->msgType]); - SRpcMsg rpcRsp = {.pCont = 0, .contLen = 0, .code = TSDB_CODE_OPS_NOT_SUPPORT, .handle = rpcMsg->handle}; - rpcSendResponse(&rpcRsp); - } - - rpcFreeCont(rpcMsg->pCont); -} diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index c6506a350a..5cee1f30cd 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -803,7 +803,7 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { newCfg.daysToKeep2 = daysToKeep2; } - if (compression > 0 && compression != pDb->cfg.compression) { + if (compression >= 0 && compression != pDb->cfg.compression) { mTrace("db:%s, compression:%d change to %d", pDb->name, pDb->cfg.compression, compression); newCfg.compression = compression; } @@ -811,20 +811,20 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { if (replications > 0 && replications != pDb->cfg.replications) { mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications); newCfg.replications = replications; - } - if (replications > mgmtGetDnodesNum()) { - mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications); - terrno = TSDB_CODE_NO_ENOUGH_DNODES; + if (replications > mgmtGetDnodesNum()) { + mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications); + terrno = TSDB_CODE_NO_ENOUGH_DNODES; + } + + if (pDb->cfg.replications - replications >= 2) { + mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications); + terrno = TSDB_CODE_INVALID_OPTION; + } } - if (pDb->cfg.replications - replications >= 2) { - mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications); - terrno = TSDB_CODE_INVALID_OPTION; - } - - if (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL) { - mError("db:%s, wal level should be between 0-2", pDb->name); + if (walLevel >= 0 && (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL)) { + mError("db:%s, wal level %d should be between 0-2, origin:%d", pDb->name, walLevel, pDb->cfg.walLevel); terrno = TSDB_CODE_INVALID_OPTION; } diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index bb98e1c3e6..030123b804 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -28,8 +28,6 @@ #include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtSdb.h" @@ -153,8 +151,8 @@ int32_t mgmtInitDnodes() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_DNODE, mgmtProcessCreateDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_DNODE, mgmtProcessDropDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_MODULE, mgmtGetModuleMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_MODULE, mgmtRetrieveModules); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtGetConfigMeta); @@ -242,7 +240,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) { .pCont = pMdCfgDnode, .contLen = sizeof(SMDCfgDnodeMsg) }; - mgmtSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); rpcRsp.code = TSDB_CODE_SUCCESS; } diff --git a/src/mnode/src/mgmtMain.c b/src/mnode/src/mgmtMain.c index 0f18c95539..aa95381df3 100644 --- a/src/mnode/src/mgmtMain.c +++ b/src/mnode/src/mgmtMain.c @@ -24,12 +24,11 @@ #include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" +#include "mgmtServer.h" #include "mgmtAcct.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtDb.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtSdb.h" #include "mgmtVgroup.h" #include "mgmtUser.h" @@ -100,11 +99,7 @@ int32_t mgmtStartSystem() { mError("failed to init balance") } - if (mgmtInitDClient() < 0) { - return -1; - } - - if (mgmtInitDServer() < 0) { + if (mgmtInitServer() < 0) { return -1; } @@ -141,8 +136,7 @@ void mgmtCleanUpSystem() { mgmtCleanupMnodes(); balanceCleanUp(); mgmtCleanUpShell(); - mgmtCleanupDClient(); - mgmtCleanupDServer(); + mgmtCleanupServer(); mgmtCleanUpAccts(); mgmtCleanUpTables(); mgmtCleanUpVgroups(); diff --git a/src/mnode/src/mgmtDServer.c b/src/mnode/src/mgmtServer.c similarity index 53% rename from src/mnode/src/mgmtDServer.c rename to src/mnode/src/mgmtServer.c index 1e820be0e9..2fa6e68f65 100644 --- a/src/mnode/src/mgmtDServer.c +++ b/src/mnode/src/mgmtServer.c @@ -27,7 +27,6 @@ #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtDb.h" -#include "mgmtDServer.h" #include "mgmtMnode.h" #include "mgmtProfile.h" #include "mgmtShell.h" @@ -35,67 +34,49 @@ #include "mgmtTable.h" #include "mgmtVgroup.h" -static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg); -static int mgmtDServerRetrieveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); static void (*mgmtProcessDnodeMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); -static void *tsMgmtDServerRpc; -static void *tsMgmtDServerQhandle = NULL; +static void *tsMgmtServerQhandle = NULL; -int32_t mgmtInitDServer() { - SRpcInit rpcInit = {0}; - rpcInit.localPort = tsMnodeDnodePort; - rpcInit.label = "MND-DS"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = mgmtProcessMsgFromDnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.afp = mgmtDServerRetrieveAuth; +int32_t mgmtInitServer() { - tsMgmtDServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS"); - - tsMgmtDServerRpc = rpcOpen(&rpcInit); - if (tsMgmtDServerRpc == NULL) { - mError("failed to init server connection to dnode"); - return -1; - } + tsMgmtServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS"); mPrint("server connection to dnode is opened"); return 0; } -void mgmtCleanupDServer() { - if (tsMgmtDServerQhandle) { - taosCleanUpScheduler(tsMgmtDServerQhandle); - tsMgmtDServerQhandle = NULL; - } - - if (tsMgmtDServerRpc) { - rpcClose(tsMgmtDServerRpc); - tsMgmtDServerRpc = NULL; - mPrint("server connection to dnode is closed"); +void mgmtCleanupServer() { + if (tsMgmtServerQhandle) { + taosCleanUpScheduler(tsMgmtServerQhandle); + tsMgmtServerQhandle = NULL; } } -void mgmtAddDServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { +void dnodeAddServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { mgmtProcessDnodeMsgFp[msgType] = fp; } -static void mgmtProcessDServerRequest(SSchedMsg *sched) { +static void mgmtProcessRequestFromDnode(SSchedMsg *sched) { SRpcMsg *pMsg = sched->msg; (*mgmtProcessDnodeMsgFp[pMsg->msgType])(pMsg); rpcFreeCont(pMsg->pCont); free(pMsg); } -static void mgmtAddToDServerQueue(SRpcMsg *pMsg) { +static void mgmtAddToServerQueue(SRpcMsg *pMsg) { SSchedMsg schedMsg; schedMsg.msg = pMsg; - schedMsg.fp = mgmtProcessDServerRequest; - taosScheduleTask(tsMgmtDServerQhandle, &schedMsg); + schedMsg.fp = mgmtProcessRequestFromDnode; + taosScheduleTask(tsMgmtServerQhandle, &schedMsg); } -static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { +void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg) { + if (mgmtProcessDnodeMsgFp[rpcMsg->msgType] == NULL) { + mError("%s is not processed in mnode", taosMsg[rpcMsg->msgType]); + mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_MSG_NOT_PROCESSED); + rpcFreeCont(rpcMsg->pCont); + } + if (rpcMsg->pCont == NULL) { mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); return; @@ -116,17 +97,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { return; } - if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) { - SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); - memcpy(pMsg, rpcMsg, sizeof(SRpcMsg)); - mgmtAddToDServerQueue(pMsg); - } else { - mError("%s is not processed in mgmt dserver", taosMsg[rpcMsg->msgType]); - mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_MSG_NOT_PROCESSED); - rpcFreeCont(rpcMsg->pCont); - } + SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); + memcpy(pMsg, rpcMsg, sizeof(SRpcMsg)); + mgmtAddToServerQueue(pMsg); } -static int mgmtDServerRetrieveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) { - return TSDB_CODE_SUCCESS; -} diff --git a/src/mnode/src/mgmtShell.c b/src/mnode/src/mgmtShell.c index c86bf2a2dd..7264c85027 100644 --- a/src/mnode/src/mgmtShell.c +++ b/src/mnode/src/mgmtShell.c @@ -41,9 +41,8 @@ typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, void *pConn); -static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); +//static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg); -static void mgmtProcessMsgFromShell(SRpcMsg *pMsg); static void mgmtProcessUnSupportMsg(SRpcMsg *rpcMsg); static void mgmtProcessShowMsg(SQueuedMsg *queuedMsg); static void mgmtProcessRetrieveMsg(SQueuedMsg *queuedMsg); @@ -52,7 +51,6 @@ static void mgmtProcessConnectMsg(SQueuedMsg *queuedMsg); static void mgmtProcessUseMsg(SQueuedMsg *queuedMsg); void *tsMgmtTmr; -static void *tsMgmtShellRpc = NULL; static void *tsMgmtTranQhandle = NULL; static void (*tsMgmtProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SQueuedMsg *) = {0}; static void *tsQhandleCache = NULL; @@ -61,7 +59,7 @@ static SShowRetrieveFp tsMgmtShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0}; int32_t mgmtInitShell() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mgmtProcessShowMsg); - mgmtAddShellMsgHandle(TSDB_MSG_TYPE_RETRIEVE, mgmtProcessRetrieveMsg); + mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_RETRIEVE, mgmtProcessRetrieveMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_HEARTBEAT, mgmtProcessHeartBeatMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mgmtProcessConnectMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mgmtProcessUseMsg); @@ -70,28 +68,6 @@ int32_t mgmtInitShell() { tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT"); tsQhandleCache = taosCacheInit(tsMgmtTmr, 2); - int32_t numOfThreads = tsNumOfCores * tsNumOfThreadsPerCore / 4.0; - if (numOfThreads < 1) { - numOfThreads = 1; - } - - SRpcInit rpcInit = {0}; - rpcInit.localPort = tsMnodeShellPort; - rpcInit.label = "MND-shell"; - rpcInit.numOfThreads = numOfThreads; - rpcInit.cfp = mgmtProcessMsgFromShell; - rpcInit.sessions = tsMaxShellConns; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.afp = mgmtShellRetriveAuth; - - tsMgmtShellRpc = rpcOpen(&rpcInit); - if (tsMgmtShellRpc == NULL) { - mError("failed to init server connection to shell"); - return -1; - } - - mPrint("server connection to shell is opened"); return 0; } @@ -101,14 +77,7 @@ void mgmtCleanUpShell() { tsMgmtTranQhandle = NULL; } - if (tsMgmtShellRpc) { - rpcClose(tsMgmtShellRpc); - tsMgmtShellRpc = NULL; - mPrint("server connection to shell is closed"); - } - if (tsQhandleCache) { - taosCacheEmpty(tsQhandleCache); taosCacheCleanup(tsQhandleCache); tsQhandleCache = NULL; } @@ -148,8 +117,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) { taosTmrReset(mgmtDoDealyedAddToShellQueue, 1000, queuedMsg, tsMgmtTmr, &unUsed); } -static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { - assert(rpcMsg); +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { if (rpcMsg->pCont == NULL) { mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); @@ -370,6 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) { rpcSendResponse(&rpcRsp); } +/* static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) { *spi = 1; *encrypt = 0; @@ -390,6 +359,7 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr return TSDB_CODE_SUCCESS; } } +*/ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) { SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0}; @@ -490,7 +460,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) { return mgmtCheckTableMetaMsgReadOnly(pMsg); } - if (pMsg->msgType == TSDB_MSG_TYPE_CM_STABLE_VGROUP || pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE || + if (pMsg->msgType == TSDB_MSG_TYPE_CM_STABLE_VGROUP || pMsg->msgType == TSDB_MSG_TYPE_CM_RETRIEVE || pMsg->msgType == TSDB_MSG_TYPE_CM_SHOW || pMsg->msgType == TSDB_MSG_TYPE_CM_TABLES_META || pMsg->msgType == TSDB_MSG_TYPE_CM_CONNECT) { return true; diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 53a208745c..9bd2cde2dc 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -24,13 +24,12 @@ #include "tname.h" #include "tidpool.h" #include "tglobal.h" +#include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtAcct.h" -#include "mgmtDClient.h" #include "mgmtDb.h" #include "mgmtDnode.h" -#include "mgmtDServer.h" #include "tgrant.h" #include "mgmtMnode.h" #include "mgmtProfile.h" @@ -539,12 +538,12 @@ int32_t mgmtInitTables() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_TABLE_META, mgmtProcessTableMetaMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_STABLE_VGROUP, mgmtProcessSuperTableVgroupMsg); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_ALTER_TABLE_RSP, mgmtProcessAlterTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_ALTER_TABLE_RSP, mgmtProcessAlterTableRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_TABLE, mgmtProcessTableCfgMsg); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_TABLE, mgmtProcessTableCfgMsg); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mgmtGetShowTableMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mgmtRetrieveShowTables); @@ -812,7 +811,7 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) { if (pVgroup != NULL) { SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup); SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE}; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); mgmtDecVgroupRef(pVgroup); } } @@ -1514,7 +1513,7 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) { .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); } static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { @@ -1552,7 +1551,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { .msgType = TSDB_MSG_TYPE_MD_DROP_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); } static int32_t mgmtModifyChildTableTagValue(SChildTableObj *pTable, char *tagName, char *nContent) { @@ -1854,7 +1853,7 @@ static void mgmtProcessTableCfgMsg(SRpcMsg *rpcMsg) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcRsp); + dnodeSendMsgToDnode(&ipSet, &rpcRsp); mgmtDecTableRef(pTable); mgmtDecDnodeRef(pDnode); diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index 8601be3937..6be2a73444 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -23,12 +23,11 @@ #include "ttime.h" #include "tbalance.h" #include "tglobal.h" +#include "dnode.h" #include "tdataformat.h" #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtDb.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtProfile.h" @@ -218,9 +217,9 @@ int32_t mgmtInitVgroups() { mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mgmtGetVgroupMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mgmtRetrieveVgroups); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg); mTrace("table:vgroups is created"); @@ -584,7 +583,7 @@ SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup) { }; for (int i = 0; i < pVgroup->numOfVnodes; ++i) { strcpy(ipSet.fqdn[i], pVgroup->vnodeGid[i].pDnode->dnodeFqdn); - ipSet.port[i] = pVgroup->vnodeGid[i].pDnode->dnodePort + TSDB_PORT_DNODEMNODE; + ipSet.port[i] = pVgroup->vnodeGid[i].pDnode->dnodePort + TSDB_PORT_DNODEDNODE; } return ipSet; } @@ -595,7 +594,7 @@ SRpcIpSet mgmtGetIpSetFromIp(char *ep) { ipSet.numOfIps = 1; ipSet.inUse = 0; taosGetFqdnPortFromEp(ep, ipSet.fqdn[0], &ipSet.port[0]); - ipSet.port[0] += TSDB_PORT_DNODEMNODE; + ipSet.port[0] += TSDB_PORT_DNODEDNODE; return ipSet; } @@ -609,7 +608,7 @@ void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_CREATE_VNODE }; - mgmtSendMsgToDnode(ipSet, &rpcMsg); + dnodeSendMsgToDnode(ipSet, &rpcMsg); } void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) { @@ -675,7 +674,7 @@ void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_DROP_VNODE }; - mgmtSendMsgToDnode(ipSet, &rpcMsg); + dnodeSendMsgToDnode(ipSet, &rpcMsg); } static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) { diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index 9b8affcde2..51795a570d 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) { for (i = 0; i < pServer->numOfThreads; ++i) { pThread = pServer->pThreads + i; + if (pThread == NULL) continue; //taosCloseSocket(pThread->pollFd); - while (pThread->pHead) { - httpCleanUpContext(pThread->pHead, 0); - } + //while (pThread->pHead) { + // httpCleanUpContext(pThread->pHead, 0); + //} pthread_cancel(pThread->thread); pthread_join(pThread->thread, NULL); @@ -504,8 +505,8 @@ void httpAcceptHttpConnection(void *arg) { sockFd = taosOpenTcpServerSocket(pServer->serverIp, pServer->serverPort); if (sockFd < 0) { - httpError("http server:%s, failed to open http socket, ip:%s:%u", pServer->label, pServer->serverIp, - pServer->serverPort); + httpError("http server:%s, failed to open http socket, ip:%s:%u error:%s", pServer->label, taosIpStr(pServer->serverIp), + pServer->serverPort, strerror(errno)); return; } else { httpPrint("http service init success at %u", pServer->serverPort); @@ -645,7 +646,7 @@ bool httpInitConnect(HttpServer *pServer) { } pthread_attr_destroy(&thattr); - httpTrace("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, pServer->serverIp, + httpTrace("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, taosIpStr(pServer->serverIp), pServer->serverPort, pServer->numOfThreads); return true; } diff --git a/src/plugins/http/src/httpSystem.c b/src/plugins/http/src/httpSystem.c index 89dc11796f..8b95077632 100644 --- a/src/plugins/http/src/httpSystem.c +++ b/src/plugins/http/src/httpSystem.c @@ -117,7 +117,7 @@ void httpCleanUpSystem() { httpPrint("http service cleanup"); httpStopSystem(); -#if 0 +//#if 0 if (httpServer == NULL) { return; } @@ -131,7 +131,13 @@ void httpCleanUpSystem() { httpServer->timerHandle = NULL; } - httpCleanUpConnect(httpServer); + if (httpServer->pThreads != NULL) { + httpCleanUpConnect(httpServer); + httpServer->pThreads = NULL; + } + + +#if 0 httpRemoveAllSessions(httpServer); if (httpServer->pContextPool != NULL) { diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index a4f9f32050..7836dbae85 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -44,7 +44,7 @@ #define SQL_LENGTH 1024 #define LOG_LEN_STR 80 -#define IP_LEN_STR 15 +#define IP_LEN_STR 18 #define CHECK_INTERVAL 1000 typedef enum { @@ -115,6 +115,13 @@ static void monitorInitConn(void *para, void *unused) { if (tsMonitorConn.ep[0] == 0) strcpy(tsMonitorConn.ep, tsLocalEp); + int len = strlen(tsMonitorConn.ep); + for (int i = 0; i < len; ++i) { + if (tsMonitorConn.ep[i] == ':' || tsMonitorConn.ep[i] == '-') { + tsMonitorConn.ep[i] = '_'; + } + } + if (tsMonitorConn.conn == NULL) { taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn)); } else { @@ -141,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { if (cmd == MONITOR_CMD_CREATE_DB) { snprintf(sql, SQL_LENGTH, - "create database if not exists %s replica 1 days 10 keep 30 rows 1024 cache 2048 " - "ablocks 2 tblocks 32 tables 32 precision 'us'", + "create database if not exists %s replica 1 days 10 keep 30 cache 2 " + "blocks 2 maxtables 32 precision 'us'", tsMonitorDbName); } else if (cmd == MONITOR_CMD_CREATE_MT_DN) { snprintf(sql, SQL_LENGTH, @@ -154,7 +161,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { ", io_read float, io_write float" ", req_http int, req_select int, req_insert int" ") tags (ipaddr binary(%d))", - tsMonitorDbName, IP_LEN_STR + 1); + tsMonitorDbName, TSDB_FQDN_LEN + 1); } else if (cmd == MONITOR_CMD_CREATE_TB_DN) { snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn_%s using %s.dn tags('%s')", tsMonitorDbName, tsMonitorConn.ep, tsMonitorDbName, tsLocalEp); diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 20404511f6..39d773f6a2 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -363,7 +363,7 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, const SRpcMsg *pMsg) // connection type is application specific. // for TDengine, all the query, show commands shall have TCP connection char type = pMsg->msgType; - if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_RETRIEVE || + if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_CM_RETRIEVE || type == TSDB_MSG_TYPE_FETCH || type == TSDB_MSG_TYPE_CM_STABLE_VGROUP || type == TSDB_MSG_TYPE_CM_TABLES_META || type == TSDB_MSG_TYPE_CM_SHOW ) pContext->connType = RPC_CONN_TCPC; @@ -802,7 +802,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { pHead->code = htonl(pHead->code); if (terrno == 0) { - if (pHead->msgType != TSDB_MSG_TYPE_REG && pHead->encrypt) { + if (pHead->encrypt) { // decrypt here } diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index 1260a34512..38458c71d2 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) { sockFd = taosOpenTcpServerSocket(pServerObj->ip, pServerObj->port); if (sockFd < 0) return; - tTrace("%s TCP server is ready, ip:%s:%hu", pServerObj->label, pServerObj->ip, pServerObj->port); + tTrace("%s TCP server is ready, ip:0x%x:%hu", pServerObj->label, pServerObj->ip, pServerObj->port); while (1) { socklen_t addrlen = sizeof(caddr); diff --git a/src/rpc/test/rserver.c b/src/rpc/test/rserver.c index 0569a163d1..9f781ef276 100644 --- a/src/rpc/test/rserver.c +++ b/src/rpc/test/rserver.c @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) { commit = atoi(argv[++i]); } else if (strcmp(argv[i], "-d")==0 && i < argc-1) { rpcDebugFlag = atoi(argv[++i]); - ddebugFlag = rpcDebugFlag; + dDebugFlag = rpcDebugFlag; uDebugFlag = rpcDebugFlag; } else { printf("\nusage: %s [options] \n", argv[0]); diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index 63fe124de2..02a5b93141 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -304,9 +304,9 @@ static FORCE_INLINE SCacheDataNode *taosAddToCacheImpl(SCacheObj *pCacheObj, con static void doCleanupDataCache(SCacheObj *pCacheObj) { __cache_wr_lock(pCacheObj); - if (taosHashGetSize(pCacheObj->pHashTable) > 0) { - taosHashCleanup(pCacheObj->pHashTable); - } + //if (taosHashGetSize(pCacheObj->pHashTable) > 0) { + taosHashCleanup(pCacheObj->pHashTable); + //} __cache_unlock(pCacheObj); diff --git a/src/vnode/inc/vnodeInt.h b/src/vnode/inc/vnodeInt.h index d99cb1c96c..d4842fdf7f 100644 --- a/src/vnode/inc/vnodeInt.h +++ b/src/vnode/inc/vnodeInt.h @@ -20,8 +20,17 @@ extern "C" { #endif +#include "tlog.h" #include "tsync.h" #include "twal.h" +#include "tcq.h" + +extern int32_t vDebugFlag; + +#define vError(...) if (vDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR VND ", 255, __VA_ARGS__); } +#define vWarn(...) if (vDebugFlag & DEBUG_WARN) {taosPrintLog("WARN VND ", vDebugFlag, __VA_ARGS__); } +#define vTrace(...) if (vDebugFlag & DEBUG_TRACE) {taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); } +#define vPrint(...) {taosPrintLog("VND ", 255, __VA_ARGS__); } typedef struct { int32_t vgId; // global vnode group ID diff --git a/src/vnode/inc/vnodeLog.h b/src/vnode/inc/vnodeLog.h index 450220e17f..bd8daae0b6 100644 --- a/src/vnode/inc/vnodeLog.h +++ b/src/vnode/inc/vnodeLog.h @@ -22,19 +22,19 @@ extern "C" { #include "tlog.h" -extern int32_t ddebugFlag; +extern int32_t dDebugFlag; #define dError(...) \ - if (ddebugFlag & DEBUG_ERROR) { \ + if (dDebugFlag & DEBUG_ERROR) { \ taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \ } #define dWarn(...) \ - if (ddebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \ + if (dDebugFlag & DEBUG_WARN) { \ + taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); \ } #define dTrace(...) \ - if (ddebugFlag & DEBUG_TRACE) { \ - taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \ + if (dDebugFlag & DEBUG_TRACE) { \ + taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); \ } #define dPrint(...) \ { taosPrintLog("DND ", 255, __VA_ARGS__); } diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index f5d7bd45a7..6ffac08b4e 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -24,14 +24,10 @@ #include "ttime.h" #include "ttimer.h" #include "cJSON.h" -#include "twal.h" #include "tglobal.h" #include "dnode.h" #include "vnode.h" #include "vnodeInt.h" -#include "vnodeLog.h" -#include "tcq.h" -//#include "tsync.h" static int32_t tsOpennedVnodes; static void *tsDnodeVnodesHash; @@ -46,6 +42,7 @@ static int vnodeWalCallback(void *arg); static uint32_t vnodeGetFileInfo(void *ahandle, char *name, uint32_t *index, int32_t *size); static int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index); static void vnodeNotifyRole(void *ahandle, int8_t role); +static void vnodeNotifyFileSynced(void *ahandle); static pthread_once_t vnodeModuleInit = PTHREAD_ONCE_INIT; @@ -64,7 +61,7 @@ static void vnodeInit() { tsDnodeVnodesHash = taosInitIntHash(TSDB_MAX_VNODES, sizeof(SVnodeObj *), taosHashInt); if (tsDnodeVnodesHash == NULL) { - dError("failed to init vnode list"); + vError("failed to init vnode list"); } } @@ -74,7 +71,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { SVnodeObj *pTemp = (SVnodeObj *)taosGetIntHashData(tsDnodeVnodesHash, pVnodeCfg->cfg.vgId); if (pTemp != NULL) { - dPrint("vgId:%d, vnode already exist, pVnode:%p", pVnodeCfg->cfg.vgId, pTemp); + vPrint("vgId:%d, vnode already exist, pVnode:%p", pVnodeCfg->cfg.vgId, pTemp); return TSDB_CODE_SUCCESS; } @@ -93,7 +90,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { code = vnodeSaveCfg(pVnodeCfg); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return code; } @@ -113,11 +110,11 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId); code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return TSDB_CODE_VG_INIT_FAILED; } - dPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.walLevel); + vPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.walLevel); code = vnodeOpen(pVnodeCfg->cfg.vgId, rootDir); return code; @@ -126,12 +123,12 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { int32_t vnodeDrop(int32_t vgId) { SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); if (ppVnode == NULL || *ppVnode == NULL) { - dTrace("vgId:%d, failed to drop, vgId not exist", vgId); + vTrace("vgId:%d, failed to drop, vgId not exist", vgId); return TSDB_CODE_INVALID_VGROUP_ID; } SVnodeObj *pVnode = *ppVnode; - dTrace("pVnode:%p vgId:%d, vnode will be dropped", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode will be dropped", pVnode->vgId); pVnode->status = TAOS_VN_STATUS_DELETING; vnodeCleanUp(pVnode); @@ -144,34 +141,34 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) { int32_t code = vnodeSaveCfg(pVnodeCfg); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return code; } code = vnodeReadCfg(pVnode); if (code != TSDB_CODE_SUCCESS) { - dError("pVnode:%p vgId:%d, failed to read cfg file", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read cfg file", pVnode->vgId); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return code; } code = syncReconfig(pVnode->sync, &pVnode->syncCfg); if (code != TSDB_CODE_SUCCESS) { - dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig sync, result:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to alter vnode, canot reconfig sync, result:%s", pVnode->vgId, tstrerror(code)); return code; } code = tsdbConfigRepo(pVnode->tsdb, &pVnode->tsdbCfg); if (code != TSDB_CODE_SUCCESS) { - dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig tsdb, result:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to alter vnode, canot reconfig tsdb, result:%s", pVnode->vgId, tstrerror(code)); return code; } pVnode->status = TAOS_VN_STATUS_READY; - dTrace("pVnode:%p vgId:%d, vnode is altered", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode is altered", pVnode->vgId); return TSDB_CODE_SUCCESS; } @@ -189,7 +186,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { int32_t code = vnodeReadCfg(pVnode); if (code != TSDB_CODE_SUCCESS) { - dError("pVnode:%p vgId:%d, failed to read cfg file", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read cfg file", pVnode->vgId); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return code; } @@ -214,7 +211,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { sprintf(temp, "%s/tsdb", rootDir); pVnode->tsdb = tsdbOpenRepo(temp, &appH); if (pVnode->tsdb == NULL) { - dError("pVnode:%p vgId:%d, failed to open tsdb at %s(%s)", pVnode, pVnode->vgId, temp, tstrerror(terrno)); + vError("vgId:%d, failed to open tsdb at %s(%s)", pVnode->vgId, temp, tstrerror(terrno)); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return terrno; } @@ -234,6 +231,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { syncInfo.writeToCache = vnodeWriteToQueue; syncInfo.confirmForward = dnodeSendRpcWriteRsp; syncInfo.notifyRole = vnodeNotifyRole; + syncInfo.notifyFileSynced = vnodeNotifyFileSynced; pVnode->sync = syncStart(&syncInfo); // start continuous query @@ -243,7 +241,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { pVnode->events = NULL; pVnode->status = TAOS_VN_STATUS_READY; - dTrace("pVnode:%p vgId:%d, vnode is opened in %s", pVnode, pVnode->vgId, rootDir); + vTrace("vgId:%d, vnode is opened in %s, pVnode:%p", pVnode->vgId, rootDir, pVnode); atomic_add_fetch_32(&tsOpennedVnodes, 1); return TSDB_CODE_SUCCESS; @@ -254,7 +252,7 @@ int32_t vnodeClose(int32_t vgId) { if (ppVnode == NULL || *ppVnode == NULL) return 0; SVnodeObj *pVnode = *ppVnode; - dTrace("pVnode:%p vgId:%d, vnode will be closed", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode will be closed", pVnode->vgId); pVnode->status = TAOS_VN_STATUS_CLOSING; vnodeCleanUp(pVnode); @@ -269,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) { assert(refCount >= 0); if (refCount > 0) { - dTrace("pVnode:%p vgId:%d, release vnode, refCount:%d", pVnode, vgId, refCount); + vTrace("vgId:%d, release vnode, refCount:%d", pVnode, vgId, refCount); return; } @@ -290,7 +288,7 @@ void vnodeRelease(void *pVnodeRaw) { free(pVnode); int32_t count = atomic_sub_fetch_32(&tsOpennedVnodes, 1); - dTrace("pVnode:%p vgId:%d, vnode is released, vnodes:%d", pVnode, vgId, count); + vTrace("vgId:%d, vnode is released, vnodes:%d", pVnode, vgId, count); if (count <= 0) { taosCleanUpIntHash(tsDnodeVnodesHash); @@ -303,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) { SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); if (ppVnode == NULL || *ppVnode == NULL) { terrno = TSDB_CODE_INVALID_VGROUP_ID; - dPrint("vgId:%d not exist", vgId); + vPrint("vgId:%d not exist", vgId); return NULL; } @@ -315,7 +313,7 @@ void *vnodeAccquireVnode(int32_t vgId) { if (pVnode == NULL) return pVnode; atomic_add_fetch_32(&pVnode->refCount, 1); - dTrace("pVnode:%p vgId:%d, get vnode, refCount:%d", pVnode, pVnode->vgId, pVnode->refCount); + vTrace("vgId:%d, get vnode, refCount:%d", pVnode->vgId, pVnode->refCount); return pVnode; } @@ -405,12 +403,19 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) { cqStop(pVnode->cq); } +static void vnodeNotifyFileSynced(void *ahandle) { + SVnodeObj *pVnode = ahandle; + vTrace("pVnode:%p vgId:%d, data file is synced", pVnode, pVnode->vgId); + + // clsoe tsdb, then open tsdb +} + static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { char cfgFile[TSDB_FILENAME_LEN + 30] = {0}; sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnodeCfg->cfg.vgId); FILE *fp = fopen(cfgFile, "w"); if (!fp) { - dError("vgId:%d, failed to open vnode cfg file for write, file:%s error:%s", pVnodeCfg->cfg.vgId, cfgFile, + vError("vgId:%d, failed to open vnode cfg file for write, file:%s error:%s", pVnodeCfg->cfg.vgId, cfgFile, strerror(errno)); return errno; } @@ -456,7 +461,7 @@ static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { fclose(fp); free(content); - dPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId); + vPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId); return 0; } @@ -466,7 +471,7 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(cfgFile, "r"); if (!fp) { - dError("pVnode:%p vgId:%d, failed to open vnode cfg file for read, file:%s, error:%s", pVnode, pVnode->vgId, + vError("vgId:%d, failed to open vnode cfg file for read, file:%s, error:%s", pVnode->vgId, cfgFile, strerror(errno)); return errno; } @@ -478,117 +483,117 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { if (len <= 0) { free(content); fclose(fp); - dError("pVnode:%p vgId:%d, failed to read vnode cfg, content is null", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, content is null", pVnode->vgId); return false; } cJSON *root = cJSON_Parse(content); if (root == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, invalid json format", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, invalid json format", pVnode->vgId); goto PARSE_OVER; } cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion"); if (!cfgVersion || cfgVersion->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, cfgVersion not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, cfgVersion not found", pVnode->vgId); goto PARSE_OVER; } pVnode->cfgVersion = cfgVersion->valueint; cJSON *cacheBlockSize = cJSON_GetObjectItem(root, "cacheBlockSize"); if (!cacheBlockSize || cacheBlockSize->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, cacheBlockSize not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, cacheBlockSize not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.cacheBlockSize = cacheBlockSize->valueint; cJSON *totalBlocks = cJSON_GetObjectItem(root, "totalBlocks"); if (!totalBlocks || totalBlocks->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, totalBlocks not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, totalBlocks not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.totalBlocks = totalBlocks->valueint; cJSON *maxTables = cJSON_GetObjectItem(root, "maxTables"); if (!maxTables || maxTables->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxTables not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, maxTables not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.maxTables = maxTables->valueint; cJSON *daysPerFile = cJSON_GetObjectItem(root, "daysPerFile"); if (!daysPerFile || daysPerFile->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysPerFile not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysPerFile not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.daysPerFile = daysPerFile->valueint; cJSON *daysToKeep = cJSON_GetObjectItem(root, "daysToKeep"); if (!daysToKeep || daysToKeep->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep = daysToKeep->valueint; cJSON *daysToKeep1 = cJSON_GetObjectItem(root, "daysToKeep1"); if (!daysToKeep1 || daysToKeep1->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep1 not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep1 not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep1 = daysToKeep1->valueint; cJSON *daysToKeep2 = cJSON_GetObjectItem(root, "daysToKeep2"); if (!daysToKeep2 || daysToKeep2->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep2 not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep2 not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep2 = daysToKeep2->valueint; cJSON *minRowsPerFileBlock = cJSON_GetObjectItem(root, "minRowsPerFileBlock"); if (!minRowsPerFileBlock || minRowsPerFileBlock->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, minRowsPerFileBlock not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, minRowsPerFileBlock not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.minRowsPerFileBlock = minRowsPerFileBlock->valueint; cJSON *maxRowsPerFileBlock = cJSON_GetObjectItem(root, "maxRowsPerFileBlock"); if (!maxRowsPerFileBlock || maxRowsPerFileBlock->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxRowsPerFileBlock not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, maxRowsPerFileBlock not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.maxRowsPerFileBlock = maxRowsPerFileBlock->valueint; cJSON *commitTime = cJSON_GetObjectItem(root, "commitTime"); if (!commitTime || commitTime->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, commitTime not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, commitTime not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.commitTime = (int8_t)commitTime->valueint; cJSON *precision = cJSON_GetObjectItem(root, "precision"); if (!precision || precision->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, precision not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, precision not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.precision = (int8_t)precision->valueint; cJSON *compression = cJSON_GetObjectItem(root, "compression"); if (!compression || compression->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, compression not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, compression not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.compression = (int8_t)compression->valueint; cJSON *walLevel = cJSON_GetObjectItem(root, "walLevel"); if (!walLevel || walLevel->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, walLevel not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, walLevel not found", pVnode->vgId); goto PARSE_OVER; } pVnode->walCfg.walLevel = (int8_t) walLevel->valueint; cJSON *wals = cJSON_GetObjectItem(root, "wals"); if (!wals || wals->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, wals not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, wals not found", pVnode->vgId); goto PARSE_OVER; } pVnode->walCfg.wals = (int8_t)wals->valueint; @@ -596,27 +601,27 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { cJSON *replica = cJSON_GetObjectItem(root, "replica"); if (!replica || replica->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, replica not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, replica not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.replica = (int8_t)replica->valueint; cJSON *quorum = cJSON_GetObjectItem(root, "quorum"); if (!quorum || quorum->type != cJSON_Number) { - dError("failed to read vnode cfg, quorum not found", pVnode, pVnode->vgId); + vError("failed to read vnode cfg, quorum not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.quorum = (int8_t)quorum->valueint; cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); if (!nodeInfos || nodeInfos->type != cJSON_Array) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeInfos not found", pVnode->vgId); goto PARSE_OVER; } int size = cJSON_GetArraySize(nodeInfos); if (size != pVnode->syncCfg.replica) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos size not matched", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeInfos size not matched", pVnode->vgId); goto PARSE_OVER; } @@ -626,14 +631,14 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); if (!nodeId || nodeId->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeId not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeId not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.nodeInfo[i].nodeId = nodeId->valueint; cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeFqdn not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeFqdn not found", pVnode->vgId); goto PARSE_OVER; } @@ -643,9 +648,9 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ret = 0; - dPrint("pVnode:%p vgId:%d, read vnode cfg successed, replcia:%d", pVnode, pVnode->vgId, pVnode->syncCfg.replica); + vPrint("vgId:%d, read vnode cfg successed, replcia:%d", pVnode->vgId, pVnode->syncCfg.replica); for (int32_t i = 0; i < pVnode->syncCfg.replica; i++) { - dPrint("pVnode:%p vgId:%d, dnode:%d, %s:%d", pVnode, pVnode->vgId, pVnode->syncCfg.nodeInfo[i].nodeId, + vPrint("vgId:%d, dnode:%d, %s:%d", pVnode->vgId, pVnode->syncCfg.nodeInfo[i].nodeId, pVnode->syncCfg.nodeInfo[i].nodeFqdn, pVnode->syncCfg.nodeInfo[i].nodePort); } @@ -661,7 +666,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(versionFile, "w"); if (!fp) { - dError("pVnode:%p vgId:%d, failed to open vnode version file for write, file:%s error:%s", pVnode, pVnode->vgId, + vError("vgId:%d, failed to open vnode version file for write, file:%s error:%s", pVnode->vgId, versionFile, strerror(errno)); return errno; } @@ -678,7 +683,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { fclose(fp); free(content); - dPrint("pVnode:%p vgId:%d, save vnode version:%" PRId64 " successed", pVnode, pVnode->vgId, pVnode->version); + vPrint("vgId:%d, save vnode version:%" PRId64 " successed", pVnode->vgId, pVnode->version); return 0; } @@ -688,7 +693,7 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(versionFile, "r"); if (!fp) { - dTrace("pVnode:%p vgId:%d, failed to open version file:%s error:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to open version file:%s error:%s", pVnode->vgId, versionFile, strerror(errno)); return false; } @@ -700,26 +705,26 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { if (len <= 0) { free(content); fclose(fp); - dPrint("pVnode:%p vgId:%d, failed to read vnode version, content is null", pVnode, pVnode->vgId); + vPrint("vgId:%d, failed to read vnode version, content is null", pVnode->vgId); return false; } cJSON *root = cJSON_Parse(content); if (root == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode version, invalid json format", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode version, invalid json format", pVnode->vgId); goto PARSE_OVER; } cJSON *version = cJSON_GetObjectItem(root, "version"); if (!version || version->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode version, version not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode version, version not found", pVnode->vgId); goto PARSE_OVER; } pVnode->version = version->valueint; ret = true; - dPrint("pVnode:%p vgId:%d, read vnode version successed, version:%%" PRId64, pVnode, pVnode->vgId, pVnode->version); + vPrint("vgId:%d, read vnode version successed, version:%%" PRId64, pVnode->vgId, pVnode->version); PARSE_OVER: free(content); diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index b111f56e39..d2dd1811cf 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -29,11 +29,11 @@ static int32_t (*vnodeProcessReadMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, int32_t contLen, SRspRet *pRet); static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); -static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); +static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); void vnodeInitReadFp(void) { - vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg; - vnodeProcessReadMsgFp[TSDB_MSG_TYPE_RETRIEVE] = vnodeProcessRetrieveMsg; + vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg; + vnodeProcessReadMsgFp[TSDB_MSG_TYPE_FETCH] = vnodeProcessFetchMsg; } int32_t vnodeProcessRead(void *param, int msgType, void *pCont, int32_t contLen, SRspRet *ret) { @@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont pRet->len = sizeof(SQueryTableRsp); pRet->rsp = pRsp; - dTrace("pVnode:%p vgId:%d QInfo:%p, dnode query msg disposed", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, dnode query msg disposed", pVnode->vgId, pQInfo); } else { pQInfo = pCont; code = TSDB_CODE_ACTION_IN_PROGRESS; @@ -76,14 +76,14 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont return code; } -static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet) { +static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet) { SRetrieveTableMsg *pRetrieve = pCont; void *pQInfo = (void*) htobe64(pRetrieve->qhandle); memset(pRet, 0, sizeof(SRspRet)); int32_t code = TSDB_CODE_SUCCESS; - dTrace("pVnode:%p vgId:%d QInfo:%p, retrieve msg is received", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, retrieve msg is received", pVnode->vgId, pQInfo); pRet->code = qRetrieveQueryResultInfo(pQInfo); if (pRet->code != TSDB_CODE_SUCCESS) { @@ -104,6 +104,6 @@ static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t c } } - dTrace("pVnode:%p vgId:%d QInfo:%p, retrieve msg is disposed", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, retrieve msg is disposed", pVnode->vgId, pQInfo); return code; } diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index 3541fc15b6..6f0bc5fcce 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) { if (vnodeProcessWriteMsgFp[pHead->msgType] == NULL) return TSDB_CODE_MSG_NOT_PROCESSED; - if (pVnode->status != TAOS_VN_STATUS_READY) + if (pVnode->status != TAOS_VN_STATUS_READY && qtype == TAOS_QTYPE_RPC) return TSDB_CODE_NOT_ACTIVE_VNODE; if (pHead->version == 0) { // from client @@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR // save insert result into item - dTrace("pVnode:%p vgId:%d, submit msg is processed", pVnode, pVnode->vgId); + vTrace("vgId:%d, submit msg is processed", pVnode->vgId); code = tsdbInsertData(pVnode->tsdb, pCont); pRet->len = sizeof(SShellSubmitRspMsg); @@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe SMDCreateTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to create", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to create", pVnode->vgId, pTable->tableId); int16_t numOfColumns = htons(pTable->numOfColumns); int16_t numOfTags = htons(pTable->numOfTags); int32_t sid = htonl(pTable->sid); @@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe tfree(pDestTagSchema); tfree(pDestSchema); - dTrace("pVnode:%p vgId:%d, table:%s is created, result:%x", pVnode, pVnode->vgId, pTable->tableId, code); + vTrace("vgId:%d, table:%s is created, result:%x", pVnode->vgId, pTable->tableId, code); return code; } @@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDDropTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to drop", pVnode->vgId, pTable->tableId); STableId tableId = { .uid = htobe64(pTable->uid), .tid = htonl(pTable->sid) @@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDCreateTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to alter", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to alter", pVnode->vgId, pTable->tableId); int16_t numOfColumns = htons(pTable->numOfColumns); int16_t numOfTags = htons(pTable->numOfTags); int32_t sid = htonl(pTable->sid); @@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet tfree(pDestSchema); - dTrace("pVnode:%p vgId:%d, table:%s, alter table result:%d", pVnode, pVnode->vgId, pTable->tableId, code); + vTrace("vgId:%d, table:%s, alter table result:%d", pVnode->vgId, pTable->tableId, code); return code; } @@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDDropSTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, stable:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, stable:%s, start to drop", pVnode->vgId, pTable->tableId); // TODO: drop stable in vvnode //int64_t uid = htobe64(pTable->uid); //void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode); //rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid); code = TSDB_CODE_SUCCESS; - dTrace("pVnode:%p vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code); + vTrace("vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code); return code; } diff --git a/src/wal/src/walMain.c b/src/wal/src/walMain.c index 5157d715bf..8d92fac926 100644 --- a/src/wal/src/walMain.c +++ b/src/wal/src/walMain.c @@ -79,7 +79,9 @@ void *walOpen(const char *path, const SWalCfg *pCfg) { pthread_mutex_destroy(&pWal->mutex); free(pWal); pWal = NULL; - } + } else { + wTrace("wal:%s, it is open, level:%d", path, pWal->level); + } return pWal; } @@ -177,8 +179,11 @@ void walFsync(void *handle) { SWal *pWal = handle; - if (pWal->level == TAOS_WAL_FSYNC) - fsync(pWal->fd); + if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) { + if (fsync(pWal->fd) < 0) { + wError("wal:%s, fsync failed(%s)", pWal->name, strerror(errno)); + } + } } int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int)) { diff --git a/src/wal/test/waltest.c b/src/wal/test/waltest.c index 5293c85443..cf9bf9542e 100644 --- a/src/wal/test/waltest.c +++ b/src/wal/test/waltest.c @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[i], "-v")==0 && i < argc-1) { ver = atoll(argv[++i]); } else if (strcmp(argv[i], "-d")==0 && i < argc-1) { - ddebugFlag = atoi(argv[++i]); + dDebugFlag = atoi(argv[++i]); } else { printf("\nusage: %s [options] \n", argv[0]); printf(" [-p path]: wal file path default is:%s\n", path); @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { printf(" [-r rows]: rows of records per wal file, default is:%d\n", rows); printf(" [-k keep]: keep the wal after closing, default is:%d\n", keep); printf(" [-v version]: initial version, default is:%ld\n", ver); - printf(" [-d debugFlag]: debug flag, default:%d\n", ddebugFlag); + printf(" [-d debugFlag]: debug flag, default:%d\n", dDebugFlag); printf(" [-h help]: print out this help\n\n"); exit(0); } diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index ec06eb38ef..cff6db2028 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -9,6 +9,11 @@ python3 ./test.py $1 -f insert/smallint.py python3 ./test.py $1 -f insert/tinyint.py python3 ./test.py $1 -f insert/date.py python3 ./test.py $1 -f insert/binary.py + +python3 ./test.py $1 -f table/column_name.py +python3 ./test.py $1 -f table/column_num.py +python3 ./test.py $1 -f table/db_table.py + python3 ./test.py $1 -f import_merge/importBlock1HO.py python3 ./test.py $1 -f import_merge/importBlock1HPO.py python3 ./test.py $1 -f import_merge/importBlock1H.py diff --git a/tests/pytest/import_merge/importDataH2.py b/tests/pytest/import_merge/importDataH2.py index d49abff374..73a412fb80 100644 --- a/tests/pytest/import_merge/importDataH2.py +++ b/tests/pytest/import_merge/importDataH2.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,19 +43,19 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") - tdLog.info("import %d sequential data" % (self.rows / 2)) + tdLog.info("import %d sequential data" % (self.maxrows / 2)) startTime = self.startTime sqlcmd = ['import into tb1 values'] - for rid in range(1, self.rows / 2 + 1): + for rid in range(1, self.maxrows / 2 + 1): sqlcmd.append('(%ld, %d)' % (startTime + rid, rid)) tdSql.execute(" ".join(sqlcmd)) tdLog.info("================= step3") tdSql.query('select * from tb1') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) tdLog.info("================= step4") tdDnodes.stop(1) @@ -70,7 +70,7 @@ class TDTestCase: tdLog.info("================= step7") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2 + 1) + tdSql.checkRows(self.maxrows / 2 + 1) tdLog.info("================= step8") tdLog.info("import 10 data in batch before") @@ -83,7 +83,7 @@ class TDTestCase: tdLog.info("================= step9") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2 + 11) + tdSql.checkRows(self.maxrows / 2 + 11) def stop(self): tdSql.close() diff --git a/tests/pytest/import_merge/importDataHO.py b/tests/pytest/import_merge/importDataHO.py index 0483e6844c..0fe6ab71d5 100644 --- a/tests/pytest/import_merge/importDataHO.py +++ b/tests/pytest/import_merge/importDataHO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxwrows = 200 self.rowsPerTable = 20 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataHO2.py b/tests/pytest/import_merge/importDataHO2.py index ab7044d2a7..6246b55b32 100644 --- a/tests/pytest/import_merge/importDataHO2.py +++ b/tests/pytest/import_merge/importDataHO2.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 self.rowsPerTable = 100 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataHPO.py b/tests/pytest/import_merge/importDataHPO.py index f165bd7b5a..c749dbd113 100644 --- a/tests/pytest/import_merge/importDataHPO.py +++ b/tests/pytest/import_merge/importDataHPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 self.rowsPerTable = 20 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataLastH.py b/tests/pytest/import_merge/importDataLastH.py index 319fd40677..830711a420 100644 --- a/tests/pytest/import_merge/importDataLastH.py +++ b/tests/pytest/import_merge/importDataLastH.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastHO.py b/tests/pytest/import_merge/importDataLastHO.py index 5a71c5db65..037c81f087 100644 --- a/tests/pytest/import_merge/importDataLastHO.py +++ b/tests/pytest/import_merge/importDataLastHO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastHPO.py b/tests/pytest/import_merge/importDataLastHPO.py index f2c95cbd4d..46a7e5909d 100644 --- a/tests/pytest/import_merge/importDataLastHPO.py +++ b/tests/pytest/import_merge/importDataLastHPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastS.py b/tests/pytest/import_merge/importDataLastS.py index 929e02dd1e..2dd7cdb744 100644 --- a/tests/pytest/import_merge/importDataLastS.py +++ b/tests/pytest/import_merge/importDataLastS.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastSub.py b/tests/pytest/import_merge/importDataLastSub.py index 158fa0fb3c..bb9953057e 100644 --- a/tests/pytest/import_merge/importDataLastSub.py +++ b/tests/pytest/import_merge/importDataLastSub.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastT.py b/tests/pytest/import_merge/importDataLastT.py index 9bc90a8275..29f0afaf1a 100644 --- a/tests/pytest/import_merge/importDataLastT.py +++ b/tests/pytest/import_merge/importDataLastT.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastTO.py b/tests/pytest/import_merge/importDataLastTO.py index 0c93ac430b..47639130b5 100644 --- a/tests/pytest/import_merge/importDataLastTO.py +++ b/tests/pytest/import_merge/importDataLastTO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastTPO.py b/tests/pytest/import_merge/importDataLastTPO.py index 188e93e0db..4190836505 100644 --- a/tests/pytest/import_merge/importDataLastTPO.py +++ b/tests/pytest/import_merge/importDataLastTPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataS.py b/tests/pytest/import_merge/importDataS.py index 65d4087c3d..daa4b2e025 100644 --- a/tests/pytest/import_merge/importDataS.py +++ b/tests/pytest/import_merge/importDataS.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataSub.py b/tests/pytest/import_merge/importDataSub.py index 4bf85f2bdd..2359ca214f 100644 --- a/tests/pytest/import_merge/importDataSub.py +++ b/tests/pytest/import_merge/importDataSub.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,19 +43,19 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") - tdLog.info("import %d sequential data" % (self.rows / 2)) + tdLog.info("import %d sequential data" % (self.maxrows / 2)) startTime = self.startTime sqlcmd = ['import into tb1 values'] - for rid in range(1, self.rows / 2 + 1): + for rid in range(1, self.maxrows / 2 + 1): sqlcmd.append('(%ld, %d)' % (startTime + rid, rid)) tdSql.execute(" ".join(sqlcmd)) tdLog.info("================= step3") tdSql.query('select * from tb1') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) tdLog.info("================= step4") tdDnodes.stop(1) @@ -73,7 +73,7 @@ class TDTestCase: tdLog.info("================= step9") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) def stop(self): tdSql.close() diff --git a/tests/pytest/import_merge/importDataT.py b/tests/pytest/import_merge/importDataT.py index 66016c5555..abb5e312ef 100644 --- a/tests/pytest/import_merge/importDataT.py +++ b/tests/pytest/import_merge/importDataT.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataTO.py b/tests/pytest/import_merge/importDataTO.py index a3c17b2846..2a6d9e272b 100644 --- a/tests/pytest/import_merge/importDataTO.py +++ b/tests/pytest/import_merge/importDataTO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataTPO.py b/tests/pytest/import_merge/importDataTPO.py index 20eb41cc08..06d5cf3c1a 100644 --- a/tests/pytest/import_merge/importDataTPO.py +++ b/tests/pytest/import_merge/importDataTPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importLastH.py b/tests/pytest/import_merge/importLastH.py index c69f453971..a6f9fa087c 100644 --- a/tests/pytest/import_merge/importLastH.py +++ b/tests/pytest/import_merge/importLastH.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastHO.py b/tests/pytest/import_merge/importLastHO.py index ec930d1807..e6468b243e 100644 --- a/tests/pytest/import_merge/importLastHO.py +++ b/tests/pytest/import_merge/importLastHO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastHPO.py b/tests/pytest/import_merge/importLastHPO.py index 9603a7b852..4a299ed823 100644 --- a/tests/pytest/import_merge/importLastHPO.py +++ b/tests/pytest/import_merge/importLastHPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastS.py b/tests/pytest/import_merge/importLastS.py index 7dbe74e2ca..2a5de46eb2 100644 --- a/tests/pytest/import_merge/importLastS.py +++ b/tests/pytest/import_merge/importLastS.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastSub.py b/tests/pytest/import_merge/importLastSub.py index f028ba5fd7..fa1b2387f3 100644 --- a/tests/pytest/import_merge/importLastSub.py +++ b/tests/pytest/import_merge/importLastSub.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastT.py b/tests/pytest/import_merge/importLastT.py index 3fe4e0006c..b7a1e58bc5 100644 --- a/tests/pytest/import_merge/importLastT.py +++ b/tests/pytest/import_merge/importLastT.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastTO.py b/tests/pytest/import_merge/importLastTO.py index 76e5016bdb..541cbd29ca 100644 --- a/tests/pytest/import_merge/importLastTO.py +++ b/tests/pytest/import_merge/importLastTO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastTPO.py b/tests/pytest/import_merge/importLastTPO.py index 08f4168063..6ec21d0c79 100644 --- a/tests/pytest/import_merge/importLastTPO.py +++ b/tests/pytest/import_merge/importLastTPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/smoketest.sh b/tests/pytest/smoketest.sh index 7dbefa9402..af597fb6c5 100755 --- a/tests/pytest/smoketest.sh +++ b/tests/pytest/smoketest.sh @@ -34,12 +34,12 @@ python3 ./test.py $1 -f table/db_table.py python3 ./test.py -s $1 sleep 1 -#python3 ./test.py $1 -f import_merge/importDataLastTO.py -#python3 ./test.py -s $1 -#sleep 1 -#python3 ./test.py $1 -f import_merge/importDataLastT.py -#python3 ./test.py -s $1 -#sleep 1 +python3 ./test.py $1 -f import_merge/importDataLastTO.py +python3 ./test.py -s $1 +sleep 1 +python3 ./test.py $1 -f import_merge/importDataLastT.py +python3 ./test.py -s $1 +sleep 1 python3 ./test.py $1 -f import_merge/importDataTO.py python3 ./test.py -s $1 sleep 1 diff --git a/tests/script/general/agg/testSuite.sim b/tests/script/general/agg/testSuite.sim deleted file mode 100644 index 9aac0d7026..0000000000 --- a/tests/script/general/agg/testSuite.sim +++ /dev/null @@ -1,2 +0,0 @@ -run general/agg/fill.sim -run general/agg/stream.sim \ No newline at end of file diff --git a/tests/script/general/alter/cached_schema_after_alter.sim b/tests/script/general/alter/cached_schema_after_alter.sim index d81720a1da..921cfee3d1 100644 --- a/tests/script/general/alter/cached_schema_after_alter.sim +++ b/tests/script/general/alter/cached_schema_after_alter.sim @@ -117,3 +117,5 @@ endi if $data12 != 2 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/count.sim b/tests/script/general/alter/count.sim index a6a2a13ef7..a42fde74b7 100644 --- a/tests/script/general/alter/count.sim +++ b/tests/script/general/alter/count.sim @@ -264,3 +264,4 @@ if $data00 != 31 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/import.sim b/tests/script/general/alter/import.sim index 1771d47298..6129765513 100644 --- a/tests/script/general/alter/import.sim +++ b/tests/script/general/alter/import.sim @@ -47,3 +47,5 @@ sql select count(b) from tb if $data00 != 5 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/insert1.sim b/tests/script/general/alter/insert1.sim index 7095313a0d..4246bdc18e 100644 --- a/tests/script/general/alter/insert1.sim +++ b/tests/script/general/alter/insert1.sim @@ -20,25 +20,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi @@ -61,25 +61,25 @@ endi if $data02 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi @@ -95,25 +95,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -122,22 +122,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -149,19 +149,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi @@ -177,25 +177,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -204,22 +204,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -231,19 +231,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -258,16 +258,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi @@ -291,25 +291,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -318,22 +318,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -345,19 +345,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -372,16 +372,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -399,13 +399,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi @@ -421,25 +421,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -448,22 +448,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -475,19 +475,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -502,16 +502,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -529,13 +529,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -556,10 +556,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi @@ -575,25 +575,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -602,22 +602,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -629,19 +629,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -656,16 +656,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -683,13 +683,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -710,10 +710,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -737,7 +737,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi @@ -753,25 +753,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -780,22 +780,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -807,19 +807,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -834,16 +834,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -861,13 +861,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -888,10 +888,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -915,7 +915,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi if $data71 != -7 then @@ -942,7 +942,7 @@ endi if $data78 != 11 then return -1 endi -if $data79 != null then +if $data79 != NULL then return -1 endi @@ -959,25 +959,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -986,22 +986,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -1013,19 +1013,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -1040,16 +1040,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -1067,13 +1067,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -1094,10 +1094,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -1121,7 +1121,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi if $data71 != -7 then @@ -1148,3 +1148,5 @@ endi if $data78 != 11 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/insert2.sim b/tests/script/general/alter/insert2.sim index a248c7cd2b..007060b7f0 100644 --- a/tests/script/general/alter/insert2.sim +++ b/tests/script/general/alter/insert2.sim @@ -74,7 +74,7 @@ endi if $data07 != 8 then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 1 then @@ -98,7 +98,7 @@ endi if $data17 != 8 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi @@ -129,10 +129,10 @@ endi if $data06 != 8 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 2 then @@ -153,10 +153,10 @@ endi if $data16 != 8 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 1 then @@ -177,10 +177,10 @@ endi if $data26 != 8 then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi @@ -206,16 +206,16 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 3 then @@ -230,16 +230,16 @@ endi if $data14 != 8 then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 2 then @@ -254,16 +254,16 @@ endi if $data24 != 8 then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 1 then @@ -278,16 +278,16 @@ endi if $data34 != 8 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi @@ -313,19 +313,19 @@ endi if $data03 != 5 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -19 then @@ -337,19 +337,19 @@ endi if $data13 != 0 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 3 then @@ -361,19 +361,19 @@ endi if $data23 != 8 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 2 then @@ -385,19 +385,19 @@ endi if $data33 != 8 then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != 1 then @@ -409,19 +409,19 @@ endi if $data43 != 8 then return -1 endi -if $data44 != null then +if $data44 != NULL then return -1 endi -if $data45 != null then +if $data45 != NULL then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi @@ -443,22 +443,22 @@ endi if $data12 != 5 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data21 != -19 then @@ -467,22 +467,22 @@ endi if $data22 != 0 then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 3 then @@ -491,22 +491,22 @@ endi if $data32 != 8 then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != 2 then @@ -515,22 +515,22 @@ endi if $data42 != 8 then return -1 endi -if $data43 != null then +if $data43 != NULL then return -1 endi -if $data44 != null then +if $data44 != NULL then return -1 endi -if $data45 != null then +if $data45 != NULL then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != 1 then @@ -539,19 +539,19 @@ endi if $data52 != 8 then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi -if $data54 != null then +if $data54 != NULL then return -1 endi -if $data55 != null then +if $data55 != NULL then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi @@ -568,52 +568,52 @@ print data01 = $data01 if $data01 != -10 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi if $data11 != -13 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data21 != -16 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi if $data31 != -19 then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi if $data41 != 3 then return -1 endi -if $data42 != null then +if $data42 != NULL then return -1 endi if $data51 != 2 then return -1 endi -if $data52 != null then +if $data52 != NULL then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data62 != null then +if $data62 != NULL then return -1 endi @@ -632,52 +632,53 @@ endi if $data01 != -10 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi if $data11 != -13 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data21 != -16 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi if $data31 != -19 then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi if $data41 != 3 then return -1 endi -if $data42 != null then +if $data42 != NULL then return -1 endi if $data51 != 2 then return -1 endi -if $data52 != null then +if $data52 != NULL then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data62 != null then +if $data62 != NULL then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/metrics.sim b/tests/script/general/alter/metrics.sim index be11ddc7f5..b346b3b2c0 100644 --- a/tests/script/general/alter/metrics.sim +++ b/tests/script/general/alter/metrics.sim @@ -770,7 +770,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi @@ -781,3 +781,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/table.sim b/tests/script/general/alter/table.sim index 8660d0d312..c6402b45f7 100644 --- a/tests/script/general/alter/table.sim +++ b/tests/script/general/alter/table.sim @@ -673,7 +673,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != null then +if $data20 != NULL then return -1 endi @@ -684,3 +684,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/alter/testSuite.sim b/tests/script/general/alter/testSuite.sim index 33a926f7b2..cfac68144c 100644 --- a/tests/script/general/alter/testSuite.sim +++ b/tests/script/general/alter/testSuite.sim @@ -1,5 +1,5 @@ -run general/alter/count.sim run general/alter/cached_schema_after_alter.sim +run general/alter/count.sim run general/alter/import.sim run general/alter/insert1.sim run general/alter/insert2.sim diff --git a/tests/script/general/cache/new_metrics.sim b/tests/script/general/cache/new_metrics.sim index 2f7de7f1eb..64170ec67e 100644 --- a/tests/script/general/cache/new_metrics.sim +++ b/tests/script/general/cache/new_metrics.sim @@ -140,6 +140,4 @@ if $data04 != 10 then return -1 endi - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/cache/restart_metrics.sim b/tests/script/general/cache/restart_metrics.sim index 70f53ac69e..dbd15b945f 100644 --- a/tests/script/general/cache/restart_metrics.sim +++ b/tests/script/general/cache/restart_metrics.sim @@ -83,3 +83,4 @@ if $data02 != 3 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/cache/restart_table.sim b/tests/script/general/cache/restart_table.sim index 7ea4c24b4d..4e8bc92c10 100644 --- a/tests/script/general/cache/restart_table.sim +++ b/tests/script/general/cache/restart_table.sim @@ -56,4 +56,4 @@ if $data01 != 1 then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/cache/testSuite.sim b/tests/script/general/cache/testSuite.sim index 1265a1060e..f09ece89b6 100644 --- a/tests/script/general/cache/testSuite.sim +++ b/tests/script/general/cache/testSuite.sim @@ -1,5 +1,3 @@ +run general/cache/new_metrics.sim run general/cache/restart_table.sim run general/cache/restart_metrics.sim -run general/cache/restart_stream.sim -run general/cache/new_metrics.sim -run general/cache/new_stream.sim diff --git a/tests/script/general/column/commit.sim b/tests/script/general/column/commit.sim index f8fc85a109..7bc62619f3 100644 --- a/tests/script/general/column/commit.sim +++ b/tests/script/general/column/commit.sim @@ -151,4 +151,6 @@ if $data08 != 10 then endi if $data09 != 10 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/column/metrics.sim b/tests/script/general/column/metrics.sim index 23fbbfdbf5..401a4ae54e 100644 --- a/tests/script/general/column/metrics.sim +++ b/tests/script/general/column/metrics.sim @@ -215,3 +215,5 @@ endi if $data09 != 20 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/column/table.sim b/tests/script/general/column/table.sim index af357eea86..8e9c44fc46 100644 --- a/tests/script/general/column/table.sim +++ b/tests/script/general/column/table.sim @@ -211,3 +211,5 @@ endi if $data07 != 2.872281323 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/column/testSuite.sim b/tests/script/general/column/testSuite.sim index 2a0b9efd45..f60d197e95 100644 --- a/tests/script/general/column/testSuite.sim +++ b/tests/script/general/column/testSuite.sim @@ -1,4 +1,3 @@ -run general/column/table.sim -run general/column/metrics.sim -run general/column/stream.sim run general/column/commit.sim +run general/column/metrics.sim +run general/column/table.sim diff --git a/tests/script/general/compress/commitlog.sim b/tests/script/general/compress/commitlog.sim index e2c3964e1b..2c69b809d1 100644 --- a/tests/script/general/compress/commitlog.sim +++ b/tests/script/general/compress/commitlog.sim @@ -1,9 +1,8 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -88,9 +87,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 20000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -124,4 +123,4 @@ if $rows != $N then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compress/compress.sim b/tests/script/general/compress/compress.sim index 276fba9f8c..bc56227c74 100644 --- a/tests/script/general/compress/compress.sim +++ b/tests/script/general/compress/compress.sim @@ -1,9 +1,8 @@ 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 compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +82,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +118,4 @@ if $rows != $N then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compress/compress2.sim b/tests/script/general/compress/compress2.sim index 29d14c2c75..c3b445c04c 100644 --- a/tests/script/general/compress/compress2.sim +++ b/tests/script/general/compress/compress2.sim @@ -1,9 +1,8 @@ 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 compression -v 2 +system sh/cfg.sh -n dnode1 -c comp -v 2 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +82,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +118,4 @@ if $rows != $N then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compress/testSuite.sim b/tests/script/general/compress/testSuite.sim index 97c76aec15..3573985c8a 100644 --- a/tests/script/general/compress/testSuite.sim +++ b/tests/script/general/compress/testSuite.sim @@ -1,4 +1,4 @@ -run general/compress/compress.sim -run general/compress/uncompress.sim run general/compress/commitlog.sim run general/compress/compress2.sim +run general/compress/compress.sim +run general/compress/uncompress.sim diff --git a/tests/script/general/compress/uncompress.sim b/tests/script/general/compress/uncompress.sim index a7b8a95d52..8dde7fae34 100644 --- a/tests/script/general/compress/uncompress.sim +++ b/tests/script/general/compress/uncompress.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 compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +81,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +117,4 @@ if $rows != $N then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/avg.sim b/tests/script/general/compute/avg.sim index 21dea70071..9a37363a60 100644 --- a/tests/script/general/compute/avg.sim +++ b/tests/script/general/compute/avg.sim @@ -153,4 +153,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/bottom.sim b/tests/script/general/compute/bottom.sim index 241f775f34..592f87651e 100644 --- a/tests/script/general/compute/bottom.sim +++ b/tests/script/general/compute/bottom.sim @@ -94,4 +94,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/count.sim b/tests/script/general/compute/count.sim index bb087c0ffb..aef30c8b6c 100644 --- a/tests/script/general/compute/count.sim +++ b/tests/script/general/compute/count.sim @@ -169,4 +169,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/diff.sim b/tests/script/general/compute/diff.sim index 00f1396319..8a60cd00bc 100644 --- a/tests/script/general/compute/diff.sim +++ b/tests/script/general/compute/diff.sim @@ -86,4 +86,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/diff2.sim b/tests/script/general/compute/diff2.sim index ec23b2481b..53b508ca6f 100644 --- a/tests/script/general/compute/diff2.sim +++ b/tests/script/general/compute/diff2.sim @@ -153,3 +153,5 @@ print =============== clear #if $rows != 0 then # return -1 #endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/first.sim b/tests/script/general/compute/first.sim index 39acb444ab..80f4f53cdb 100644 --- a/tests/script/general/compute/first.sim +++ b/tests/script/general/compute/first.sim @@ -155,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/interval.sim b/tests/script/general/compute/interval.sim index f00d39bcef..26f40eda5a 100644 --- a/tests/script/general/compute/interval.sim +++ b/tests/script/general/compute/interval.sim @@ -171,4 +171,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/last.sim b/tests/script/general/compute/last.sim index 779d1f3691..0e92bb6d45 100644 --- a/tests/script/general/compute/last.sim +++ b/tests/script/general/compute/last.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/leastsquare.sim b/tests/script/general/compute/leastsquare.sim index ebafa2baf5..bbadd849cb 100644 --- a/tests/script/general/compute/leastsquare.sim +++ b/tests/script/general/compute/leastsquare.sim @@ -96,3 +96,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/max.sim b/tests/script/general/compute/max.sim index 5a90739838..4fc760d66d 100644 --- a/tests/script/general/compute/max.sim +++ b/tests/script/general/compute/max.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/min.sim b/tests/script/general/compute/min.sim index d87ca1ae9b..82a22b642e 100644 --- a/tests/script/general/compute/min.sim +++ b/tests/script/general/compute/min.sim @@ -155,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/null.sim b/tests/script/general/compute/null.sim index 9f2e9ecf40..cde95ca77f 100644 --- a/tests/script/general/compute/null.sim +++ b/tests/script/general/compute/null.sim @@ -51,7 +51,7 @@ $tb = $tbPrefix . $i sql select * from $tb print $data00 $data01 $data02 -if $data01 != null then +if $data01 != NULL then return -1 endi if $data02 != 0 then @@ -165,7 +165,7 @@ sql select * from t2 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -173,7 +173,7 @@ sql select * from t3 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -181,7 +181,7 @@ sql select * from t4 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -189,7 +189,7 @@ sql select * from t5 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -197,7 +197,7 @@ sql select * from t6 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -205,7 +205,7 @@ sql select * from t7 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -213,7 +213,7 @@ endi #if $rows != 1 then # return -1 #endi -#if $data01 != null then +#if $data01 != NULL then # return -1 #endi @@ -222,4 +222,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/percentile.sim b/tests/script/general/compute/percentile.sim index 5d3f40a6de..dd309c3789 100644 --- a/tests/script/general/compute/percentile.sim +++ b/tests/script/general/compute/percentile.sim @@ -112,3 +112,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/stddev.sim b/tests/script/general/compute/stddev.sim index 4eaba14605..7cea8726a9 100644 --- a/tests/script/general/compute/stddev.sim +++ b/tests/script/general/compute/stddev.sim @@ -93,4 +93,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/sum.sim b/tests/script/general/compute/sum.sim index 79c7bc0762..d05fe8930e 100644 --- a/tests/script/general/compute/sum.sim +++ b/tests/script/general/compute/sum.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/testSuite.sim b/tests/script/general/compute/testSuite.sim index 5539e08a9d..6cd6badaee 100644 --- a/tests/script/general/compute/testSuite.sim +++ b/tests/script/general/compute/testSuite.sim @@ -1,16 +1,16 @@ -run general/compute/count.sim run general/compute/avg.sim -run general/compute/sum.sim -run general/compute/min.sim -run general/compute/max.sim -run general/compute/first.sim -run general/compute/last.sim -run general/compute/stddev.sim -run general/compute/leastsquare.sim -run general/compute/top.sim run general/compute/bottom.sim -run general/compute/percentile.sim +run general/compute/count.sim run general/compute/diff.sim -run general/compute/interval.sim -run general/compute/null.sim run general/compute/diff2.sim +run general/compute/first.sim +run general/compute/interval.sim +run general/compute/last.sim +run general/compute/leastsquare.sim +run general/compute/max.sim +run general/compute/min.sim +run general/compute/null.sim +run general/compute/percentile.sim +run general/compute/stddev.sim +run general/compute/sum.sim +run general/compute/top.sim diff --git a/tests/script/general/compute/top.sim b/tests/script/general/compute/top.sim index 8f3797b678..14b3b328a0 100644 --- a/tests/script/general/compute/top.sim +++ b/tests/script/general/compute/top.sim @@ -94,4 +94,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic.sim b/tests/script/general/db/basic.sim index dddc976ab3..43b18abd32 100644 --- a/tests/script/general/db/basic.sim +++ b/tests/script/general/db/basic.sim @@ -1,6 +1,4 @@ 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 @@ -202,3 +200,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic1.sim b/tests/script/general/db/basic1.sim index 1fa6678ef8..302c5ac409 100644 --- a/tests/script/general/db/basic1.sim +++ b/tests/script/general/db/basic1.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -56,4 +57,6 @@ endi if $data03 != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic2.sim b/tests/script/general/db/basic2.sim index 945481d9bf..afe5ee5d95 100644 --- a/tests/script/general/db/basic2.sim +++ b/tests/script/general/db/basic2.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -49,3 +50,5 @@ sql show tables if $rows != 3 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic3.sim b/tests/script/general/db/basic3.sim index 00e3e9d106..88f5bf6460 100644 --- a/tests/script/general/db/basic3.sim +++ b/tests/script/general/db/basic3.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -47,3 +48,5 @@ sql show d2.tables if $rows != 3 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic4.sim b/tests/script/general/db/basic4.sim index 9f8d463a7d..8494b0358a 100644 --- a/tests/script/general/db/basic4.sim +++ b/tests/script/general/db/basic4.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -116,3 +117,5 @@ sql show d1.vgroups if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic5.sim b/tests/script/general/db/basic5.sim index 09ace39bf4..3c59144387 100644 --- a/tests/script/general/db/basic5.sim +++ b/tests/script/general/db/basic5.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -55,3 +56,5 @@ if $rows != 0 then endi sql_error show d1.vgroups + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reuse1.sim b/tests/script/general/db/delete_reuse1.sim index 8eb38ed1b1..1e4baeb576 100644 --- a/tests/script/general/db/delete_reuse1.sim +++ b/tests/script/general/db/delete_reuse1.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -107,3 +108,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reuse2.sim b/tests/script/general/db/delete_reuse2.sim index d7483a1b58..0117d87104 100644 --- a/tests/script/general/db/delete_reuse2.sim +++ b/tests/script/general/db/delete_reuse2.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -115,3 +116,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reusevnode.sim b/tests/script/general/db/delete_reusevnode.sim index 1328ae1a9c..c76a2e8bc7 100644 --- a/tests/script/general/db/delete_reusevnode.sim +++ b/tests/script/general/db/delete_reusevnode.sim @@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -109,3 +110,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reusevnode2.sim b/tests/script/general/db/delete_reusevnode2.sim index b0032e137b..12357b9e44 100644 --- a/tests/script/general/db/delete_reusevnode2.sim +++ b/tests/script/general/db/delete_reusevnode2.sim @@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -70,3 +71,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_writing1.sim b/tests/script/general/db/delete_writing1.sim index 134a34bf95..58fe68dd5f 100644 --- a/tests/script/general/db/delete_writing1.sim +++ b/tests/script/general/db/delete_writing1.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect sql create database db @@ -52,3 +53,5 @@ while $x < 20 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_writing2.sim b/tests/script/general/db/delete_writing2.sim index 819c16751a..00383d1341 100644 --- a/tests/script/general/db/delete_writing2.sim +++ b/tests/script/general/db/delete_writing2.sim @@ -6,6 +6,7 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect sql create database db @@ -43,3 +44,5 @@ while $x < 10 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/len.sim b/tests/script/general/db/len.sim index d8c0e9363f..8add486658 100644 --- a/tests/script/general/db/len.sim +++ b/tests/script/general/db/len.sim @@ -91,4 +91,6 @@ step8: sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/repeat.sim b/tests/script/general/db/repeat.sim index a69e3fa019..ca68e6d883 100644 --- a/tests/script/general/db/repeat.sim +++ b/tests/script/general/db/repeat.sim @@ -1,6 +1,4 @@ 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 @@ -69,3 +67,5 @@ sql drop database d9 sql drop database d10 sql drop database d11 sql drop database d12 + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/tables.sim b/tests/script/general/db/tables.sim index 590c6fc442..bf714dbf56 100644 --- a/tests/script/general/db/tables.sim +++ b/tests/script/general/db/tables.sim @@ -138,4 +138,6 @@ endi sql select * from t4 if $data01 != 4 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/testSuite.sim b/tests/script/general/db/testSuite.sim index 893d2040a9..2cac8b8fa8 100644 --- a/tests/script/general/db/testSuite.sim +++ b/tests/script/general/db/testSuite.sim @@ -7,7 +7,7 @@ run general/db/basic5.sim run general/db/delete_reuse1.sim run general/db/delete_reuse2.sim run general/db/delete_reusevnode.sim -#run general/db/delete_reusevnode2.sim +run general/db/delete_reusevnode2.sim run general/db/delete_writing1.sim run general/db/delete_writing2.sim run general/db/len.sim diff --git a/tests/script/general/field/2.sim b/tests/script/general/field/2.sim index dff0e6250c..28506b7cb8 100644 --- a/tests/script/general/field/2.sim +++ b/tests/script/general/field/2.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bt_db -$tbPrefix = fi_bt_tb -$mtPrefix = fi_bt_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -233,6 +231,8 @@ if $data00 != 100 then return -1 endi +print sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 + sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 print $data00 $data01 $data02 $data03 $data04 $data05 $data06 if $data00 != 100 then @@ -292,4 +292,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/3.sim b/tests/script/general/field/3.sim index 05fed07428..453f4968bf 100644 --- a/tests/script/general/field/3.sim +++ b/tests/script/general/field/3.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_3_db -$tbPrefix = fi_3_tb -$mtPrefix = fi_3_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = mt $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -518,4 +516,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/4.sim b/tests/script/general/field/4.sim index ad84124b7d..243424724f 100644 --- a/tests/script/general/field/4.sim +++ b/tests/script/general/field/4.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_4_db -$tbPrefix = fi_4_tb -$mtPrefix = fi_4_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -708,4 +706,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/5.sim b/tests/script/general/field/5.sim index 63fec1f169..ca1543b54b 100644 --- a/tests/script/general/field/5.sim +++ b/tests/script/general/field/5.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_5_db -$tbPrefix = fi_5_tb -$mtPrefix = fi_5_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -831,4 +829,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/6.sim b/tests/script/general/field/6.sim index 409c2e53c3..23223e5c15 100644 --- a/tests/script/general/field/6.sim +++ b/tests/script/general/field/6.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_6_db -$tbPrefix = fi_6_tb -$mtPrefix = fi_6_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -986,4 +984,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/bigint.sim b/tests/script/general/field/bigint.sim index e355cb3161..5cca73595c 100644 --- a/tests/script/general/field/bigint.sim +++ b/tests/script/general/field/bigint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bi_db -$tbPrefix = fi_bi_tb -$mtPrefix = fi_bi_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/binary.sim b/tests/script/general/field/binary.sim index 3ac4376097..8bf1c84b93 100644 --- a/tests/script/general/field/binary.sim +++ b/tests/script/general/field/binary.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_by_db -$tbPrefix = fi_by_tb -$mtPrefix = fi_by_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -81,4 +79,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/bool.sim b/tests/script/general/field/bool.sim index 8a1a717225..4528f79bc7 100644 --- a/tests/script/general/field/bool.sim +++ b/tests/script/general/field/bool.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bo_db -$tbPrefix = fi_bo_tb -$mtPrefix = fi_bo_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -158,4 +156,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/double.sim b/tests/script/general/field/double.sim index 2de34ad5b6..40650cb9bd 100644 --- a/tests/script/general/field/double.sim +++ b/tests/script/general/field/double.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_do_db -$tbPrefix = fi_do_tb -$mtPrefix = fi_do_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/float.sim b/tests/script/general/field/float.sim index 443a721340..0ead9fb48a 100644 --- a/tests/script/general/field/float.sim +++ b/tests/script/general/field/float.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_fl_db -$tbPrefix = fi_fl_tb -$mtPrefix = fi_fl_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/int.sim b/tests/script/general/field/int.sim index 4ab1005671..a095dc2176 100644 --- a/tests/script/general/field/int.sim +++ b/tests/script/general/field/int.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_in_db -$tbPrefix = fi_in_tb -$mtPrefix = fi_in_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/single.sim b/tests/script/general/field/single.sim index 6d710614f2..8540608e96 100644 --- a/tests/script/general/field/single.sim +++ b/tests/script/general/field/single.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_si_db -$tbPrefix = fi_si_tb -$mtPrefix = fi_si_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $rowNum = 20 print =============== step1 @@ -215,4 +213,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/smallint.sim b/tests/script/general/field/smallint.sim index 37ddadb271..578de4ea44 100644 --- a/tests/script/general/field/smallint.sim +++ b/tests/script/general/field/smallint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_sm_db -$tbPrefix = fi_sm_tb -$mtPrefix = fi_sm_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/testSuite.sim b/tests/script/general/field/testSuite.sim index 9b58c77e92..807ee8e315 100644 --- a/tests/script/general/field/testSuite.sim +++ b/tests/script/general/field/testSuite.sim @@ -1,14 +1,11 @@ -run general/field/single.sim -run general/field/bool.sim -run general/field/smallint.sim -run general/field/tinyint.sim -run general/field/int.sim -run general/field/bigint.sim -run general/field/float.sim -run general/field/double.sim -run general/field/binary.sim run general/field/2.sim run general/field/3.sim run general/field/4.sim run general/field/5.sim -run general/field/6.sim \ No newline at end of file +run general/field/6.sim +run general/field/bigint.sim +run general/field/binary.sim +run general/field/bool.sim +run general/field/single.sim +run general/field/smallint.sim +run general/field/tinyint.sim diff --git a/tests/script/general/field/tinyint.sim b/tests/script/general/field/tinyint.sim index 65775c1145..f132b42702 100644 --- a/tests/script/general/field/tinyint.sim +++ b/tests/script/general/field/tinyint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -10,9 +8,9 @@ sql connect print ======================== dnode1 start -$dbPrefix = fi_ti_db -$tbPrefix = fi_ti_tb -$mtPrefix = fi_ti_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -158,4 +156,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/grafana.sim b/tests/script/general/http/grafana.sim index f2f84f7985..a5cc7b3237 100644 --- a/tests/script/general/http/grafana.sim +++ b/tests/script/general/http/grafana.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 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 http -v 1 #system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 system sh/exec.sh -n dnode1 -s start @@ -54,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3) print =============== step2 - login -system_content curl 192.168.0.1:6020/grafana/ +system_content curl 127.0.0.1:6020/grafana/ print 1-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/xx +system_content curl 127.0.0.1:6020/grafana/xx print 2-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/login/xx/xx/ +system_content curl 127.0.0.1:6020/grafana/login/xx/xx/ print 3-> $system_content -if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"invalid user"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/root/1/123/1/1/3 +system_content curl 127.0.0.1:6020/grafana/root/1/123/1/1/3 print 4-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/grafana/login/1/root/1/ +system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/grafana/login/1/root/1/ print 5-> $system_content -if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"invalid user"}@ then return -1 endi -system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login +system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login print 6-> $system_content if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then return -1 endi -system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login +system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login print 7-> $system_content if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then return -1 endi sleep 3000 -system_content curl 192.168.0.1:6020/grafana/login/root/taosdata +system_content curl 127.0.0.1:6020/grafana/login/root/taosdata print 8-> $system_content if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then return -1 @@ -180,3 +178,5 @@ print 19-> $system_content if $system_content != @[{"refId":"A","target":"3","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"15.299999714","datapoints":[[3,"-"]]}]@ then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/grafana_bug.sim b/tests/script/general/http/grafana_bug.sim index 41347d855f..6f12849b2b 100644 --- a/tests/script/general/http/grafana_bug.sim +++ b/tests/script/general/http/grafana_bug.sim @@ -1,9 +1,7 @@ system sh/stop_dnodes.sh - -sleep 2000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 #system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 @@ -237,3 +235,4 @@ if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]}, return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/prepare.sim b/tests/script/general/http/prepare.sim index 17b6823e00..d5b8920190 100644 --- a/tests/script/general/http/prepare.sim +++ b/tests/script/general/http/prepare.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 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 http -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -52,3 +50,5 @@ print curl 127.0.0.1:6020/rest/sql/d1 -----> $system_content if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful.sim b/tests/script/general/http/restful.sim index 894033e8f0..5ee8bde46f 100644 --- a/tests/script/general/http/restful.sim +++ b/tests/script/general/http/restful.sim @@ -1,5 +1,5 @@ system sh/stop_dnodes.sh -sleep 5000 +sleep 3000 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 http -v 1 @@ -80,3 +80,5 @@ print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful_full.sim b/tests/script/general/http/restful_full.sim index a4c1bd1851..a5defb5914 100644 --- a/tests/script/general/http/restful_full.sim +++ b/tests/script/general/http/restful_full.sim @@ -1,5 +1,5 @@ system sh/stop_dnodes.sh -sleep 5000 +sleep 3000 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 http -v 1 @@ -81,7 +81,7 @@ print =============== step2 - no db #11 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql print 11-> $system_content -if $system_content != @{"status":"succ","head":["name","create time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","tables","cache(MB)","blocks","minrows","maxrows","ctime(s)","clog","comp","precision","status"],"data":[],"rows":0}@ then +if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","maxtables","cache(MB)","blocks","minrows","maxrows","ctime(Sec.)","wallevel","comp","precision","status"],"data":[],"rows":0}@ then return -1 endi @@ -93,7 +93,7 @@ endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql print 13-> $system_content -if $system_content != @{"status":"error","code":1000,"desc":"DB already there"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"database aleady exist"}@ then return -1 endi @@ -230,3 +230,4 @@ if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12- return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful_insert.sim b/tests/script/general/http/restful_insert.sim index 66f47728ed..7b1e88a25f 100644 --- a/tests/script/general/http/restful_insert.sim +++ b/tests/script/general/http/restful_insert.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 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 http -v 1 system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1 system sh/exec.sh -n dnode1 -s start @@ -51,3 +49,5 @@ print =============== step5 - query data system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest1' 127.0.0.1:6020/rest/sql print curl 127.0.0.1:6020/rest/sql -----> $system_content + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful_limit.sim b/tests/script/general/http/restful_limit.sim index 1cbbb221e3..8ee12f1c37 100644 --- a/tests/script/general/http/restful_limit.sim +++ b/tests/script/general/http/restful_limit.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -43,3 +42,5 @@ print curl 127.0.0.1:6020/rest/sql -----> $system_content #system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d "select * from db0.st0 where tbname in ('tb0', 'tb1') limit 1000" 127.0.0.1:6020/rest/sql #print curl 127.0.0.1:6020/rest/sql -----> $system_content + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/telegraf.sim b/tests/script/general/http/telegraf.sim index 7d687ff460..60eeec652e 100644 --- a/tests/script/general/http/telegraf.sim +++ b/tests/script/general/http/telegraf.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 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 http -v 1 system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1 system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0 system sh/exec.sh -n dnode1 -s start @@ -18,14 +16,14 @@ print =============== step1 - parse system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ print $system_content -if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1022,"desc":"database name can not be NULL"}@ then return -1 endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ print $system_content -if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1022,"desc":"database name can not be NULL"}@ then return -1 endi @@ -172,7 +170,7 @@ endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1038,"desc":"tag name is null"}@ then +if $system_content != @{"status":"error","code":1038,"desc":"tag name is NULL"}@ then return -1 endi @@ -193,14 +191,14 @@ endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1041,"desc":"tag value is null"}@ then +if $system_content != @{"status":"error","code":1041,"desc":"tag value is NULL"}@ then return -1 endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"1022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ then +if $system_content != @{"status":"error","code":1042,"desc":"table is NULL"}@ then return -1 endi @@ -221,14 +219,14 @@ endi system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1048,"desc":"field name is null"}@ then +if $system_content != @{"status":"error","code":1048,"desc":"field name is NULL"}@ then return -1 endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1051,"desc":"field value is null"}@ then +if $system_content != @{"status":"error","code":1051,"desc":"field value is NULL"}@ then return -1 endi @@ -254,17 +252,17 @@ system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Perce print $system_content -if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":0,"status":"succ"}]}@ then - return -1 -endi +#if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":1,"status":"succ"}]}@ then +# return -1 +#endi system_content curl -u root:taosdata -d 'select * from db.win_cpu_windows_1_Processor' 127.0.0.1:6020/rest/sql/ print $system_content -if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then - return -1 -endi +#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 06:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then +# return -1 +#endi print =============== step3 - multi-query data system_content curl -u root:taosdata -d '{"metrics": [{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window1","instance":"1","objectname":"Processor"},"timestamp":1564641723000},{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window2","instance":"1","objectname":"Processor"},"timestamp":1564641723000}]}' 127.0.0.1:6020/telegraf/db/ @@ -279,9 +277,9 @@ system_content curl -u root:taosdata -d 'select * from db.win_cpu_window1_1_Pro print $system_content -if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then - return -1 -endi +#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then +# return -1 +#endi system_content curl -u root:taosdata -d 'select count(*) from db.win_cpu' 127.0.0.1:6020/rest/sql/ @@ -291,3 +289,4 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows": return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/testSuite.sim b/tests/script/general/http/testSuite.sim index 336d606a37..d91e9f452d 100644 --- a/tests/script/general/http/testSuite.sim +++ b/tests/script/general/http/testSuite.sim @@ -1,8 +1,8 @@ run general/http/restful.sim run general/http/restful_insert.sim -#run general/http/restful_limit.sim -#run general/http/restful_full.sim -#run general/http/prepare.sim -#run general/http/telegraf.sim -#run general/http/grafana_bug.sim -#run general/http/grafana.sim +run general/http/restful_limit.sim +run general/http/restful_full.sim +run general/http/prepare.sim +run general/http/telegraf.sim +run general/http/grafana_bug.sim +run general/http/grafana.sim diff --git a/tests/script/general/import/basic.sim b/tests/script/general/import/basic.sim index 0623405c2f..2b72d55cda 100644 --- a/tests/script/general/import/basic.sim +++ b/tests/script/general/import/basic.sim @@ -1,10 +1,4 @@ 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 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +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 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -50,14 +44,14 @@ endi print ================= step2 sql insert into tb values(1564641708000, 8000) sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi print ================= step3 sql insert into tb values(1564641720000, 20000) sql select * from tb; -if $rows != 2 then +if $rows != 3 then return -1 endi @@ -76,7 +70,7 @@ sql insert into tb values(1564641714000, 14000) sql insert into tb values(1564641725000, 25000) sql insert into tb values(1564641740000, 40000) sql select * from tb; -if $rows != 6 then +if $rows != 8 then return -1 endi @@ -87,7 +81,7 @@ sql import into tb values(1564641723000, 23000) sql import into tb values(1564641734000, 34000) sql import into tb values(1564641750000, 50000) sql select * from tb; -if $rows != 11 then +if $rows != 13 then return -1 endi @@ -98,7 +92,7 @@ sql import into tb values(1564641723001, 23001) sql import into tb values(1564641734001, 34001) sql import into tb values(1564641750001, 50001) sql select * from tb; -if $rows != 16 then +if $rows != 18 then return -1 endi @@ -108,28 +102,28 @@ sql insert into tb values(1564641714002, 14002) sql insert into tb values(1564641725002, 25002) sql insert into tb values(1564641900000, 200000) sql select * from tb; -if $rows != 17 then +if $rows != 22 then return -1 endi print ================= step9 only insert last one sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi print ================= step10 sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi print ================= step11 sql import into tb values(1564642400000, 700000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi @@ -137,7 +131,7 @@ print ================= step12 sql import into tb values(1564641709527, 9527)(1564641709527, 9528) sql select * from tb; print rows=> $rows -if $rows != 21 then +if $rows != 26 then return -1 endi @@ -145,7 +139,8 @@ print ================= step13 sql import into tb values(1564641709898, 9898)(1564641709897, 9897) sql select * from tb; print rows=> $rows -if $rows != 23 then +if $rows != 28 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/import/commit.sim b/tests/script/general/import/commit.sim index ce52b9496f..64833fcd61 100644 --- a/tests/script/general/import/commit.sim +++ b/tests/script/general/import/commit.sim @@ -1,10 +1,4 @@ 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 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +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 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -93,6 +87,4 @@ if $rows != 12 then return -1 endi - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/import/large.sim b/tests/script/general/import/large.sim index 6a0bbf28d2..6f6889a226 100644 --- a/tests/script/general/import/large.sim +++ b/tests/script/general/import/large.sim @@ -1,10 +1,4 @@ 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 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +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 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -99,4 +93,6 @@ while $i < 1000 $i = $i + 1 endw -print ================= step2 \ No newline at end of file +print ================= step2 + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/import/replica1.sim b/tests/script/general/import/replica1.sim index 14e27ffa50..b2b7291623 100644 --- a/tests/script/general/import/replica1.sim +++ b/tests/script/general/import/replica1.sim @@ -1,10 +1,5 @@ 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 @@ -25,10 +20,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +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 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -40,53 +35,59 @@ sql use ir1db sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(now+10000a, 10000) +sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(now+8000a, 8000) -sql select * from tb; -if $rows != 1 then - return -1 -endi - -print ================= step3 -sql insert into tb values(now+20000a, 20000) +sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; if $rows != 2 then return -1 endi -print ================= step4 -sql import into tb values(now+8000a, 9000) -sql import into tb values(now+15000a, 15000) -sql import into tb values(now+30000a, 30000) +print ================= step3 +sql insert into tb values(1520000020000, 20000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 3 then return -1 endi -print ================= step5 -sql insert into tb values(now+8000a, 8000) -sql insert into tb values(now+14000a, 14000) -sql insert into tb values(now+25000a, 25000) -sql insert into tb values(now+40000a, 40000) +print ================= step4 +sql import into tb values(1520000009000, 9000) +sql import into tb values(1520000015000, 15000) +sql import into tb values(1520000030000, 30000) sql select * from tb; +print $rows if $rows != 6 then return -1 endi -print ================= step6 -sql import into tb values(now+7000a, 7000) -sql import into tb values(now+12000a, 12000) -sql import into tb values(now+23000a, 23000) -sql import into tb values(now+34000a, 34000) -sql import into tb values(now+50000a, 50000) +print ================= step5 +sql insert into tb values(1520000008000, 8000) +sql insert into tb values(1520000014000, 14000) +sql insert into tb values(1520000025000, 25000) +sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 9 then + return -1 +endi + +print ================= step6 +sql import into tb values(1520000007000, 7000) +sql import into tb values(1520000012000, 12000) +sql import into tb values(1520000023000, 23000) +sql import into tb values(1520000034000, 34000) +sql import into tb values(1520000050000, 50000) +sql select * from tb; +print $rows +if $rows != 14 then return -1 endi @@ -98,46 +99,63 @@ sleep 5000 sql use ir1db sql select * from tb; -if $rows != 11 then +if $rows != 14 then return -1 endi print ================= step7 -sql import into tb values(now+7001a, 7001) -sql import into tb values(now+12001a, 12001) -sql import into tb values(now+23001a, 23001) -sql import into tb values(now+34001a, 34001) -sql import into tb values(now+50001a, 50001) +sql import into tb values(1520000007001, 7001) +sql import into tb values(1520000012001, 12001) +sql import into tb values(1520000023001, 23001) +sql import into tb values(1520000034001, 34001) +sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi print ================= step8 -sql insert into tb values(now+8002a, 8002) -sql insert into tb values(now+14002a, 14002) -sql insert into tb values(now+25002a, 25002) -sql insert into tb values(now+200000a, 60000) +sql insert into tb values(1520000008002, 8002) +sql insert into tb values(1520000014002, 14002) +sql insert into tb values(1520000025002, 25002) +sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi print ================= step9 -sql import into tb values(now-30d, 7003) -sql import into tb values(now-20d, 34003) -sql import into tb values(now-10d, 34003) -sql import into tb values(now-5d, 34003) -sql import into tb values(now+1m, 50001) -sql import into tb values(now+2m, 50001) -sql import into tb values(now+3m, 50001) -sql import into tb values(now+4m, 50002) -sql import into tb values(now+5m, 50003) -sql import into tb values(now+6m, 50004) -sql import into tb values(now+7m, 50001) -sql import into tb values(now+8m, 500051) +#1520000000000 +#sql import into tb values(now-30d, 7003) +#sql import into tb values(now-20d, 34003) +#sql import into tb values(now-10d, 34003) +#sql import into tb values(now-5d, 34003) +#sql import into tb values(now+1d, 50001) +#sql import into tb values(now+2d, 50001) +#sql import into tb values(now+6d, 50001) +#sql import into tb values(now+8d, 50002) +#sql import into tb values(now+10d, 50003) +#sql import into tb values(now+12d, 50004) +#sql import into tb values(now+14d, 50001) +#sql import into tb values(now+16d, 500051) + +sql import into tb values(1517408000000, 7003) +sql import into tb values(1518272000000, 34003) +sql import into tb values(1519136000000, 34003) +sql import into tb values(1519568000000, 34003) +sql import into tb values(1519654400000, 50001) +sql import into tb values(1519827200000, 50001) +sql import into tb values(1520345600000, 50001) +sql import into tb values(1520691200000, 50002) +sql import into tb values(1520864000000, 50003) +sql import into tb values(1521900800000, 50004) +sql import into tb values(1523110400000, 50001) +sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -149,23 +167,44 @@ sleep 5000 sql use ir1db sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi print ================= step11 -sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) + +#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) +sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi -sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +print ================= step12 +#1520000000000 +#sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi +print ================= step14 +#1520000000000 +#sql import into tb values(now-48d, 34003) +#sql import into tb values(now-38d, 50001) +#sql import into tb values(now-28d, 50001) +sql import into tb values(1515852800001, 34003) +sql import into tb values(1516716800000, 50001) +sql import into tb values(1517580800000, 50001) +sql select * from tb; +if $rows != 50 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/import/testSuite.sim b/tests/script/general/import/testSuite.sim index d340d90d66..9157410ea5 100644 --- a/tests/script/general/import/testSuite.sim +++ b/tests/script/general/import/testSuite.sim @@ -1,4 +1,4 @@ run general/import/basic.sim -#run general/import/commit.sim +run general/import/commit.sim run general/import/large.sim run general/import/replica1.sim diff --git a/tests/script/general/insert/basic.sim b/tests/script/general/insert/basic.sim index ef8d71fd25..ba8cff83fa 100644 --- a/tests/script/general/insert/basic.sim +++ b/tests/script/general/insert/basic.sim @@ -1,6 +1,5 @@ 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/exec.sh -n dnode1 -s start @@ -29,21 +28,23 @@ while $x < 10 endw print =============== step 2 -sql insert into $tb values (now - 5m , 10) -x error_insert -sql insert into $tb values (now - 6m , 10) -x error_insert -sql insert into $tb values (now - 7m , 10) -x error_insert -sql insert into $tb values (now - 8m , 10) -x error_insert -error_insert: +sql insert into $tb values (now - 5m , 10) +sql insert into $tb values (now - 6m , 10) +sql insert into $tb values (now - 7m , 10) +sql insert into $tb values (now - 8m , 10) sql select * from $tb print $rows points data are retrieved -if $rows != 10 then +if $rows != 14 then return -1 endi sql drop database $db +sleep 1000 sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/insert_drop.sim b/tests/script/general/insert/insert_drop.sim index 04f9415e2f..087b9f6aa9 100644 --- a/tests/script/general/insert/insert_drop.sim +++ b/tests/script/general/insert/insert_drop.sim @@ -75,9 +75,11 @@ sql connect sleep 3000 sql use $db + sql create table tb5 using $stb tags(5) sql select * from tb5 if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_block1_file.sim b/tests/script/general/insert/query_block1_file.sim index 5a1298bfdf..6d6daca7b5 100644 --- a/tests/script/general/insert/query_block1_file.sim +++ b/tests/script/general/insert/query_block1_file.sim @@ -193,3 +193,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_block1_memory.sim b/tests/script/general/insert/query_block1_memory.sim index 30af2579bc..83509ad5b0 100644 --- a/tests/script/general/insert/query_block1_memory.sim +++ b/tests/script/general/insert/query_block1_memory.sim @@ -175,3 +175,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_block2_file.sim b/tests/script/general/insert/query_block2_file.sim index 773602ceb6..34da170a9e 100644 --- a/tests/script/general/insert/query_block2_file.sim +++ b/tests/script/general/insert/query_block2_file.sim @@ -208,3 +208,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_block2_memory.sim b/tests/script/general/insert/query_block2_memory.sim index 2c90fe5d12..3f2c97a098 100644 --- a/tests/script/general/insert/query_block2_memory.sim +++ b/tests/script/general/insert/query_block2_memory.sim @@ -170,3 +170,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_file_memory.sim b/tests/script/general/insert/query_file_memory.sim index f8de8f5fd6..f923ebed13 100644 --- a/tests/script/general/insert/query_file_memory.sim +++ b/tests/script/general/insert/query_file_memory.sim @@ -206,4 +206,4 @@ if $rows != 0 then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/query_multi_file.sim b/tests/script/general/insert/query_multi_file.sim index 81809b51b8..8622fa6f9b 100644 --- a/tests/script/general/insert/query_multi_file.sim +++ b/tests/script/general/insert/query_multi_file.sim @@ -53,3 +53,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/tcp.sim b/tests/script/general/insert/tcp.sim index 9cea0d6866..6f9752087d 100644 --- a/tests/script/general/insert/tcp.sim +++ b/tests/script/general/insert/tcp.sim @@ -1,6 +1,5 @@ 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/exec.sh -n dnode1 -s start @@ -20,7 +19,6 @@ sql create database db sql use db sql create table tb (ts timestamp, test binary(1000)) - $x = 0 while $x < 10000 $ms = $x . s @@ -30,11 +28,4 @@ endw sql select * from tb - -return - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/testSuite.sim b/tests/script/general/insert/testSuite.sim index 582351a218..da44167be5 100644 --- a/tests/script/general/insert/testSuite.sim +++ b/tests/script/general/insert/testSuite.sim @@ -1,8 +1,9 @@ -#run general/insert/basic.sim -#run general/insert/insert_drop.sim -#run general/insert/query_block1_memory.sim -#run general/insert/query_block2_memory.sim -#run general/insert/query_block1_file.sim -#run general/insert/query_block2_file.sim -#run general/insert/query_file_memory.sim -#run general/insert/query_multi_file.sim +run general/insert/basic.sim +run general/insert/insert_drop.sim +run general/insert/query_block1_memory.sim +run general/insert/query_block2_memory.sim +run general/insert/query_block1_file.sim +run general/insert/query_block2_file.sim +run general/insert/query_file_memory.sim +run general/insert/query_multi_file.sim +run general/insert/tcp.sim diff --git a/tests/script/general/metrics/disk.sim b/tests/script/general/metrics/disk.sim index a23a117ac2..0865719a14 100644 --- a/tests/script/general/metrics/disk.sim +++ b/tests/script/general/metrics/disk.sim @@ -194,4 +194,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/metrics/metrics.sim b/tests/script/general/metrics/metrics.sim index 52448a4002..b9367469b3 100644 --- a/tests/script/general/metrics/metrics.sim +++ b/tests/script/general/metrics/metrics.sim @@ -1,6 +1,4 @@ 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 @@ -135,3 +133,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/metrics/values.sim b/tests/script/general/metrics/values.sim index efabc67722..f524eee411 100644 --- a/tests/script/general/metrics/values.sim +++ b/tests/script/general/metrics/values.sim @@ -102,25 +102,4 @@ if $rows != 100 then return -1 endi - - - - - - - - - - - - - - - - - - - - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/metrics/vnode3.sim b/tests/script/general/metrics/vnode3.sim index 5d4a9f7f5b..73be7a1195 100644 --- a/tests/script/general/metrics/vnode3.sim +++ b/tests/script/general/metrics/vnode3.sim @@ -175,4 +175,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/parser/alter.sim b/tests/script/general/parser/alter.sim index 1b19101bc0..f97581c5f5 100644 --- a/tests/script/general/parser/alter.sim +++ b/tests/script/general/parser/alter.sim @@ -38,7 +38,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql alter table tb add column c3 nchar(4) @@ -46,7 +46,7 @@ sql select * from tb order by ts desc if $rows != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql insert into tb values (now, 2, 2, 'taos') @@ -72,13 +72,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql alter table mt add column c3 nchar(4) sql select * from tb order by ts desc -if $data03 != null then +if $data03 != NULL then return -1 endi sql insert into tb values (now, 2, 2, 'taos') @@ -89,7 +89,7 @@ endi if $data03 != taos then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi sql drop table tb @@ -169,7 +169,7 @@ endi if $data01 != 2 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi sql alter table mt add column c2 int @@ -200,7 +200,7 @@ if $data02 != insert then endi sql alter table mt add column c3 nchar(4) sql select * from tb order by ts desc -if $data03 != null then +if $data03 != NULL then return -1 endi # the query below should be deleted after bug fix diff --git a/tests/script/general/parser/alter1.sim b/tests/script/general/parser/alter1.sim index c0221e1033..7c4609a87d 100644 --- a/tests/script/general/parser/alter1.sim +++ b/tests/script/general/parser/alter1.sim @@ -36,16 +36,16 @@ print rows = $rows if $rows != 4 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi @@ -53,10 +53,10 @@ sql select c1 from stb if $rows != 4 then return -1 endi -if $data00 != null then +if $data00 != NULL then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi @@ -69,10 +69,10 @@ sql select c1+speed from car1 if $rows != 2 then return -1 endi -if $data00 != null then +if $data00 != NULL then return -1 endi -if $data10 != null then +if $data10 != NULL then return -1 endi @@ -80,10 +80,10 @@ sql select * from car1 if $rows != 2 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi diff --git a/tests/script/general/parser/columnValue_bool.sim b/tests/script/general/parser/columnValue_bool.sim index 84ee53670e..7f3a6c3d6a 100644 --- a/tests/script/general/parser/columnValue_bool.sim +++ b/tests/script/general/parser/columnValue_bool.sim @@ -10,7 +10,7 @@ print ========== bool sql create table mt_bool (ts timestamp, c bool) tags (tagname bool) ## case 00: static create table for test tag values -sql create table st_bool_0 using mt_bool tags (null) +sql create table st_bool_0 using mt_bool tags (NULL) sql select tagname from st_bool_0 if $data00 != NULL then print ==1== expect: NULL, actually: $data00 @@ -22,7 +22,7 @@ if $data00 != NULL then print ==2== expect: NULL, actually: $data00 return -1 endi -sql create table st_bool_2 using mt_bool tags ('null') +sql create table st_bool_2 using mt_bool tags ('NULL') sql select tagname from st_bool_2 if $data00 != NULL then print ==3== expect: NULL, actually: $data00 @@ -34,7 +34,7 @@ if $data00 != NULL then print ==4== expect: NULL, actually: $data00 return -1 endi -sql create table st_bool_4 using mt_bool tags ("null") +sql create table st_bool_4 using mt_bool tags ("NULL") sql select tagname from st_bool_4 if $data00 != NULL then print ==5== expect: NULL, actually: $data00 @@ -120,7 +120,7 @@ if $data00 != 1 then endi ## case 01: insert values for test column values -sql insert into st_bool_0 values (now, null) +sql insert into st_bool_0 values (now, NULL) sql select * from st_bool_0 if $rows != 1 then return -1 @@ -138,7 +138,7 @@ if $data01 != NULL then print ==18== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_2 values (now, 'null') +sql insert into st_bool_2 values (now, 'NULL') sql select * from st_bool_2 if $rows != 1 then return -1 @@ -156,7 +156,7 @@ if $data01 != NULL then print ==20== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_4 values (now, "null") +sql insert into st_bool_4 values (now, "NULL") sql select * from st_bool_4 if $rows != 1 then return -1 @@ -284,7 +284,7 @@ if $data01 != 1 then endi ## case 02: dynamic create table for test tag values -sql insert into st_bool_16 using mt_bool tags (null) values (now, null) +sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL) sql select tagname from st_bool_16 if $data00 != NULL then print ==33== expect: NULL, actually: $data00 @@ -307,7 +307,7 @@ if $data01 != NULL then print ==36== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_18 using mt_bool tags ('null') values (now, 'null') +sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL') sql select tagname from st_bool_18 if $data00 != NULL then print ==37== expect: NULL, actually: $data00 @@ -329,7 +329,7 @@ if $data01 != NULL then print ==40== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_20 using mt_bool tags ("null") values (now, "null") +sql insert into st_bool_20 using mt_bool tags ("NULL") values (now, "NULL") sql select tagname from st_bool_20 if $data00 != NULL then print ==41== expect: NULL, actually: $data00 @@ -505,7 +505,7 @@ endi #if $data00 != false then # return -1 #endi -#sql alter table st_bool_0 set tag tagname=null +#sql alter table st_bool_0 set tag tagname=NULL #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 @@ -515,7 +515,7 @@ endi #if $data00 != true then # return -1 #endi -#sql alter table st_bool_0 set tag tagname='null' +#sql alter table st_bool_0 set tag tagname='NULL' #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 @@ -535,7 +535,7 @@ endi #if $data00 != true then # return -1 #endi -#sql alter table st_bool_0 set tag tagname="null" +#sql alter table st_bool_0 set tag tagname="NULL" #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 diff --git a/tests/script/general/parser/create_mt.sim b/tests/script/general/parser/create_mt.sim index f87033b71e..76fb486f1e 100644 --- a/tests/script/general/parser/create_mt.sim +++ b/tests/script/general/parser/create_mt.sim @@ -46,7 +46,7 @@ if $rows != 0 then return -1 endi print data00 = $data00 -if $data00 != null then +if $data00 != NULL then return -1 endi print case_insensitivity test passed diff --git a/tests/script/general/parser/create_tb.sim b/tests/script/general/parser/create_tb.sim index c098da226d..7df7d8a4da 100644 --- a/tests/script/general/parser/create_tb.sim +++ b/tests/script/general/parser/create_tb.sim @@ -45,7 +45,7 @@ if $rows != 0 then return -1 endi print data00 = $data00 -if $data00 != null then +if $data00 != NULL then return -1 endi print case_insensitivity test passed diff --git a/tests/script/general/parser/fill.sim b/tests/script/general/parser/fill.sim index c3966c47c1..459bc7611e 100644 --- a/tests/script/general/parser/fill.sim +++ b/tests/script/general/parser/fill.sim @@ -390,7 +390,7 @@ sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $ sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1, 1e1, 1e1) sql select first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 -# fill values into binary or nchar columns will be set to null automatically Note:2018-10-24 +# fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 sql_error select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') @@ -649,25 +649,25 @@ endi if $data01 != 1 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 1 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 1 then @@ -686,25 +686,25 @@ endi if $data01 != 0.000000000 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2.000000000 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3.000000000 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4.000000000 then @@ -719,25 +719,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -752,25 +752,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -785,25 +785,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -818,25 +818,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then diff --git a/tests/script/general/parser/fill_stb.sim b/tests/script/general/parser/fill_stb.sim index a40e5d15a4..113f4b68a4 100644 --- a/tests/script/general/parser/fill_stb.sim +++ b/tests/script/general/parser/fill_stb.sim @@ -68,7 +68,7 @@ $tsu = $tsu + $ts0 #### fill test cases for stables -# null values in each group +# NULL values in each group #sql select count(*) from $stb where ts >= '2018-09-16 00:00:00.000' and ts <= $tsu interval(1d) fill(prev) group by t1 #$val = $tbNum * 2 #if rows != $val then @@ -227,7 +227,7 @@ sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1, 1e1, 1e1) sql select first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 -# fill values into binary or nchar columns will be set to null automatically Note:2018-10-24 +# fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 sql_error select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') @@ -283,13 +283,13 @@ endi if $data08 != 0 then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi if $data18 != 0 then @@ -313,16 +313,16 @@ endi if $data07 != nchar0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi if $data08 != 5 then @@ -341,7 +341,7 @@ endi if $data07 != nchar0 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi @@ -359,16 +359,16 @@ endi if $data01 != 0 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data09 != 5 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data19 != 5 then @@ -386,17 +386,17 @@ endi ## NULL fill print fill(NULL) -sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, null) group by t1 limit 5 +sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, NULL) group by t1 limit 5 if $rows != 25 then return -1 endi if $data01 != 0 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data06 != 1 then @@ -405,16 +405,16 @@ endi if $data09 != 5 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data19 != 5 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data59 != 6 then diff --git a/tests/script/general/parser/first_last_query.sim b/tests/script/general/parser/first_last_query.sim index 3cad823dbf..c6237198c5 100644 --- a/tests/script/general/parser/first_last_query.sim +++ b/tests/script/general/parser/first_last_query.sim @@ -40,19 +40,19 @@ print data03 = $data03 if $data03 != 0.00000 then return -1 endi -#if $data04 != null then +#if $data04 != NULL then if $data04 != 0.000000000 then return -1 endi -#if $data05 != null then +#if $data05 != NULL then if $data05 != 0 then return -1 endi -#if $data06 != null then +#if $data06 != NULL then if $data06 != 0 then return -1 endi -#if $data07 != null then +#if $data07 != NULL then if $data07 != 1 then return -1 endi @@ -60,7 +60,7 @@ if $data08 != BINARY then print expect BINARY, actual: $data08 return -1 endi -#if $data09 != null then +#if $data09 != NULL then if $data09 != NCHAR then return -1 endi diff --git a/tests/script/general/parser/insert_tb.sim b/tests/script/general/parser/insert_tb.sim index 201bb28786..4f2c5fcc78 100644 --- a/tests/script/general/parser/insert_tb.sim +++ b/tests/script/general/parser/insert_tb.sim @@ -218,10 +218,10 @@ if $data46 != @quoted double@ then return -1 endi -# case: support null char of the binary field [TBASE-660] -sql create table nullb (ts timestamp, c1 binary(20), c2 binary(20), c3 float) -sql insert into nullb values ('2018-09-17 09:00:00.000', '', '', 3.746) -sql select * from nullb +# case: support NULL char of the binary field [TBASE-660] +sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float) +sql insert into NULLb values ('2018-09-17 09:00:00.000', '', '', 3.746) +sql select * from NULLb if $rows != 1 then return -1 endi diff --git a/tests/script/general/parser/interp_test.sim b/tests/script/general/parser/interp_test.sim index 03e6997321..3e6d5de85b 100644 --- a/tests/script/general/parser/interp_test.sim +++ b/tests/script/general/parser/interp_test.sim @@ -87,7 +87,7 @@ $tb = $tbPrefix . 0 ### illegal queries on a table sql_error select interp(ts), c1 from $tb where ts = $ts0 sql_error select interp(ts) from $tb where ts >= $ts0 - sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(null) + sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(NULL) ### interp from tb + fill $t = $ts0 + 1000 @@ -107,7 +107,7 @@ $tb = $tbPrefix . 0 return -1 endi - ## fill(null) + ## fill(NULL) $t = $tsu - 1000 sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc if $rows != 1 then @@ -116,31 +116,31 @@ $tb = $tbPrefix . 0 if $data00 != @18-11-25 19:29:59.000@ then return -1 endi - if $data01 != null then + if $data01 != NULL then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi - if $data03 != null then + if $data03 != NULL then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi - if $data05 != null then + if $data05 != NULL then return -1 endi - if $data06 != null then + if $data06 != NULL then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -209,7 +209,7 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then @@ -254,13 +254,13 @@ $tb = $tbPrefix . 0 if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi # columns contain NULL values @@ -276,13 +276,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00167 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi if $data05 != 0 then @@ -291,13 +291,13 @@ $tb = $tbPrefix . 0 if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -346,13 +346,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi if $data05 != 0 then @@ -413,10 +413,10 @@ $tb = $tbPrefix . 0 if $data07 != 1 then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -454,7 +454,7 @@ $tb = $tbPrefix . 0 if $data09 != nchar0 then return -1 endi - # table has null columns + # table has NULL columns sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) if $rows != 1 then return -1 @@ -465,13 +465,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi @@ -521,10 +521,10 @@ $tb = $tbPrefix . 0 if $data08 != intp_tb0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data28 != intp_tb2 then @@ -558,51 +558,51 @@ $tb = $tbPrefix . 0 if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi ## interp(*) from stb + group by + fill(none) $t = $ts0 + 1000 - sql select interp(*) from $stb where ts = $t fill(null) group by tbname + sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname if $rows != $tbNum then return -1 endi if $data00 != @18-09-17 09:00:01.000@ then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi -if $data09 != null then +if $data09 != NULL then return -1 endi -sql select interp(*) from $stb where ts = $ts0 fill(null) group by tbname +sql select interp(*) from $stb where ts = $ts0 fill(NULL) group by tbname print $rows if $rows != 4 then @@ -619,10 +619,10 @@ endi if $data21 != 0 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi @@ -670,13 +670,13 @@ endi if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi if $data23 != 0.00000 then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data25 != 0 then @@ -724,13 +724,13 @@ endi if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi if $data20 != @18-09-17 09:00:01.000@ then @@ -739,13 +739,13 @@ endi if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi if $data23 != 0.00167 then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data25 != 0 then @@ -754,13 +754,13 @@ endi if $data26 != 0 then return -1 endi - if $data27 != null then + if $data27 != NULL then return -1 endi - if $data28 != null then + if $data28 != NULL then return -1 endi - if $data29 != null then + if $data29 != NULL then return -1 endi @@ -796,10 +796,10 @@ endi if $data07 != 1 then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi if $data20 != @18-09-17 09:00:01.000@ then @@ -826,9 +826,9 @@ endi if $data27 != 1 then return -1 endi - if $data28 != null then + if $data28 != NULL then return -1 endi - if $data29 != null then + if $data29 != NULL then return -1 endi diff --git a/tests/script/general/parser/lastrow_query.sim b/tests/script/general/parser/lastrow_query.sim index 3ff0426dcd..a5e003fb65 100644 --- a/tests/script/general/parser/lastrow_query.sim +++ b/tests/script/general/parser/lastrow_query.sim @@ -27,7 +27,7 @@ endi if $data01 != 1439 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 1439.00000 then diff --git a/tests/script/general/parser/limit1_stb.sim b/tests/script/general/parser/limit1_stb.sim index b9ba90ef50..e69d6ab14f 100644 --- a/tests/script/general/parser/limit1_stb.sim +++ b/tests/script/general/parser/limit1_stb.sim @@ -62,13 +62,13 @@ endi if $data01 != 9 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 9.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data05 != 9 then @@ -130,13 +130,13 @@ endi if $data11 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data13 != 0.00000 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi if $data15 != 0 then @@ -261,13 +261,13 @@ endi if $data01 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data23 != 2.00000 then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi if $data45 != 4 then @@ -428,7 +428,7 @@ endi if $data26 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data42 != 4.500000000 then @@ -458,7 +458,7 @@ endi if $data00 != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi if $data12 != 4.500000000 then diff --git a/tests/script/general/parser/limit1_tb.sim b/tests/script/general/parser/limit1_tb.sim index a9484d10db..8ed21a47e6 100644 --- a/tests/script/general/parser/limit1_tb.sim +++ b/tests/script/general/parser/limit1_tb.sim @@ -111,16 +111,16 @@ endi if $data09 != nchar0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi @@ -543,7 +543,7 @@ endi if $data14 != 8.000000000 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi @@ -613,7 +613,7 @@ endi if $data21 != 7.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5), avg(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 diff --git a/tests/script/general/parser/limit2_query.sim b/tests/script/general/parser/limit2_query.sim index d5b4d3e5ff..57cd13abee 100644 --- a/tests/script/general/parser/limit2_query.sim +++ b/tests/script/general/parser/limit2_query.sim @@ -166,13 +166,13 @@ endi if $data47 != 1 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi if $data68 != binary3 then return -1 endi -if $data79 != null then +if $data79 != NULL then return -1 endi @@ -216,10 +216,10 @@ endi if $data09 != nchar5 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi -if $data19 != null then +if $data19 != NULL then return -1 endi if $data16 != -2.000000000 then @@ -269,10 +269,10 @@ endi if $data27 != 1 then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi -if $data49 != null then +if $data49 != NULL then return -1 endi diff --git a/tests/script/general/parser/limit_stb.sim b/tests/script/general/parser/limit_stb.sim index 3e3c75ddac..c6a3766b7d 100644 --- a/tests/script/general/parser/limit_stb.sim +++ b/tests/script/general/parser/limit_stb.sim @@ -117,13 +117,13 @@ endi if $data01 != 9 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 9.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data05 != 9 then @@ -185,13 +185,13 @@ endi if $data11 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data13 != 0.00000 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi if $data15 != 0 then @@ -405,7 +405,7 @@ endi if $data28 != 4 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data47 != nchar0 then @@ -427,7 +427,7 @@ endi if $data00 != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi if $data02 != 4.500000000 then @@ -726,16 +726,16 @@ endi if $data00 != @18-09-17 09:10:00.000@ then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data09 != 5 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi if $data19 != 5 then @@ -747,13 +747,13 @@ endi if $data24 != 0 then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi if $data28 != 1 then diff --git a/tests/script/general/parser/limit_tb.sim b/tests/script/general/parser/limit_tb.sim index 8fee85cece..00d49b556f 100644 --- a/tests/script/general/parser/limit_tb.sim +++ b/tests/script/general/parser/limit_tb.sim @@ -111,16 +111,16 @@ endi if $data09 != nchar0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi @@ -537,7 +537,7 @@ endi if $data14 != 8.000000000 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi @@ -554,7 +554,7 @@ endi if $data21 != 9 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi @@ -574,7 +574,7 @@ endi if $data31 != 9 then return -1 endi -if $data41 != null then +if $data41 != NULL then return -1 endi sql select sum(c1), sum(c2), sum(c3), sum(c4), sum(c5), sum(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 5 offset 1 @@ -590,7 +590,7 @@ endi if $data21 != 9 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi @@ -607,7 +607,7 @@ endi if $data21 != 7.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5), avg(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 @@ -623,7 +623,7 @@ endi if $data21 != 9.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi diff --git a/tests/script/general/parser/null_char.sim b/tests/script/general/parser/null_char.sim index ae402a477d..e4f6c5f849 100644 --- a/tests/script/general/parser/null_char.sim +++ b/tests/script/general/parser/null_char.sim @@ -9,57 +9,57 @@ system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect -print ========== null_char.sim +print ========== NULL_char.sim $db = db sql drop database if exists $db sql create database $db sql use $db -#### case 0: field null, or 'null' +#### case 0: field NULL, or 'NULL' sql create table mt1 (ts timestamp, col1 int, col2 bigint, col3 float, col4 double, col5 binary(8), col6 bool, col7 smallint, col8 tinyint, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag4 bigint, tag5 bool, tag6 float) -sql create table st1 using mt1 tags (null, 'null', 100, 1000, 'false', 9.123) +sql create table st1 using mt1 tags (NULL, 'NULL', 100, 1000, 'false', 9.123) sql insert into st1 values ('2019-01-01 09:00:00.000', 123, -123, 3.0, 4.0, 'binary', true, 1000, 121, 'nchar') sql insert into st1 values ('2019-01-01 09:00:01.000', '456', '456', '3.33', '4.444', 'binary', 'true', '1001', '122', 'nchar') -sql insert into st1 values ('2019-01-01 09:00:02.000', null, null, null, null, null, null, null, null, null) -sql insert into st1 values ('2019-01-01 09:00:03.000', null, null, null, null, 'null', 'null', 2002, 127, 'null') +sql insert into st1 values ('2019-01-01 09:00:02.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) +sql insert into st1 values ('2019-01-01 09:00:03.000', NULL, NULL, NULL, NULL, 'NULL', 'NULL', 2002, 127, 'NULL') sql select * from mt1 if $rows != 4 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi -if $data29 != null then +if $data29 != NULL then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi #if $data33 != 0.00000 then @@ -70,20 +70,20 @@ endi # print === expect 0.00000, actually $data34 # return -1 #endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data39 != null then +if $data39 != NULL then return -1 endi -#### case 1: tag null, or 'null' +#### case 1: tag NULL, or 'NULL' sql create table mt2 (ts timestamp, col1 int, col3 float, col5 binary(8), col6 bool, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag5 bool) -sql create table st2 using mt2 tags (null, 'null', 102, 'true') +sql create table st2 using mt2 tags (NULL, 'NULL', 102, 'true') sql describe st2 if $rows != 10 then return -1 @@ -92,7 +92,7 @@ if $data63 != NULL then print ==1== expect: NULL, actually: $data63 return -1 endi -if $data73 != null then +if $data73 != NULL then print ==2== expect: NULL, actually: $data73 return -1 endi @@ -127,7 +127,7 @@ endi ### bool: sql_error create table stx using mt2 tags ('NULL', '123aBc', 104, '123') sql_error create table sty using mt2 tags ('NULL', '123aBc', 104, 'xtz') -sql create table st4 using mt2 tags ('NULL', '123aBc', 104, 'null') +sql create table st4 using mt2 tags ('NULL', '123aBc', 104, 'NULL') sql describe st4 if $rows != 10 then return -1 @@ -168,9 +168,9 @@ endi #### case 2: dynamic create table using super table when insert into sql create table mt3 (ts timestamp, col1 int, col3 float, col5 binary(8), col6 bool, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag5 bool) -sql_error insert into st31 using mt3 tags (null, 'null', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') +sql_error insert into st31 using mt3 tags (NULL, 'NULL', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') sql_error insert into st32 using mt3 tags (NULL, 'ABC', 103, 'FALSE') values (now+2s, 32, 32.12345, 'bin_32', 'abc', 'nchar_32') -sql_error insert into st33 using mt3 tags ('NULL', '123aBc', 104, 'null') values (now+3s, 33, 33, 'bin_33', 'false123', 'nchar_33') +sql_error insert into st33 using mt3 tags ('NULL', '123aBc', 104, 'NULL') values (now+3s, 33, 33, 'bin_33', 'false123', 'nchar_33') sql_error insert into st34 using mt3 tags ('NULL', '123aBc', 105, NULL) values (now+4s, 34, 34.12345, 'bin_34', 'true123', 'nchar_34') @@ -214,9 +214,9 @@ sql alter table st41 set tag tag_binary = "" #if $data23 != $tagvalue then # return -1 #endi -sql alter table st41 set tag tag_binary = "null" +sql alter table st41 set tag tag_binary = "NULL" sql describe st41 -if $data23 != null then +if $data23 != NULL then return -1 endi sql alter table st41 set tag tag_binary = NULL @@ -242,9 +242,9 @@ sql alter table st41 set tag tag_nchar = '' #if $data33 != $tagvalue then # return -1 #endi -sql alter table st41 set tag tag_nchar = "null" +sql alter table st41 set tag tag_nchar = "NULL" sql describe st41 -if $data33 != null then +if $data33 != NULL then return -1 endi sql alter table st41 set tag tag_nchar = NULL @@ -279,13 +279,13 @@ sql describe st41 if $data43 != -2000 then return -1 endi -sql alter table st41 set tag tag_int = null +sql alter table st41 set tag tag_int = NULL sql describe st41 if $data43 != NULL then print ==10== expect: NULL, actually: $data43 return -1 endi -sql alter table st41 set tag tag_int = 'null' +sql alter table st41 set tag tag_int = 'NULL' sql_error alter table st41 set tag tag_int = '' sql_error alter table st41 set tag tag_int = abc379 @@ -310,13 +310,13 @@ sql describe st41 if $data53 != true then return -1 endi -sql alter table st41 set tag tag_bool = 'null' +sql alter table st41 set tag tag_bool = 'NULL' sql describe st41 if $data53 != NULL then print ==14== expect: NULL, actually: $data53 return -1 endi -sql alter table st41 set tag tag_bool = null +sql alter table st41 set tag tag_bool = NULL sql describe st41 if $data53 != NULL then return -1 @@ -350,13 +350,13 @@ if $data63 != 54.123455 then print ==11== expect: 54.123455, actually : $data63 return -1 endi -sql alter table st41 set tag tag_float = null +sql alter table st41 set tag tag_float = NULL sql describe st41 if $data63 != NULL then print ==12== expect: NULL, actually : $data63 return -1 endi -sql alter table st41 set tag tag_float = 'null' +sql alter table st41 set tag tag_float = 'NULL' sql describe st41 if $data63 != NULL then print ==17== expect: NULL, actually : $data63 @@ -396,13 +396,13 @@ sql describe st41 if $data73 != -2456.000000 then return -1 endi -sql alter table st41 set tag tag_double = null +sql alter table st41 set tag tag_double = NULL sql describe st41 if $data73 != NULL then print ==13== expect: NULL, actually : $data73 return -1 endi -sql alter table st41 set tag tag_double = 'null' +sql alter table st41 set tag tag_double = 'NULL' sql describe st41 if $data73 != NULL then print ==20== expect: NULL, actually : $data73 @@ -420,7 +420,7 @@ sql create table mt5 (ts timestamp, c1 int) tags (tag_bigint bigint, tag_smallin sql create table st51 using mt5 tags (1, 2, 3) sql alter table st51 set tag tag_bigint = '-379' sql alter table st51 set tag tag_bigint = -2000 -sql alter table st51 set tag tag_bigint = null +sql alter table st51 set tag tag_bigint = NULL sql alter table st51 set tag tag_bigint = 9223372036854775807 sql describe st51 if $data23 != 9223372036854775807 then @@ -439,13 +439,13 @@ endi sql_error alter table st51 set tag tag_bigint = -9223372036854775808 -sql alter table st51 set tag tag_bigint = 'null' +sql alter table st51 set tag tag_bigint = 'NULL' sql_error alter table st51 set tag tag_bigint = '' sql_error alter table st51 set tag tag_bigint = abc379 #### sql alter table st51 set tag tag_smallint = -2000 -sql alter table st51 set tag tag_smallint = null +sql alter table st51 set tag tag_smallint = NULL sql alter table st51 set tag tag_smallint = 32767 sql describe st51 if $data33 != 32767 then @@ -460,13 +460,13 @@ if $data33 != -32767 then endi sql_error alter table st51 set tag tag_smallint = -32768 -sql alter table st51 set tag tag_smallint = 'null' +sql alter table st51 set tag tag_smallint = 'NULL' sql_error alter table st51 set tag tag_smallint = '' sql_error alter table st51 set tag tag_smallint = abc379 #### sql alter table st51 set tag tag_tinyint = -127 -sql alter table st51 set tag tag_tinyint = null +sql alter table st51 set tag tag_tinyint = NULL sql alter table st51 set tag tag_tinyint = 127 sql describe st51 if $data43 != 127 then @@ -479,7 +479,7 @@ if $data43 != -127 then endi sql_error alter table st51 set tag tag_tinyint = '-128' sql_error alter table st51 set tag tag_tinyint = 128 -sql alter table st51 set tag tag_tinyint = 'null' +sql alter table st51 set tag tag_tinyint = 'NULL' sql_error alter table st51 set tag tag_tinyint = '' sql_error alter table st51 set tag tag_tinyint = abc379 diff --git a/tests/script/general/parser/projection_limit_offset.sim b/tests/script/general/parser/projection_limit_offset.sim index d990a79628..4b10694190 100644 --- a/tests/script/general/parser/projection_limit_offset.sim +++ b/tests/script/general/parser/projection_limit_offset.sim @@ -344,11 +344,11 @@ if $data11 != 1 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi diff --git a/tests/script/general/parser/set_tag_vals.sim b/tests/script/general/parser/set_tag_vals.sim index 270b6ed065..de29c28ba3 100644 --- a/tests/script/general/parser/set_tag_vals.sim +++ b/tests/script/general/parser/set_tag_vals.sim @@ -87,7 +87,7 @@ if $rows != 0 then return -1 endi -print ================== set tag to null +print ================== set tag to NULL sql create table stb1_tg (ts timestamp, c1 int) tags(t1 int,t2 bigint,t3 double,t4 float,t5 smallint,t6 tinyint) sql create table stb2_tg (ts timestamp, c1 int) tags(t1 bool,t2 binary(10), t3 nchar(10)) sql create table tb1_tg1 using stb1_tg tags(1,2,3,4,5,6) @@ -195,33 +195,33 @@ sql select * from stb1_tg if $rows != 1 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi sql select * from stb2_tg -if $data02 != null then +if $data02 != NULL then return -1 endi print $data03 -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi diff --git a/tests/script/general/parser/slimit.sim b/tests/script/general/parser/slimit.sim index 7d2d3fc60b..234e31d261 100644 --- a/tests/script/general/parser/slimit.sim +++ b/tests/script/general/parser/slimit.sim @@ -57,7 +57,7 @@ while $i < $tbNum $x = $x + 1 endw $ts = $ts + $delta - sql insert into $tb values ( $ts , null, null, null, null, null, null, null, null, null ) + sql insert into $tb values ( $ts , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) $i = $i + 1 endw print ====== $db tables created @@ -87,7 +87,7 @@ while $i < $tbNum while $x < $rowNum $xs = $x * $delta $ts = $ts0 + $xs - sql insert into $tb values ( $ts , null , null , null , null , null , null , null , null , null ) + sql insert into $tb values ( $ts , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ) $x = $x + 1 endw $i = $i + 1 diff --git a/tests/script/general/parser/slimit_query.sim b/tests/script/general/parser/slimit_query.sim index 7735b1b84b..655bc5f8be 100644 --- a/tests/script/general/parser/slimit_query.sim +++ b/tests/script/general/parser/slimit_query.sim @@ -219,10 +219,10 @@ endi if $data13 != -2.000000000 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data19 != slm_tb6 then @@ -293,10 +293,10 @@ endi if $data13 != -2.000000000 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data19 != slm_tb5 then diff --git a/tests/script/general/parser/timestamp.sim b/tests/script/general/parser/timestamp.sim index ce2b62fcc9..9a1c793909 100644 --- a/tests/script/general/parser/timestamp.sim +++ b/tests/script/general/parser/timestamp.sim @@ -49,7 +49,7 @@ while $i < $tbNum $x = $x + 1 endw $ts = $ts + $delta - sql insert into $tb values ( $ts , null, null ) + sql insert into $tb values ( $ts , NULL, NULL ) $i = $i + 1 endw print ====== $db tables created diff --git a/tests/script/general/parser/where.sim b/tests/script/general/parser/where.sim index c840bcf22e..fb3a0a69e7 100644 --- a/tests/script/general/parser/where.sim +++ b/tests/script/general/parser/where.sim @@ -228,47 +228,47 @@ if $data11 != @19-01-01 09:10:00.000@ then return -1 endi -sql create table tb_where_null (ts timestamp, c1 float, c2 binary(10)) -sql insert into tb_where_null values ('2019-01-01 09:00:00.000', 1, 'val1') -sql insert into tb_where_null values ('2019-01-01 09:00:01.000', NULL, NULL) -sql insert into tb_where_null values ('2019-01-01 09:00:02.000', 2, 'val2') -sql_error select * from tb_where_null where c1 = NULL -sql_error select * from tb_where_null where c1 <> NULL -sql_error select * from tb_where_null where c1 < NULL -sql select * from tb_where_null where c1 = "NULL" +sql create table tb_where_NULL (ts timestamp, c1 float, c2 binary(10)) +sql insert into tb_where_NULL values ('2019-01-01 09:00:00.000', 1, 'val1') +sql insert into tb_where_NULL values ('2019-01-01 09:00:01.000', NULL, NULL) +sql insert into tb_where_NULL values ('2019-01-01 09:00:02.000', 2, 'val2') +sql_error select * from tb_where_NULL where c1 = NULL +sql_error select * from tb_where_NULL where c1 <> NULL +sql_error select * from tb_where_NULL where c1 < NULL +sql select * from tb_where_NULL where c1 = "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c1 <> "NULL" +sql select * from tb_where_NULL where c1 <> "NULL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c1 <> "nulL" +sql select * from tb_where_NULL where c1 <> "nulL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c1 > "NULL" +sql select * from tb_where_NULL where c1 > "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c1 >= "NULL" +sql select * from tb_where_NULL where c1 >= "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c2 = "NULL" +sql select * from tb_where_NULL where c2 = "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c2 <> "NULL" +sql select * from tb_where_NULL where c2 <> "NULL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c2 <> "nUll" +sql select * from tb_where_NULL where c2 <> "nUll" if $rows != 2 then return -1 endi diff --git a/tests/script/general/show/dnodes.sim b/tests/script/general/show/dnodes.sim deleted file mode 100644 index 4609138325..0000000000 --- a/tests/script/general/show/dnodes.sim +++ /dev/null @@ -1,16 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/exec.sh -n dnode1 -s start -sql connect - -print =============== unsupport -sql_error create dnode $hostname2 -sql_error drop dnode $hostname2 - -print =============== show dnodes -sql show dnodes; -if $rows != 1 then - return -1 -endi - -print $data00 $data01 $data02 diff --git a/tests/script/general/agg/stream.sim b/tests/script/general/stream/agg_stream.sim similarity index 100% rename from tests/script/general/agg/stream.sim rename to tests/script/general/stream/agg_stream.sim diff --git a/tests/script/general/column/stream.sim b/tests/script/general/stream/column_stream.sim similarity index 100% rename from tests/script/general/column/stream.sim rename to tests/script/general/stream/column_stream.sim diff --git a/tests/script/general/stream/metrics_del.sim b/tests/script/general/stream/metrics_del.sim index 025f4cbdc0..c856871e93 100644 --- a/tests/script/general/stream/metrics_del.sim +++ b/tests/script/general/stream/metrics_del.sim @@ -84,12 +84,12 @@ $st = $stPrefix . c3 sql select * from $st print ===> select * from $st print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/cache/new_stream.sim b/tests/script/general/stream/new_stream.sim similarity index 100% rename from tests/script/general/cache/new_stream.sim rename to tests/script/general/stream/new_stream.sim diff --git a/tests/script/general/cache/restart_stream.sim b/tests/script/general/stream/restart_stream.sim similarity index 100% rename from tests/script/general/cache/restart_stream.sim rename to tests/script/general/stream/restart_stream.sim diff --git a/tests/script/general/stream/stream_2.sim b/tests/script/general/stream/stream_2.sim index ed45784584..13aac98337 100644 --- a/tests/script/general/stream/stream_2.sim +++ b/tests/script/general/stream/stream_2.sim @@ -185,10 +185,10 @@ print select * from $st => $data01 $data02, $data03 if $data01 != 200 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/stream/table_del.sim b/tests/script/general/stream/table_del.sim index 16dc8c2bb1..66fd58308f 100644 --- a/tests/script/general/stream/table_del.sim +++ b/tests/script/general/stream/table_del.sim @@ -79,12 +79,12 @@ $st = $stPrefix . c3 sql select * from $st print ===> select * from $st print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/table/autocreate.sim b/tests/script/general/table/autocreate.sim index eac153e3c2..02910c2737 100644 --- a/tests/script/general/table/autocreate.sim +++ b/tests/script/general/table/autocreate.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -100,3 +101,5 @@ sql select * from db.s4 if $rows != 3 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/basic1.sim b/tests/script/general/table/basic1.sim index 0e425c95f9..e8d0cd7bd8 100644 --- a/tests/script/general/table/basic1.sim +++ b/tests/script/general/table/basic1.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -69,3 +70,4 @@ if $data21 != 3 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/basic2.sim b/tests/script/general/table/basic2.sim index 40688403a8..d1678e8abd 100644 --- a/tests/script/general/table/basic2.sim +++ b/tests/script/general/table/basic2.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== one table @@ -65,3 +66,4 @@ if $data21 != 3 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/basic3.sim b/tests/script/general/table/basic3.sim index 18c3f9b625..7f90dc0c52 100644 --- a/tests/script/general/table/basic3.sim +++ b/tests/script/general/table/basic3.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -69,3 +70,4 @@ if $data21 != 3 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/bigint.sim b/tests/script/general/table/bigint.sim index 2b7da03366..dd61d25ef9 100644 --- a/tests/script/general/table/bigint.sim +++ b/tests/script/general/table/bigint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -71,3 +69,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/binary.sim b/tests/script/general/table/binary.sim index 28a09c5570..cdbfcd4cbf 100644 --- a/tests/script/general/table/binary.sim +++ b/tests/script/general/table/binary.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -61,3 +59,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/bool.sim b/tests/script/general/table/bool.sim index 4886159c26..fbb6fe823c 100644 --- a/tests/script/general/table/bool.sim +++ b/tests/script/general/table/bool.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -90,3 +88,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column2.sim b/tests/script/general/table/column2.sim index d8a58cc78a..9251e31daa 100644 --- a/tests/script/general/table/column2.sim +++ b/tests/script/general/table/column2.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -23,4 +21,6 @@ sql drop database db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column_name.sim b/tests/script/general/table/column_name.sim index c029810be7..0b09f65129 100644 --- a/tests/script/general/table/column_name.sim +++ b/tests/script/general/table/column_name.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -85,6 +83,4 @@ if $rows != 0 then return -1 endi - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column_num.sim b/tests/script/general/table/column_num.sim index 0a497d0b0b..d1091528b2 100644 --- a/tests/script/general/table/column_num.sim +++ b/tests/script/general/table/column_num.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -83,3 +81,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column_value.sim b/tests/script/general/table/column_value.sim index 245d8935a3..bd98d3b290 100644 --- a/tests/script/general/table/column_value.sim +++ b/tests/script/general/table/column_value.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -77,6 +75,4 @@ if $rows != 0 then return -1 endi - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/date.sim b/tests/script/general/table/date.sim index ac97d22902..2e73a217a6 100644 --- a/tests/script/general/table/date.sim +++ b/tests/script/general/table/date.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -88,3 +86,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/db.table.sim b/tests/script/general/table/db.table.sim index aa309a4417..50224f83b5 100644 --- a/tests/script/general/table/db.table.sim +++ b/tests/script/general/table/db.table.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -44,4 +42,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/delete_reuse1.sim b/tests/script/general/table/delete_reuse1.sim index 3dc4b63bed..94f5bdb287 100644 --- a/tests/script/general/table/delete_reuse1.sim +++ b/tests/script/general/table/delete_reuse1.sim @@ -1,9 +1,4 @@ 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 @@ -87,3 +82,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/delete_reuse2.sim b/tests/script/general/table/delete_reuse2.sim index d907bf4f7e..1a9c80cff0 100644 --- a/tests/script/general/table/delete_reuse2.sim +++ b/tests/script/general/table/delete_reuse2.sim @@ -1,9 +1,4 @@ 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 @@ -89,3 +84,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/table/delete_writing.sim b/tests/script/general/table/delete_writing.sim index 049b3037aa..73d028928f 100644 --- a/tests/script/general/table/delete_writing.sim +++ b/tests/script/general/table/delete_writing.sim @@ -1,9 +1,4 @@ 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 @@ -57,3 +52,5 @@ while $x < 20 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/describe.sim b/tests/script/general/table/describe.sim index 822476ac11..ebec004f19 100644 --- a/tests/script/general/table/describe.sim +++ b/tests/script/general/table/describe.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -47,4 +45,5 @@ sql show databases if $rows != 0 then return -1 endi - \ No newline at end of file + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/double.sim b/tests/script/general/table/double.sim index f730d09f01..10239568fe 100644 --- a/tests/script/general/table/double.sim +++ b/tests/script/general/table/double.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -96,3 +94,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/agg/fill.sim b/tests/script/general/table/fill.sim similarity index 100% rename from tests/script/general/agg/fill.sim rename to tests/script/general/table/fill.sim diff --git a/tests/script/general/table/float.sim b/tests/script/general/table/float.sim index f7cc7e690e..e4ef8a42d6 100644 --- a/tests/script/general/table/float.sim +++ b/tests/script/general/table/float.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -96,3 +94,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/int.sim b/tests/script/general/table/int.sim index 1b0d7eec2f..81bdcda47d 100644 --- a/tests/script/general/table/int.sim +++ b/tests/script/general/table/int.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -24,7 +22,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -37,7 +35,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +58,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -98,22 +96,22 @@ if $data01 != 2 then endi print =============== step8 -sql insert into $tb values (now+8m, "null") +sql insert into $tb values (now+8m, "NULL") sql select * from $tb order by ts desc if $rows != 8 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi print =============== step9 -sql insert into $tb values (now+9m, 'null') +sql insert into $tb values (now+9m, 'NULL') sql select * from $tb order by ts desc if $rows != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -133,3 +131,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/table/limit.sim b/tests/script/general/table/limit.sim index 97541580a8..46fc5103c1 100644 --- a/tests/script/general/table/limit.sim +++ b/tests/script/general/table/limit.sim @@ -1,6 +1,4 @@ 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 @@ -91,4 +89,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/smallint.sim b/tests/script/general/table/smallint.sim index 5f83c071e5..b6f0d6948f 100644 --- a/tests/script/general/table/smallint.sim +++ b/tests/script/general/table/smallint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -24,7 +22,8 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +print $data01 +if $data01 != NULL then return -1 endi @@ -37,7 +36,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +59,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -102,4 +101,5 @@ sql show databases if $rows != 0 then return -1 endi - \ No newline at end of file + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/table.sim b/tests/script/general/table/table.sim index 3303527bdb..6ad1b13b1c 100644 --- a/tests/script/general/table/table.sim +++ b/tests/script/general/table/table.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -223,4 +221,4 @@ if $rows != 0 then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/table_len.sim b/tests/script/general/table/table_len.sim index 5f675e792e..2568ebc7a5 100644 --- a/tests/script/general/table/table_len.sim +++ b/tests/script/general/table/table_len.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -58,7 +56,7 @@ if $rows != 0 then endi print =============== step4 -sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 +sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 return -1 step4: sql show tables @@ -102,4 +100,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/testSuite.sim b/tests/script/general/table/testSuite.sim index 5e4388619b..d6cc88b36a 100644 --- a/tests/script/general/table/testSuite.sim +++ b/tests/script/general/table/testSuite.sim @@ -3,24 +3,25 @@ run general/table/basic1.sim run general/table/basic2.sim run general/table/basic3.sim run general/table/bigint.sim -#run general/table/binary.sim +run general/table/binary.sim run general/table/bool.sim run general/table/column_name.sim run general/table/column_num.sim -#run general/table/column_value.sim -#run general/table/column2.sim -#run general/table/date.sim +run general/table/column_value.sim +run general/table/column2.sim +run general/table/date.sim run general/table/db.table.sim -#run general/table/delete_reuse1.sim -#run general/table/delete_reuse2.sim -#run general/table/delete_writing.sim -#run general/table/describe.sim +run general/table/delete_reuse1.sim +run general/table/delete_reuse2.sim +run general/table/delete_writing.sim +run general/table/describe.sim run general/table/double.sim +run general/table/fill.sim run general/table/float.sim run general/table/int.sim -#run general/table/limit.sim +run general/table/limit.sim run general/table/smallint.sim -#run general/table/table_len.sim -#run general/table/table.sim +run general/table/table_len.sim +run general/table/table.sim run general/table/tinyint.sim -#run general/table/vgroup.sim +run general/table/vgroup.sim diff --git a/tests/script/general/table/tinyint.sim b/tests/script/general/table/tinyint.sim index 9c29d21d12..017c007e84 100644 --- a/tests/script/general/table/tinyint.sim +++ b/tests/script/general/table/tinyint.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -24,7 +22,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -37,7 +35,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +58,7 @@ sql select * from $tb if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -101,4 +99,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/vgroup.sim b/tests/script/general/table/vgroup.sim index 7dbab1eabb..7efa3e9f73 100644 --- a/tests/script/general/table/vgroup.sim +++ b/tests/script/general/table/vgroup.sim @@ -1,6 +1,4 @@ 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 @@ -156,7 +154,4 @@ if $rows != 0 then return -1 endi - - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/3.sim b/tests/script/general/tag/3.sim index e2a503ce8b..4b3104fe1b 100644 --- a/tests/script/general/tag/3.sim +++ b/tests/script/general/tag/3.sim @@ -1,13 +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/exec.sh -n dnode1 -s start sleep 3000 sql connect -sql reset query cache print ======================== dnode1 start @@ -521,3 +518,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/4.sim b/tests/script/general/tag/4.sim index 93c422bb31..120ef4e4e3 100644 --- a/tests/script/general/tag/4.sim +++ b/tests/script/general/tag/4.sim @@ -711,3 +711,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/5.sim b/tests/script/general/tag/5.sim index 949c9c257b..efe88b3650 100644 --- a/tests/script/general/tag/5.sim +++ b/tests/script/general/tag/5.sim @@ -834,3 +834,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/6.sim b/tests/script/general/tag/6.sim index de5542c635..d5f0a6c4af 100644 --- a/tests/script/general/tag/6.sim +++ b/tests/script/general/tag/6.sim @@ -989,3 +989,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/add.sim b/tests/script/general/tag/add.sim index 92fa800450..69fd909dcf 100644 --- a/tests/script/general/tag/add.sim +++ b/tests/script/general/tag/add.sim @@ -545,7 +545,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -851,4 +851,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bigint.sim b/tests/script/general/tag/bigint.sim index 736c30607f..4fa22d3995 100644 --- a/tests/script/general/tag/bigint.sim +++ b/tests/script/general/tag/bigint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/binary.sim b/tests/script/general/tag/binary.sim index f57f5cc996..7c6f95b1ef 100644 --- a/tests/script/general/tag/binary.sim +++ b/tests/script/general/tag/binary.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/binary_binary.sim b/tests/script/general/tag/binary_binary.sim index 5f001e028e..077ec85b52 100644 --- a/tests/script/general/tag/binary_binary.sim +++ b/tests/script/general/tag/binary_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool.sim b/tests/script/general/tag/bool.sim index 82d6cd14bf..540eaf1238 100644 --- a/tests/script/general/tag/bool.sim +++ b/tests/script/general/tag/bool.sim @@ -236,4 +236,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool_binary.sim b/tests/script/general/tag/bool_binary.sim index c836dd227b..a3f99e25ad 100644 --- a/tests/script/general/tag/bool_binary.sim +++ b/tests/script/general/tag/bool_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool_int.sim b/tests/script/general/tag/bool_int.sim index 86a16fde9b..1a2726dbaa 100644 --- a/tests/script/general/tag/bool_int.sim +++ b/tests/script/general/tag/bool_int.sim @@ -322,4 +322,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/change.sim b/tests/script/general/tag/change.sim index 74431458f9..1577514765 100644 --- a/tests/script/general/tag/change.sim +++ b/tests/script/general/tag/change.sim @@ -394,7 +394,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -421,7 +421,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -448,7 +448,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -475,7 +475,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -502,7 +502,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -511,4 +511,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/column.sim b/tests/script/general/tag/column.sim index e9b89b7b46..4a36e832f1 100644 --- a/tests/script/general/tag/column.sim +++ b/tests/script/general/tag/column.sim @@ -91,4 +91,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/commit.sim b/tests/script/general/tag/commit.sim index 1e78628b28..94dc13f0cf 100644 --- a/tests/script/general/tag/commit.sim +++ b/tests/script/general/tag/commit.sim @@ -544,7 +544,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -1054,7 +1054,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -1180,4 +1180,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/create.sim b/tests/script/general/tag/create.sim index 3d4ecf8bc3..c0cdbe87dc 100644 --- a/tests/script/general/tag/create.sim +++ b/tests/script/general/tag/create.sim @@ -598,3 +598,5 @@ print $data00 $data01 $data02 if $data02 != 12345 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/delete.sim b/tests/script/general/tag/delete.sim index ef886d7644..3454ce9d82 100644 --- a/tests/script/general/tag/delete.sim +++ b/tests/script/general/tag/delete.sim @@ -428,7 +428,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -452,7 +452,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -476,7 +476,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -500,7 +500,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -524,10 +524,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -554,10 +554,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -584,10 +584,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -614,10 +614,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -644,13 +644,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -683,13 +683,13 @@ endi if $data03 != 4.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi @@ -722,16 +722,16 @@ endi if $data03 != 4.000000000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -771,13 +771,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -823,4 +823,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/double.sim b/tests/script/general/tag/double.sim index 47c94d8ae6..13dcb1fc72 100644 --- a/tests/script/general/tag/double.sim +++ b/tests/script/general/tag/double.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/filter.sim b/tests/script/general/tag/filter.sim index b10e8a0372..4388f029f9 100644 --- a/tests/script/general/tag/filter.sim +++ b/tests/script/general/tag/filter.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start @@ -146,3 +144,5 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/float.sim b/tests/script/general/tag/float.sim index 4f86eec338..2352bbaf2e 100644 --- a/tests/script/general/tag/float.sim +++ b/tests/script/general/tag/float.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int.sim b/tests/script/general/tag/int.sim index d0dea47cb1..a93df9a57a 100644 --- a/tests/script/general/tag/int.sim +++ b/tests/script/general/tag/int.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int_binary.sim b/tests/script/general/tag/int_binary.sim index 234780d6d5..d379500668 100644 --- a/tests/script/general/tag/int_binary.sim +++ b/tests/script/general/tag/int_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int_float.sim b/tests/script/general/tag/int_float.sim index bfa3ed7f72..510c4f92d0 100644 --- a/tests/script/general/tag/int_float.sim +++ b/tests/script/general/tag/int_float.sim @@ -322,4 +322,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/set.sim b/tests/script/general/tag/set.sim index e48db5a7a8..917844c3e3 100644 --- a/tests/script/general/tag/set.sim +++ b/tests/script/general/tag/set.sim @@ -338,7 +338,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -365,7 +365,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -392,7 +392,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -419,7 +419,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -446,7 +446,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -455,4 +455,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/smallint.sim b/tests/script/general/tag/smallint.sim index 4ca9459477..18b0957b15 100644 --- a/tests/script/general/tag/smallint.sim +++ b/tests/script/general/tag/smallint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/testSuite.sim b/tests/script/general/tag/testSuite.sim index 10874262d6..45356efac1 100644 --- a/tests/script/general/tag/testSuite.sim +++ b/tests/script/general/tag/testSuite.sim @@ -1,25 +1,25 @@ -run general/tag/filter.sim -run general/tag/column.sim -run general/tag/bool.sim -run general/tag/smallint.sim -run general/tag/tinyint.sim -run general/tag/int.sim -run general/tag/bigint.sim -run general/tag/float.sim -run general/tag/double.sim -run general/tag/binary.sim -run general/tag/bool_int.sim -run general/tag/bool_binary.sim -run general/tag/int_float.sim -run general/tag/int_binary.sim -run general/tag/binary_binary.sim run general/tag/3.sim run general/tag/4.sim run general/tag/5.sim run general/tag/6.sim +run general/tag/add.sim +run general/tag/bigint.sim +run general/tag/binary_binary.sim +run general/tag/binary.sim +run general/tag/bool_binary.sim +run general/tag/bool_int.sim +run general/tag/bool.sim +run general/tag/change.sim +run general/tag/column.sim +run general/tag/commit.sim run general/tag/create.sim run general/tag/delete.sim -run general/tag/change.sim +run general/tag/double.sim +run general/tag/filter.sim +run general/tag/float.sim +run general/tag/int_binary.sim +run general/tag/int_float.sim +run general/tag/int.sim run general/tag/set.sim -run general/tag/add.sim -run general/tag/commit.sim \ No newline at end of file +run general/tag/smallint.sim +run general/tag/tinyint.sim diff --git a/tests/script/general/tag/tinyint.sim b/tests/script/general/tag/tinyint.sim index 9e339a352c..f104f8df04 100644 --- a/tests/script/general/tag/tinyint.sim +++ b/tests/script/general/tag/tinyint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/basic1.sim b/tests/script/general/user/basic1.sim index 1cff77d317..3670c1ddb0 100644 --- a/tests/script/general/user/basic1.sim +++ b/tests/script/general/user/basic1.sim @@ -71,4 +71,4 @@ print $data10 $data11 $data22 print $data20 $data11 $data22 print $data30 $data31 $data32 -system sh/exec.sh -n dnode1 -s stop \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/basicSuite.sim b/tests/script/general/user/basicSuite.sim deleted file mode 100644 index 199c8f39a1..0000000000 --- a/tests/script/general/user/basicSuite.sim +++ /dev/null @@ -1 +0,0 @@ -run general/user/basic1.sim \ No newline at end of file diff --git a/tests/script/general/user/monitor.sim b/tests/script/general/user/monitor.sim index 3c578ec73c..208b85f16c 100644 --- a/tests/script/general/user/monitor.sim +++ b/tests/script/general/user/monitor.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 print ========== step1 @@ -16,7 +14,7 @@ print ========== step2 sql drop database log -x step21 return -1 step21: -sql drop table log.cpu -x step22 +sql drop table log.dn -x step22 return -1 step22: sql drop user log -x step23 @@ -31,6 +29,4 @@ if $rows == 0 then return -1 endi - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/pass_alter.sim b/tests/script/general/user/pass_alter.sim index 22c0333227..034e704a87 100644 --- a/tests/script/general/user/pass_alter.sim +++ b/tests/script/general/user/pass_alter.sim @@ -1,6 +1,4 @@ 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/exec.sh -n dnode1 -s start @@ -47,3 +45,5 @@ sql show users if $rows != 6 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/pass_len.sim b/tests/script/general/user/pass_len.sim index 2a4a007a1a..d5d7b3250f 100644 --- a/tests/script/general/user/pass_len.sim +++ b/tests/script/general/user/pass_len.sim @@ -1,6 +1,5 @@ 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/exec.sh -n dnode1 -s start @@ -80,4 +79,4 @@ if $rows != 3 then return -1 endi - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/testSuite.sim b/tests/script/general/user/testSuite.sim index 242e8ca27a..b4bf52cfd1 100644 --- a/tests/script/general/user/testSuite.sim +++ b/tests/script/general/user/testSuite.sim @@ -1,6 +1,6 @@ run general/user/basic1.sim +run general/user/monitor.sim run general/user/pass_alter.sim run general/user/pass_len.sim run general/user/user_create.sim -run general/user/user_len.sim -#run general/user/monitor.sim \ No newline at end of file +run general/user/user_len.sim \ No newline at end of file diff --git a/tests/script/general/user/user_create.sim b/tests/script/general/user/user_create.sim index cb75c2f5a6..4da60b7e39 100644 --- a/tests/script/general/user/user_create.sim +++ b/tests/script/general/user/user_create.sim @@ -1,6 +1,5 @@ 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/exec.sh -n dnode1 -s start @@ -82,7 +81,4 @@ step42: sql drop user read - - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/user_len.sim b/tests/script/general/user/user_len.sim index fa1fd5c4ea..79b72468bb 100644 --- a/tests/script/general/user/user_len.sim +++ b/tests/script/general/user/user_len.sim @@ -86,3 +86,5 @@ sql show users if $rows != 3 then return -1 endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_field.sim b/tests/script/general/vector/metrics_field.sim index 1b96b8c36d..2a03ccea19 100644 --- a/tests/script/general/vector/metrics_field.sim +++ b/tests/script/general/vector/metrics_field.sim @@ -618,4 +618,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_mix.sim b/tests/script/general/vector/metrics_mix.sim index 992ce6e189..96b2f6a7a0 100644 --- a/tests/script/general/vector/metrics_mix.sim +++ b/tests/script/general/vector/metrics_mix.sim @@ -618,4 +618,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_query.sim b/tests/script/general/vector/metrics_query.sim index 8e3833f7a4..824aa6f22e 100644 --- a/tests/script/general/vector/metrics_query.sim +++ b/tests/script/general/vector/metrics_query.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_tag.sim b/tests/script/general/vector/metrics_tag.sim index 81f15a194f..e7575cc9df 100644 --- a/tests/script/general/vector/metrics_tag.sim +++ b/tests/script/general/vector/metrics_tag.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_time.sim b/tests/script/general/vector/metrics_time.sim index f7e78ae521..bbcabfd1b7 100644 --- a/tests/script/general/vector/metrics_time.sim +++ b/tests/script/general/vector/metrics_time.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/multi.sim b/tests/script/general/vector/multi.sim index 3a607b2410..105f210950 100644 --- a/tests/script/general/vector/multi.sim +++ b/tests/script/general/vector/multi.sim @@ -206,10 +206,11 @@ sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step return -1 step74: - print =============== clear sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/single.sim b/tests/script/general/vector/single.sim index 8eff3e1fb1..2292d6f44a 100644 --- a/tests/script/general/vector/single.sim +++ b/tests/script/general/vector/single.sim @@ -298,4 +298,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_field.sim b/tests/script/general/vector/table_field.sim index 96adf54f1d..a9d6910f4d 100644 --- a/tests/script/general/vector/table_field.sim +++ b/tests/script/general/vector/table_field.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_mix.sim b/tests/script/general/vector/table_mix.sim index c994697ff2..a6c4dc92da 100644 --- a/tests/script/general/vector/table_mix.sim +++ b/tests/script/general/vector/table_mix.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_query.sim b/tests/script/general/vector/table_query.sim index ce3acc1d66..812229afc4 100644 --- a/tests/script/general/vector/table_query.sim +++ b/tests/script/general/vector/table_query.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_time.sim b/tests/script/general/vector/table_time.sim index 3c2ff183ed..a83195beba 100644 --- a/tests/script/general/vector/table_time.sim +++ b/tests/script/general/vector/table_time.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/testSuite.sim b/tests/script/general/vector/testSuite.sim index e660fd90a9..f0b9fef991 100644 --- a/tests/script/general/vector/testSuite.sim +++ b/tests/script/general/vector/testSuite.sim @@ -1,12 +1,11 @@ -run general/vector/single.sim -run general/vector/multi.sim -run general/vector/table_query.sim -run general/vector/table_time.sim -run general/vector/table_field.sim -run general/vector/table_mix.sim +run general/vector/metrics_field.sim +run general/vector/metrics_mix.sim run general/vector/metrics_query.sim run general/vector/metrics_tag.sim run general/vector/metrics_time.sim -run general/vector/metrics_field.sim -run general/vector/metrics_mix.sim - +run general/vector/multi.sim +run general/vector/single.sim +run general/vector/table_field.sim +run general/vector/table_mix.sim +run general/vector/table_query.sim +run general/vector/table_time.sim diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index e0590b50ef..1a9862e4ed 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -6,10 +6,45 @@ cd ../../../debug; cmake .. #cd ../../../debug; make clean cd ../../../debug; make +#./test.sh -f general/alter/cached_schema_after_alter.sim +#./test.sh -f general/alter/count.sim +#./test.sh -f general/alter/import.sim +#./test.sh -f general/alter/insert1.sim +#./test.sh -f general/alter/insert2.sim +#./test.sh -f general/alter/metrics.sim +#./test.sh -f general/alter/table.sim -#general +./test.sh -f general/cache/new_metrics.sim +#./test.sh -f general/cache/restart_metrics.sim +./test.sh -f general/cache/restart_table.sim -./test.sh -f general//db/basic.sim +#./test.sh -f general/column/commit.sim +#./test.sh -f general/column/metrics.sim +#./test.sh -f general/column/table.sim + +./test.sh -f general/compress/commitlog.sim +./test.sh -f general/compress/compress.sim +./test.sh -f general/compress/compress2.sim +./test.sh -f general/compress/uncompress.sim + +#./test.sh -f general/compute/avg.sim +./test.sh -f general/compute/bottom.sim +#./test.sh -f general/compute/count.sim +./test.sh -f general/compute/diff.sim +#./test.sh -f general/compute/diff2.sim +#./test.sh -f general/compute/first.sim +#./test.sh -f general/compute/interval.sim +#./test.sh -f general/compute/last.sim +#./test.sh -f general/compute/leastsquare.sim +#./test.sh -f general/compute/max.sim +#./test.sh -f general/compute/min.sim +./test.sh -f general/compute/null.sim +./test.sh -f general/compute/percentile.sim +./test.sh -f general/compute/stddev.sim +#./test.sh -f general/compute/sum.sim +./test.sh -f general/compute/top.sim + +./test.sh -f general/db/basic.sim ./test.sh -f general/db/basic1.sim ./test.sh -f general/db/basic2.sim ./test.sh -f general/db/basic3.sim @@ -25,29 +60,124 @@ cd ../../../debug; make ./test.sh -f general/db/repeat.sim ./test.sh -f general/db/tables.sim +#./test.sh -f general/field/2.sim +#./test.sh -f general/field/3.sim +#./test.sh -f general/field/4.sim +#./test.sh -f general/field/5.sim +#./test.sh -f general/field/6.sim +./test.sh -f general/field/bigint.sim +#./test.sh -f general/field/binary.sim +./test.sh -f general/field/bool.sim +#./test.sh -f general/field/single.sim +./test.sh -f general/field/smallint.sim +./test.sh -f general/field/tinyint.sim + +./test.sh -f general/http/restful.sim +./test.sh -f general/http/restful_insert.sim +./test.sh -f general/http/restful_limit.sim +./test.sh -f general/http/restful_full.sim +./test.sh -f general/http/prepare.sim +./test.sh -f general/http/telegraf.sim +#./test.sh -f general/http/grafana_bug.sim +#./test.sh -f general/http/grafana.sim + +./test.sh -f general/import/basic.sim +./test.sh -f general/import/commit.sim +./test.sh -f general/import/large.sim +#./test.sh -f general/import/replica1.sim + +./test.sh -f general/insert/basic.sim +#./test.sh -f general/insert/insert_drop.sim +./test.sh -f general/insert/query_block1_memory.sim +./test.sh -f general/insert/query_block2_memory.sim +./test.sh -f general/insert/query_block1_file.sim +./test.sh -f general/insert/query_block2_file.sim +./test.sh -f general/insert/query_file_memory.sim +./test.sh -f general/insert/query_multi_file.sim +./test.sh -f general/insert/tcp.sim + +#./test.sh -f general/metrics/disk.sim +#./test.sh -f general/metrics/metrics.sim +#./test.sh -f general/metrics/values.sim +#./test.sh -f general/metrics/vnode3.sim + +#parser +#stream + ./test.sh -f general/table/autocreate.sim ./test.sh -f general/table/basic1.sim ./test.sh -f general/table/basic2.sim ./test.sh -f general/table/basic3.sim ./test.sh -f general/table/bigint.sim +./test.sh -f general/table/binary.sim ./test.sh -f general/table/bool.sim ./test.sh -f general/table/column_name.sim ./test.sh -f general/table/column_num.sim +./test.sh -f general/table/column_value.sim +./test.sh -f general/table/column2.sim +./test.sh -f general/table/date.sim ./test.sh -f general/table/db.table.sim +#./test.sh -f general/table/delete_reuse1.sim +#./test.sh -f general/table/delete_reuse2.sim +#./test.sh -f general/table/delete_writing.sim +#./test.sh -f general/table/describe.sim ./test.sh -f general/table/double.sim +#./test.sh -f general/table/fill.sim ./test.sh -f general/table/float.sim ./test.sh -f general/table/int.sim +./test.sh -f general/table/limit.sim ./test.sh -f general/table/smallint.sim +#./test.sh -f general/table/table_len.sim +./test.sh -f general/table/table.sim ./test.sh -f general/table/tinyint.sim +./test.sh -f general/table/vgroup.sim + +#./test.sh -f general/tag/3.sim +#./test.sh -f general/tag/4.sim +#./test.sh -f general/tag/5.sim +#./test.sh -f general/tag/6.sim +#./test.sh -f general/tag/add.sim +#./test.sh -f general/tag/bigint.sim +#./test.sh -f general/tag/binary_binary.sim +#./test.sh -f general/tag/binary.sim +#./test.sh -f general/tag/bool_binary.sim +#./test.sh -f general/tag/bool_int.sim +#./test.sh -f general/tag/bool.sim +#./test.sh -f general/tag/change.sim +#./test.sh -f general/tag/column.sim +#./test.sh -f general/tag/commit.sim +#./test.sh -f general/tag/create.sim +#./test.sh -f general/tag/delete.sim +#./test.sh -f general/tag/double.sim +#./test.sh -f general/tag/filter.sim +#./test.sh -f general/tag/float.sim +#./test.sh -f general/tag/int_binary.sim +#./test.sh -f general/tag/int_float.sim +#./test.sh -f general/tag/int.sim +#./test.sh -f general/tag/set.sim +#./test.sh -f general/tag/smallint.sim +#./test.sh -f general/tag/tinyint.sim ./test.sh -f general/user/basic1.sim +#./test.sh -f general/user/monitor.sim ./test.sh -f general/user/pass_alter.sim ./test.sh -f general/user/pass_len.sim ./test.sh -f general/user/user_create.sim ./test.sh -f general/user/user_len.sim +#./test.sh -f general/vector/metrics_field.sim +#./test.sh -f general/vector/metrics_mix.sim +#./test.sh -f general/vector/metrics_query.sim +#./test.sh -f general/vector/metrics_tag.sim +#./test.sh -f general/vector/metrics_time.sim +#./test.sh -f general/vector/multi.sim +./test.sh -f general/vector/single.sim +#./test.sh -f general/vector/table_field.sim +#./test.sh -f general/vector/table_mix.sim +#./test.sh -f general/vector/table_query.sim +#./test.sh -f general/vector/table_time.sim -# unique +################################# ./test.sh -u -f unique/account/account_create.sim ./test.sh -u -f unique/account/account_delete.sim @@ -61,14 +191,20 @@ cd ../../../debug; make ./test.sh -u -f unique/account/user_create.sim ./test.sh -u -f unique/account/user_len.sim -#big +#./test.sh -u -f unique/big/balance.sim +#./test.sh -u -f unique/big/maxvnodes.sim +#./test.sh -u -f unique/big/tcp.sim ./test.sh -u -f unique/cluster/balance1.sim ./test.sh -u -f unique/cluster/balance2.sim ./test.sh -u -f unique/cluster/balance3.sim +#./test.sh -u -f unique/cluster/cache.sim ./test.sh -u -f unique/column/replica3.sim +#./test.sh -u -f unique/db/commit.sim +#./test.sh -u -f unique/db/delete.sim +#./test.sh -u -f unique/db/delete_part.sim ./test.sh -u -f unique/db/replica_add12.sim ./test.sh -u -f unique/db/replica_add13.sim ./test.sh -u -f unique/db/replica_add23.sim @@ -83,12 +219,24 @@ cd ../../../debug; make ./test.sh -u -f unique/dnode/balancex.sim ./test.sh -u -f unique/dnode/offline1.sim ./test.sh -u -f unique/dnode/offline2.sim +#./test.sh -u -f unique/dnode/remove1.sim +#./test.sh -u -f unique/dnode/remove2.sim +#./test.sh -u -f unique/dnode/vnode_clean.sim ./test.sh -u -f unique/http/admin.sim +./test.sh -u -f unique/http/opentsdb.sim -#import +#./test.sh -u -f unique/import/replica2.sim +#./test.sh -u -f unique/import/replica3.sim -#metrics +#./test.sh -u -f unique/metrics/balance_replica1.sim +#./test.sh -u -f unique/metrics/dnode2_stop.sim +#./test.sh -u -f unique/metrics/dnode2.sim +#./test.sh -u -f unique/metrics/dnode3.sim +#./test.sh -u -f unique/metrics/replica2_dnode4.sim +#./test.sh -u -f unique/metrics/replica2_vnode3.sim +#./test.sh -u -f unique/metrics/replica3_dnode6.sim +#./test.sh -u -f unique/metrics/replica3_vnode3.sim ./test.sh -u -f unique/mnode/mgmt22.sim ./test.sh -u -f unique/mnode/mgmt23.sim @@ -97,10 +245,21 @@ cd ../../../debug; make ./test.sh -u -f unique/mnode/mgmt26.sim ./test.sh -u -f unique/mnode/mgmt33.sim ./test.sh -u -f unique/mnode/mgmt34.sim +#./test.sh -u -f unique/mnode/mgmtr2.sim +#./test.sh -u -f unique/mnode/secondIp.sim #stream -#table +./test.sh -u -f unique/table/delete_part.sim ./test.sh -u -f unique/vnode/replica2_basic2.sim -./test.sh -u -f unique/vnode/replica3_basic.sim \ No newline at end of file +./test.sh -u -f unique/vnode/replica3_basic.sim + +#./test.sh -u -f unique/vnode/commit.sim +#./test.sh -u -f unique/vnode/many.sim +#./test.sh -u -f unique/vnode/replica2_basic.sim +./test.sh -u -f unique/vnode/replica2_basic2.sim +#./test.sh -u -f unique/vnode/replica2_repeat.sim +./test.sh -u -f unique/vnode/replica3_basic.sim +#./test.sh -u -f unique/vnode/replica3_repeat.sim +#./test.sh -u -f unique/vnode/replica3_vgroup.sim diff --git a/tests/script/unique/account/account_create.sim b/tests/script/unique/account/account_create.sim index 30dd96075c..d1d5ebece0 100644 --- a/tests/script/unique/account/account_create.sim +++ b/tests/script/unique/account/account_create.sim @@ -4,6 +4,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/exec_up.sh -n dnode1 -s start sql connect +sleep 3000 print ============================ dnode1 start diff --git a/tests/script/unique/account/user_len.sim b/tests/script/unique/account/user_len.sim index fcc344d115..918551fa66 100644 --- a/tests/script/unique/account/user_len.sim +++ b/tests/script/unique/account/user_len.sim @@ -29,6 +29,7 @@ endi print =============== step2 sql drop user a -x step2 step2: +sleep 1000 sql create user a PASS '123' sql show users if $rows != 4 then diff --git a/tests/script/unique/big/balance.sim b/tests/script/unique/big/balance.sim index 3d4d39af53..52199f046e 100644 --- a/tests/script/unique/big/balance.sim +++ b/tests/script/unique/big/balance.sim @@ -160,7 +160,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 if $data3_192.168.0.1 != 2 then goto show3 endi -if $data3_192.168.0.2 != null then +if $data3_192.168.0.2 != NULL then goto show3 endi if $data3_192.168.0.3 != 2 then @@ -216,7 +216,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 if $data3_192.168.0.1 != 0 then goto show4 endi -if $data3_192.168.0.3 != null then +if $data3_192.168.0.3 != NULL then goto show4 endi @@ -304,3 +304,12 @@ print select count(*) from mt $data00 expect $rowNum if $data00 != $totalNum then goto show5 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/big/maxvnodes.sim b/tests/script/unique/big/maxvnodes.sim index 738fd0704d..00995ba32c 100644 --- a/tests/script/unique/big/maxvnodes.sim +++ b/tests/script/unique/big/maxvnodes.sim @@ -79,3 +79,12 @@ sql select count(*) from mt if $data00 != 25600 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/big/tcp.sim b/tests/script/unique/big/tcp.sim index 7957449617..1fb414ec74 100644 --- a/tests/script/unique/big/tcp.sim +++ b/tests/script/unique/big/tcp.sim @@ -103,5 +103,12 @@ while $i < 100 $i = $i + 1 endw -system sh/stop_dnodes.sh -sleep 10000 + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/unique/big/testSuite.sim b/tests/script/unique/big/testSuite.sim index 5881d1fb67..2cead5626a 100644 --- a/tests/script/unique/big/testSuite.sim +++ b/tests/script/unique/big/testSuite.sim @@ -1,3 +1,3 @@ -#run unique/big/balance.sim -#run unique/big/maxvnodes.sim -#run unique/big/tcp.sim +run unique/big/balance.sim +run unique/big/maxvnodes.sim +run unique/big/tcp.sim diff --git a/tests/script/unique/cluster/balance1.sim b/tests/script/unique/cluster/balance1.sim index 424a80d25a..10e05971d7 100644 --- a/tests/script/unique/cluster/balance1.sim +++ b/tests/script/unique/cluster/balance1.sim @@ -77,7 +77,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 2 then return -1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then return -1 endi @@ -146,7 +146,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 3 then goto show4 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show4 endi @@ -229,7 +229,7 @@ print dnode3 $dnode3Vnodes if $dnode1Vnodes != 3 then goto show8 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show8 endi @@ -245,7 +245,7 @@ if $dnode1Role != master then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi diff --git a/tests/script/unique/cluster/balance2.sim b/tests/script/unique/cluster/balance2.sim index 08fdd233e0..d741e03eec 100644 --- a/tests/script/unique/cluster/balance2.sim +++ b/tests/script/unique/cluster/balance2.sim @@ -131,7 +131,7 @@ print dnode3 $dnode3Vnodes if $dnode1Vnodes != 3 then goto show2 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show2 endi if $dnode3Vnodes != 3 then @@ -194,7 +194,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -231,7 +231,7 @@ endi if $dnode4Vnodes != 3 then goto show4 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show4 endi @@ -248,10 +248,10 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -339,7 +339,7 @@ print dnode4 $dnode4Vnodes $dnode5Vnodes = $data2_5 print dnode5 $dnode5Vnodes -if $dnode1Vnodes != null then +if $dnode1Vnodes != NULL then goto show6 endi if $dnode4Vnodes != 3 then diff --git a/tests/script/unique/cluster/balance3.sim b/tests/script/unique/cluster/balance3.sim index 407adc7f3b..e9847e21da 100644 --- a/tests/script/unique/cluster/balance3.sim +++ b/tests/script/unique/cluster/balance3.sim @@ -110,7 +110,7 @@ endi if $dnode3Vnodes != 3 then goto show1 endi -if $dnode4Vnodes != null then +if $dnode4Vnodes != NULL then goto show1 endi @@ -166,7 +166,7 @@ print dnode4 $dnode4Vnodes if $dnode1Vnodes != 3 then goto show3 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show3 endi if $dnode3Vnodes != 3 then @@ -232,7 +232,7 @@ endi if $dnode5Vnodes != 3 then goto show5 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show5 endi if $dnode4Vnodes != 3 then @@ -298,7 +298,7 @@ endi if $dnode6Vnodes != 3 then goto show7 endi -if $dnode4Vnodes != null then +if $dnode4Vnodes != NULL then goto show7 endi diff --git a/tests/script/general/cache/cache_balance.sim b/tests/script/unique/cluster/cache.sim similarity index 100% rename from tests/script/general/cache/cache_balance.sim rename to tests/script/unique/cluster/cache.sim diff --git a/tests/script/unique/cluster/testSuite.sim b/tests/script/unique/cluster/testSuite.sim index 34cdda85dd..9657558c12 100644 --- a/tests/script/unique/cluster/testSuite.sim +++ b/tests/script/unique/cluster/testSuite.sim @@ -1,3 +1,4 @@ run unique/cluster/balance1.sim run unique/cluster/balance2.sim run unique/cluster/balance3.sim +run unique/cluster/cache.sim diff --git a/tests/script/unique/db/commit.sim b/tests/script/unique/db/commit.sim index 0e58c6ed76..648cd8db2f 100644 --- a/tests/script/unique/db/commit.sim +++ b/tests/script/unique/db/commit.sim @@ -1,7 +1,4 @@ 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 @@ -118,3 +115,11 @@ if $data01 != 40 then return -1 endi +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/delete.sim b/tests/script/unique/db/delete.sim index 5100b93dcd..e222db8d70 100644 --- a/tests/script/unique/db/delete.sim +++ b/tests/script/unique/db/delete.sim @@ -44,3 +44,12 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/delete_part.sim b/tests/script/unique/db/delete_part.sim index 3ed4f5d753..3d1cc5dc63 100644 --- a/tests/script/unique/db/delete_part.sim +++ b/tests/script/unique/db/delete_part.sim @@ -1,9 +1,4 @@ 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 @@ -77,3 +72,11 @@ begin: goto begin +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/testSuite.sim b/tests/script/unique/db/testSuite.sim index 4918850426..adc1883a71 100644 --- a/tests/script/unique/db/testSuite.sim +++ b/tests/script/unique/db/testSuite.sim @@ -1,5 +1,5 @@ -#run unique/db/commit.sim -#run unique/db/delete.sim +run unique/db/commit.sim +run unique/db/delete.sim run unique/db/replica_add12.sim run unique/db/replica_add13.sim run unique/db/replica_add23.sim @@ -7,4 +7,4 @@ run unique/db/replica_reduce21.sim run unique/db/replica_reduce32.sim run unique/db/replica_reduce31.sim run unique/db/replica_part.sim -#run unique/db/delete_part.sim +run unique/db/delete_part.sim diff --git a/tests/script/unique/dnode/balance1.sim b/tests/script/unique/dnode/balance1.sim index 79f22c42ff..34d3310394 100644 --- a/tests/script/unique/dnode/balance1.sim +++ b/tests/script/unique/dnode/balance1.sim @@ -103,7 +103,7 @@ print dnode2 openVnodes $data2_2 if $data2_1 != 2 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $rows != 1 then @@ -131,7 +131,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 0 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -155,7 +155,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 3 then @@ -182,7 +182,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show7 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show7 endi if $data2_3 != 2 then @@ -210,7 +210,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 2 then @@ -240,10 +240,10 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show9 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show9 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show9 endi if $data2_4 != 4 then diff --git a/tests/script/unique/dnode/balance2.sim b/tests/script/unique/dnode/balance2.sim index 4518c42622..9786a854a5 100644 --- a/tests/script/unique/dnode/balance2.sim +++ b/tests/script/unique/dnode/balance2.sim @@ -76,7 +76,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 2 then goto show2 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show2 endi if $data2_3 != 2 then @@ -105,7 +105,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show3 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show3 endi if $data2_3 != 2 then @@ -132,7 +132,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 3 then @@ -163,7 +163,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -196,10 +196,10 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show6 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show6 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show6 endi if $data2_4 != 3 then diff --git a/tests/script/unique/dnode/balance3.sim b/tests/script/unique/dnode/balance3.sim index acb0d033d4..6d5bbc77a5 100644 --- a/tests/script/unique/dnode/balance3.sim +++ b/tests/script/unique/dnode/balance3.sim @@ -88,7 +88,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 2 then goto show2 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show2 endi if $data2_3 != 2 then @@ -122,7 +122,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show3 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show3 endi if $data2_3 != 2 then @@ -162,7 +162,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $data2_3 != 3 then @@ -228,7 +228,7 @@ endi if $data2_6 != 3 then goto show6 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show6 endi if $data2_4 != 3 then diff --git a/tests/script/unique/dnode/balancex.sim b/tests/script/unique/dnode/balancex.sim index d717250a79..4b46db4b49 100644 --- a/tests/script/unique/dnode/balancex.sim +++ b/tests/script/unique/dnode/balancex.sim @@ -132,7 +132,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 1 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 3 then diff --git a/tests/script/unique/dnode/offline1.sim b/tests/script/unique/dnode/offline1.sim index 5e4ab65be3..4d67b5f55c 100644 --- a/tests/script/unique/dnode/offline1.sim +++ b/tests/script/unique/dnode/offline1.sim @@ -63,7 +63,7 @@ print dnode1 $data4_2 if $data4_1 != ready then return -1 endi -if $data4_2 != null then +if $data4_2 != NULL then return -1 endi diff --git a/tests/script/unique/dnode/offline2.sim b/tests/script/unique/dnode/offline2.sim index 2615746e05..6aa85465dd 100644 --- a/tests/script/unique/dnode/offline2.sim +++ b/tests/script/unique/dnode/offline2.sim @@ -90,7 +90,7 @@ sql show dnodes if $data4_1 != ready then goto show4 endi -if $data4_2 != null then +if $data4_2 != NULL then goto show4 endi if $data4_3 != ready then diff --git a/tests/script/unique/dnode/remove1.sim b/tests/script/unique/dnode/remove1.sim index c69c51fa96..545c28a4ea 100644 --- a/tests/script/unique/dnode/remove1.sim +++ b/tests/script/unique/dnode/remove1.sim @@ -105,7 +105,7 @@ sql show dnodes print dnode1 openVnodes $data2_1 print dnode2 openVnodes $data2_2 print dnode3 openVnodes $data2_3 -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi @@ -130,7 +130,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 4 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -194,3 +194,12 @@ endi if $data41 != 35 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/remove2.sim b/tests/script/unique/dnode/remove2.sim index c9e48d9283..972b77a35d 100644 --- a/tests/script/unique/dnode/remove2.sim +++ b/tests/script/unique/dnode/remove2.sim @@ -106,7 +106,7 @@ sql show dnodes print dnode1 openVnodes $data2_1 print dnode2 openVnodes $data2_2 print dnode3 openVnodes $data2_3 -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $data2_1 != 3 then @@ -140,3 +140,12 @@ endi if $data41 != 35 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/testSuite.sim b/tests/script/unique/dnode/testSuite.sim index 9921cbf378..ecd43cc224 100644 --- a/tests/script/unique/dnode/testSuite.sim +++ b/tests/script/unique/dnode/testSuite.sim @@ -4,6 +4,6 @@ run unique/dnode/balance3.sim run unique/dnode/balancex.sim run unique/dnode/offline1.sim run unique/dnode/offline2.sim -#run unique/dnode/remove1.sim -#run unique/dnode/remove2.sim -#run unique/dnode/vnode_clean.sim +run unique/dnode/remove1.sim +run unique/dnode/remove2.sim +run unique/dnode/vnode_clean.sim diff --git a/tests/script/unique/dnode/vnode_clean.sim b/tests/script/unique/dnode/vnode_clean.sim index 6b3c8ebeb2..da34c7bc9b 100644 --- a/tests/script/unique/dnode/vnode_clean.sim +++ b/tests/script/unique/dnode/vnode_clean.sim @@ -91,7 +91,7 @@ print dnode2 openVnodes $data2_2 if $data2_1 != 2 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $rows != 1 then @@ -220,7 +220,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 4 then goto show9 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show9 endi if $data2_3 != 0 then @@ -302,3 +302,11 @@ if $data41 != 45 then return -1 endi +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/http/opentsdb.sim b/tests/script/unique/http/opentsdb.sim index d1b193173e..914838361a 100644 --- a/tests/script/unique/http/opentsdb.sim +++ b/tests/script/unique/http/opentsdb.sim @@ -12,7 +12,7 @@ print ============================ dnode1 start print =============== step1 - parse system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ print $system_content -if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then return -1 endi @@ -24,7 +24,7 @@ endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ print $system_content -if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then return -1 endi @@ -129,7 +129,7 @@ endi system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put print $system_content -if $system_content != @{"status":"error","code":1073,"desc":"tag name is null"}@ then +if $system_content != @{"status":"error","code":1073,"desc":"tag name is NULL"}@ then return -1 endi @@ -147,7 +147,7 @@ endi system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6020/opentsdb/db/put print $system_content -if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then +if $system_content != @{"status":"error","code":1076,"desc":"tag value is NULL"}@ then return -1 endi @@ -234,4 +234,13 @@ system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' print $system_content if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/http/testSuite.sim b/tests/script/unique/http/testSuite.sim index d4a6b1f5f5..3a9753e744 100644 --- a/tests/script/unique/http/testSuite.sim +++ b/tests/script/unique/http/testSuite.sim @@ -1,2 +1,2 @@ run unique/http/admin.sim -#run general/http/opentsdb.sim \ No newline at end of file +run general/http/opentsdb.sim \ No newline at end of file diff --git a/tests/script/unique/import/replica2.sim b/tests/script/unique/import/replica2.sim index bab04bd211..bcb4179c12 100644 --- a/tests/script/unique/import/replica2.sim +++ b/tests/script/unique/import/replica2.sim @@ -40,14 +40,16 @@ sql create table tb(ts timestamp, i int) print ================= step1 sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi @@ -55,7 +57,7 @@ print ================= step3 sql insert into tb values(1520000020000, 20000) sql select * from tb; print $rows -if $rows != 2 then +if $rows != 3 then return -1 endi @@ -64,7 +66,8 @@ sql import into tb values(1520000009000, 9000) sql import into tb values(1520000015000, 15000) sql import into tb values(1520000030000, 30000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 6 then return -1 endi @@ -74,7 +77,8 @@ sql insert into tb values(1520000014000, 14000) sql insert into tb values(1520000025000, 25000) sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 6 then +print $rows +if $rows != 9 then return -1 endi @@ -85,7 +89,8 @@ sql import into tb values(1520000023000, 23000) sql import into tb values(1520000034000, 34000) sql import into tb values(1520000050000, 50000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 14 then return -1 endi @@ -95,7 +100,7 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 11 then +if $rows != 14 then return -1 endi @@ -106,7 +111,8 @@ sql import into tb values(1520000023001, 23001) sql import into tb values(1520000034001, 34001) sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi @@ -116,7 +122,8 @@ sql insert into tb values(1520000014002, 14002) sql insert into tb values(1520000025002, 25002) sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi @@ -148,7 +155,8 @@ sql import into tb values(1521900800000, 50004) sql import into tb values(1523110400000, 50001) sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -158,7 +166,8 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -167,7 +176,7 @@ print ================= step11 #sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi @@ -176,7 +185,8 @@ print ================= step12 #sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi @@ -195,7 +205,7 @@ sql import into tb values(1516716800000, 50001) sql import into tb values(1517580800000, 50001) sql select * from tb; -if $rows != 46 then +if $rows != 50 then return -1 endi @@ -205,6 +215,15 @@ sleep 8000 system sh/exec_up.sh -n dnode1 -s stop sleep 10000 -if $rows != 46 then +if $rows != 50 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/import/replica3.sim b/tests/script/unique/import/replica3.sim index c10f2da2f1..8d70d227a5 100644 --- a/tests/script/unique/import/replica3.sim +++ b/tests/script/unique/import/replica3.sim @@ -41,53 +41,59 @@ sql use ir3db sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(now+10000a, 10000) +sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(now+8000a, 8000) -sql select * from tb; -if $rows != 1 then - return -1 -endi - -print ================= step3 -sql insert into tb values(now+20000a, 20000) +sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; if $rows != 2 then return -1 endi -print ================= step4 -sql import into tb values(now+8000a, 9000) -sql import into tb values(now+15000a, 15000) -sql import into tb values(now+30000a, 30000) +print ================= step3 +sql insert into tb values(1520000020000, 20000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 3 then return -1 endi -print ================= step5 -sql insert into tb values(now+8000a, 8000) -sql insert into tb values(now+14000a, 14000) -sql insert into tb values(now+25000a, 25000) -sql insert into tb values(now+40000a, 40000) +print ================= step4 +sql import into tb values(1520000009000, 9000) +sql import into tb values(1520000015000, 15000) +sql import into tb values(1520000030000, 30000) sql select * from tb; +print $rows if $rows != 6 then return -1 endi -print ================= step6 -sql import into tb values(now+7000a, 7000) -sql import into tb values(now+12000a, 12000) -sql import into tb values(now+23000a, 23000) -sql import into tb values(now+34000a, 34000) -sql import into tb values(now+50000a, 50000) +print ================= step5 +sql insert into tb values(1520000008000, 8000) +sql insert into tb values(1520000014000, 14000) +sql insert into tb values(1520000025000, 25000) +sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 9 then + return -1 +endi + +print ================= step6 +sql import into tb values(1520000007000, 7000) +sql import into tb values(1520000012000, 12000) +sql import into tb values(1520000023000, 23000) +sql import into tb values(1520000034000, 34000) +sql import into tb values(1520000050000, 50000) +sql select * from tb; +print $rows +if $rows != 14 then return -1 endi @@ -97,46 +103,63 @@ endi #system sh/exec_up.sh -n dnode1 -s start #sleep 5000 #sql select * from tb; -#if $rows != 11 then +#if $rows != 14 then # return -1 #endi print ================= step7 -sql import into tb values(now+7001a, 7001) -sql import into tb values(now+12001a, 12001) -sql import into tb values(now+23001a, 23001) -sql import into tb values(now+34001a, 34001) -sql import into tb values(now+50001a, 50001) +sql import into tb values(1520000007001, 7001) +sql import into tb values(1520000012001, 12001) +sql import into tb values(1520000023001, 23001) +sql import into tb values(1520000034001, 34001) +sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi print ================= step8 -sql insert into tb values(now+8002a, 8002) -sql insert into tb values(now+14002a, 14002) -sql insert into tb values(now+25002a, 25002) -sql insert into tb values(now+200000a, 60000) +sql insert into tb values(1520000008002, 8002) +sql insert into tb values(1520000014002, 14002) +sql insert into tb values(1520000025002, 25002) +sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi print ================= step9 -sql import into tb values(now-30d, 7003) -sql import into tb values(now-20d, 34003) -sql import into tb values(now-10d, 34003) -sql import into tb values(now-5d, 34003) -sql import into tb values(now+1m, 50001) -sql import into tb values(now+2m, 50001) -sql import into tb values(now+6m, 50001) -sql import into tb values(now+8m, 50002) -sql import into tb values(now+10m, 50003) -sql import into tb values(now+12m, 50004) -sql import into tb values(now+14m, 50001) -sql import into tb values(now+16m, 500051) +#1520000000000 +#sql import into tb values(now-30d, 7003) +#sql import into tb values(now-20d, 34003) +#sql import into tb values(now-10d, 34003) +#sql import into tb values(now-5d, 34003) +#sql import into tb values(now+1d, 50001) +#sql import into tb values(now+2d, 50001) +#sql import into tb values(now+6d, 50001) +#sql import into tb values(now+8d, 50002) +#sql import into tb values(now+10d, 50003) +#sql import into tb values(now+12d, 50004) +#sql import into tb values(now+14d, 50001) +#sql import into tb values(now+16d, 500051) + +sql import into tb values(1517408000000, 7003) +sql import into tb values(1518272000000, 34003) +sql import into tb values(1519136000000, 34003) +sql import into tb values(1519568000000, 34003) +sql import into tb values(1519654400000, 50001) +sql import into tb values(1519827200000, 50001) +sql import into tb values(1520345600000, 50001) +sql import into tb values(1520691200000, 50002) +sql import into tb values(1520864000000, 50003) +sql import into tb values(1521900800000, 50004) +sql import into tb values(1523110400000, 50001) +sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -146,21 +169,27 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi print ================= step11 -sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) + +#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) +sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi print ================= step12 -sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +#1520000000000 +#sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi @@ -169,11 +198,17 @@ system sh/exec_up.sh -n dnode2 -s stop sleep 5000 print ================= step14 -sql import into tb values(now-48d, 34003) -sql import into tb values(now-38d, 50001) -sql import into tb values(now-28d, 50001) +#1520000000000 +#sql import into tb values(now-48d, 34003) +#sql import into tb values(now-38d, 50001) +#sql import into tb values(now-28d, 50001) + +sql import into tb values(1515852800001, 34003) +sql import into tb values(1516716800000, 50001) +sql import into tb values(1517580800000, 50001) + sql select * from tb; -if $rows != 46 then +if $rows != 50 then return -1 endi @@ -183,6 +218,15 @@ sleep 8000 system sh/exec_up.sh -n dnode3 -s stop sleep 3000 -if $rows != 46 then +if $rows != 50 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/import/testSuite.sim b/tests/script/unique/import/testSuite.sim index df87ebf1be..8be358ce17 100644 --- a/tests/script/unique/import/testSuite.sim +++ b/tests/script/unique/import/testSuite.sim @@ -1,2 +1,2 @@ -#run unique/import/replica2.sim -#run unique/import/replica3.sim \ No newline at end of file +run unique/import/replica2.sim +run unique/import/replica3.sim \ No newline at end of file diff --git a/tests/script/unique/metrics/balance_replica1.sim b/tests/script/unique/metrics/balance_replica1.sim index eb50276260..52bf558faa 100644 --- a/tests/script/unique/metrics/balance_replica1.sim +++ b/tests/script/unique/metrics/balance_replica1.sim @@ -76,7 +76,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi print =============== step3 start dnode2 @@ -136,4 +136,13 @@ sql select * from $mt print select * from $mt ==> $rows if $rows != 2600 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode2.sim b/tests/script/unique/metrics/dnode2.sim index 03a881ea49..cd76b39ba0 100644 --- a/tests/script/unique/metrics/dnode2.sim +++ b/tests/script/unique/metrics/dnode2.sim @@ -195,4 +195,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode2_stop.sim b/tests/script/unique/metrics/dnode2_stop.sim index 58a46f9be9..996482d11e 100644 --- a/tests/script/unique/metrics/dnode2_stop.sim +++ b/tests/script/unique/metrics/dnode2_stop.sim @@ -148,4 +148,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode3.sim b/tests/script/unique/metrics/dnode3.sim index 503ce6c47a..3a5419dff4 100644 --- a/tests/script/unique/metrics/dnode3.sim +++ b/tests/script/unique/metrics/dnode3.sim @@ -224,4 +224,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica2_dnode4.sim b/tests/script/unique/metrics/replica2_dnode4.sim index 7672b19ad9..bedc895dd1 100644 --- a/tests/script/unique/metrics/replica2_dnode4.sim +++ b/tests/script/unique/metrics/replica2_dnode4.sim @@ -215,4 +215,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica2_vnode3.sim b/tests/script/unique/metrics/replica2_vnode3.sim index e7163e826d..9a1d3477be 100644 --- a/tests/script/unique/metrics/replica2_vnode3.sim +++ b/tests/script/unique/metrics/replica2_vnode3.sim @@ -192,4 +192,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica3_dnode6.sim b/tests/script/unique/metrics/replica3_dnode6.sim index ef70bf5cc3..135e594cdc 100644 --- a/tests/script/unique/metrics/replica3_dnode6.sim +++ b/tests/script/unique/metrics/replica3_dnode6.sim @@ -245,4 +245,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica3_vnode3.sim b/tests/script/unique/metrics/replica3_vnode3.sim index 50ad6d7584..ca147c1ef5 100644 --- a/tests/script/unique/metrics/replica3_vnode3.sim +++ b/tests/script/unique/metrics/replica3_vnode3.sim @@ -214,4 +214,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/testSuite.sim b/tests/script/unique/metrics/testSuite.sim index dd8ab53aa1..2e3ab31a44 100644 --- a/tests/script/unique/metrics/testSuite.sim +++ b/tests/script/unique/metrics/testSuite.sim @@ -1,4 +1,8 @@ -#run unique/metrics/disk.sim -#run unique/metrics/metrics.sim -#run unique/metrics/values.sim -#run unique/metrics/vnode3.sim \ No newline at end of file +run unique/metrics/balance_replica1.sim +run unique/metrics/dnode2_stop.sim +run unique/metrics/dnode2.sim +run unique/metrics/dnode3.sim +run unique/metrics/replica2_dnode4.sim +run unique/metrics/replica2_vnode3.sim +run unique/metrics/replica3_dnode6.sim +run unique/metrics/replica3_vnode3.sim \ No newline at end of file diff --git a/tests/script/unique/mnode/mgmt22.sim b/tests/script/unique/mnode/mgmt22.sim index 3275a233ad..ae3c386122 100644 --- a/tests/script/unique/mnode/mgmt22.sim +++ b/tests/script/unique/mnode/mgmt22.sim @@ -100,7 +100,7 @@ endi if $data2_2 != slave then goto show7 endi -if $data3_3 != null then +if $data3_3 != NULL then goto show7 endi diff --git a/tests/script/unique/mnode/mgmt23.sim b/tests/script/unique/mnode/mgmt23.sim index 8c144dd0c4..99d9159573 100644 --- a/tests/script/unique/mnode/mgmt23.sim +++ b/tests/script/unique/mnode/mgmt23.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt25.sim b/tests/script/unique/mnode/mgmt25.sim index 8c8eeba466..ba545f9479 100644 --- a/tests/script/unique/mnode/mgmt25.sim +++ b/tests/script/unique/mnode/mgmt25.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt26.sim b/tests/script/unique/mnode/mgmt26.sim index 373a0abaed..e5ead5bb39 100644 --- a/tests/script/unique/mnode/mgmt26.sim +++ b/tests/script/unique/mnode/mgmt26.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -79,7 +79,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt33.sim b/tests/script/unique/mnode/mgmt33.sim index e3a62a2d22..36b7ba8139 100644 --- a/tests/script/unique/mnode/mgmt33.sim +++ b/tests/script/unique/mnode/mgmt33.sim @@ -18,10 +18,10 @@ print dnode3 ==> $data3_3 if $data2_1 != master then return -1 endi -if $data3_2 != null then +if $data3_2 != NULL then return -1 endi -if $data3_3 != null then +if $data3_3 != NULL then return -1 endi @@ -44,7 +44,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -86,7 +86,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -156,7 +156,7 @@ print dnode1 ==> $dnode1Role print dnode2 ==> $dnode2Role print dnode3 ==> $dnode3Role -if $dnode1Role != null then +if $dnode1Role != NULL then return -1 endi #if $dnode2Role != master then diff --git a/tests/script/unique/mnode/mgmt34.sim b/tests/script/unique/mnode/mgmt34.sim index 4409c825c8..1139daea1c 100644 --- a/tests/script/unique/mnode/mgmt34.sim +++ b/tests/script/unique/mnode/mgmt34.sim @@ -22,10 +22,10 @@ print dnode3 ==> $data3_3 if $data2_1 != master then return -1 endi -if $data3_2 != null then +if $data3_2 != NULL then return -1 endi -if $data3_3 != null then +if $data3_3 != NULL then return -1 endi @@ -50,10 +50,10 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -81,7 +81,7 @@ endi if $dnode3Role != slave then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -110,7 +110,7 @@ endi if $dnode3Role != slave then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -131,7 +131,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -165,7 +165,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -207,7 +207,7 @@ print dnode2 ==> $dnode2Role print dnode3 ==> $dnode3Role print dnode4 ==> $dnode4Role -if $dnode1Role != null then +if $dnode1Role != NULL then return -1 endi if $dnode2Role != slave then diff --git a/tests/script/unique/mnode/mgmtr2.sim b/tests/script/unique/mnode/mgmtr2.sim index 097d510929..56a4b30573 100644 --- a/tests/script/unique/mnode/mgmtr2.sim +++ b/tests/script/unique/mnode/mgmtr2.sim @@ -23,10 +23,10 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -71,10 +71,15 @@ endi if $rows != 2 then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop -system sh/exec_up.sh -n dnode3 -s stop \ No newline at end of file +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/mnode/secondIp.sim b/tests/script/unique/mnode/secondIp.sim index 71c2cdfb76..cfe75ffc84 100644 --- a/tests/script/unique/mnode/secondIp.sim +++ b/tests/script/unique/mnode/secondIp.sim @@ -34,6 +34,11 @@ if $data4_2 != 4 then return -1 endi -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop -system sh/exec_up.sh -n dnode3 -s stop \ No newline at end of file +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/stream/metrics_balance.sim b/tests/script/unique/stream/metrics_balance.sim index ff6ca9d1f0..e711baf206 100644 --- a/tests/script/unique/stream/metrics_balance.sim +++ b/tests/script/unique/stream/metrics_balance.sim @@ -192,7 +192,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi diff --git a/tests/script/unique/stream/table_balance.sim b/tests/script/unique/stream/table_balance.sim index 015f9f1f17..7e33005b9b 100644 --- a/tests/script/unique/stream/table_balance.sim +++ b/tests/script/unique/stream/table_balance.sim @@ -129,7 +129,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi diff --git a/tests/script/unique/stream/table_move.sim b/tests/script/unique/stream/table_move.sim index 6589ed941e..54cd3195db 100644 --- a/tests/script/unique/stream/table_move.sim +++ b/tests/script/unique/stream/table_move.sim @@ -163,7 +163,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 6 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi @@ -214,7 +214,7 @@ print dnode1 $dnode1Vnodes $dnode2Vnodes = $data3_192.168.0.2 print dnode2 $dnode2Vnodes -if $dnode1Vnodes != null then +if $dnode1Vnodes != NULL then goto show6 endi if $dnode2Vnodes != 6 then diff --git a/tests/script/unique/table/delete_part.sim b/tests/script/unique/table/delete_part.sim index f4a7b6fce4..04cb03598c 100644 --- a/tests/script/unique/table/delete_part.sim +++ b/tests/script/unique/table/delete_part.sim @@ -1,9 +1,4 @@ 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 @@ -79,4 +74,12 @@ begin: $loop = $loop + 1 goto begin - \ No newline at end of file + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/table/testSuite.sim b/tests/script/unique/table/testSuite.sim index 373f358ac8..e0c0a1f2fa 100644 --- a/tests/script/unique/table/testSuite.sim +++ b/tests/script/unique/table/testSuite.sim @@ -1 +1 @@ -#run unique/table/delete_part.sim +run unique/table/delete_part.sim diff --git a/tests/script/unique/vnode/commit.sim b/tests/script/unique/vnode/commit.sim index dae6571667..29c9f72335 100644 --- a/tests/script/unique/vnode/commit.sim +++ b/tests/script/unique/vnode/commit.sim @@ -148,4 +148,11 @@ if $rows != $remainRows then return -1 endi -system sh/exec_up.sh -n dnode1 -s start +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/unique/vnode/many.sim b/tests/script/unique/vnode/many.sim index 544f7d5b55..0504207c2e 100644 --- a/tests/script/unique/vnode/many.sim +++ b/tests/script/unique/vnode/many.sim @@ -113,4 +113,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica2_basic.sim b/tests/script/unique/vnode/replica2_basic.sim index 8e18c3b9e7..a0ea7085cb 100644 --- a/tests/script/unique/vnode/replica2_basic.sim +++ b/tests/script/unique/vnode/replica2_basic.sim @@ -188,5 +188,12 @@ if $rows != $expect then endi print =================== step 12 -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica2_repeat.sim b/tests/script/unique/vnode/replica2_repeat.sim index cc1feecb07..f7da1babb7 100644 --- a/tests/script/unique/vnode/replica2_repeat.sim +++ b/tests/script/unique/vnode/replica2_repeat.sim @@ -71,4 +71,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica3_repeat.sim b/tests/script/unique/vnode/replica3_repeat.sim index 0ed16e0729..8c3ed902fb 100644 --- a/tests/script/unique/vnode/replica3_repeat.sim +++ b/tests/script/unique/vnode/replica3_repeat.sim @@ -80,4 +80,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica3_vgroup.sim b/tests/script/unique/vnode/replica3_vgroup.sim index 2763ed7c67..f63bf1783d 100644 --- a/tests/script/unique/vnode/replica3_vgroup.sim +++ b/tests/script/unique/vnode/replica3_vgroup.sim @@ -61,5 +61,11 @@ endw # return -1 #endi - - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/testSuite.sim b/tests/script/unique/vnode/testSuite.sim index 9cf8ed0fc1..46b01aaa45 100644 --- a/tests/script/unique/vnode/testSuite.sim +++ b/tests/script/unique/vnode/testSuite.sim @@ -1,7 +1,8 @@ +run unique/vnode/commit.sim +run unique/vnode/many.sim +run unique/vnode/replica2_basic.sim run unique/vnode/replica2_basic2.sim -#run unique/vnode/replica2_basic.sim -#run unique/vnode/replica2_repeat.sim +run unique/vnode/replica2_repeat.sim run unique/vnode/replica3_basic.sim -#run unique/vnode/replica3_repeat.sim -#run unique/vnode/commit.sim -#run unique/vnode/many.sim +run unique/vnode/replica3_repeat.sim +run unique/vnode/replica3_vgroup.sim diff --git a/tests/script/windows/alter/metrics.sim b/tests/script/windows/alter/metrics.sim index 7cfee695d0..ce003a9836 100644 --- a/tests/script/windows/alter/metrics.sim +++ b/tests/script/windows/alter/metrics.sim @@ -763,7 +763,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi diff --git a/tests/script/windows/alter/table.sim b/tests/script/windows/alter/table.sim index a05b6559dd..155debda0d 100644 --- a/tests/script/windows/alter/table.sim +++ b/tests/script/windows/alter/table.sim @@ -666,7 +666,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != null then +if $data20 != NULL then return -1 endi diff --git a/tests/script/windows/tag/add.sim b/tests/script/windows/tag/add.sim index b734846686..adcff4f62d 100644 --- a/tests/script/windows/tag/add.sim +++ b/tests/script/windows/tag/add.sim @@ -537,7 +537,7 @@ endi if $data04 != false then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi diff --git a/tests/script/windows/tag/change.sim b/tests/script/windows/tag/change.sim index 201c74c0bf..95a767da49 100644 --- a/tests/script/windows/tag/change.sim +++ b/tests/script/windows/tag/change.sim @@ -386,7 +386,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -413,7 +413,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -440,7 +440,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -467,7 +467,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -494,7 +494,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/script/windows/tag/delete.sim b/tests/script/windows/tag/delete.sim index d671b61abe..75702fe9ee 100644 --- a/tests/script/windows/tag/delete.sim +++ b/tests/script/windows/tag/delete.sim @@ -420,7 +420,7 @@ endi if $data02 != true then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -444,7 +444,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -468,7 +468,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -492,7 +492,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -516,10 +516,10 @@ endi if $data02 != true then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -546,10 +546,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -576,10 +576,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -606,10 +606,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -636,13 +636,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -675,13 +675,13 @@ endi if $data03 != 4.0000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi @@ -714,16 +714,16 @@ endi if $data03 != 4.000000000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -763,13 +763,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/script/windows/tag/set.sim b/tests/script/windows/tag/set.sim index 7f8cf3b0a7..b264164604 100644 --- a/tests/script/windows/tag/set.sim +++ b/tests/script/windows/tag/set.sim @@ -330,7 +330,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -357,7 +357,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -384,7 +384,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -411,7 +411,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -438,7 +438,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 660ed6f44f..bd07918ddc 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -584,7 +584,7 @@ bool simCreateNativeConnect(SScript *script, char *user, char *pass) { void *taos = NULL; taosMsleep(2000); for (int attempt = 0; attempt < 10; ++attempt) { - taos = taos_connect(NULL, user, pass, NULL, tsMnodeShellPort); + taos = taos_connect(NULL, user, pass, NULL, tsDnodeShellPort); if (taos == NULL) { simTrace("script:%s, user:%s connect taosd failed:%s, attempt:%d", script->fileName, user, taos_errstr(NULL), attempt); taosMsleep(1000);