提交 56c54b90 编写于 作者: H hzcheng

Merge branch 'develop' into feature/2.0tsdb

...@@ -300,7 +300,6 @@ typedef struct STscObj { ...@@ -300,7 +300,6 @@ typedef struct STscObj {
char sversion[TSDB_VERSION_LEN]; char sversion[TSDB_VERSION_LEN];
char writeAuth : 1; char writeAuth : 1;
char superAuth : 1; char superAuth : 1;
void* pMgmtConn;
struct SSqlObj * pSql; struct SSqlObj * pSql;
struct SSqlObj * pHb; struct SSqlObj * pHb;
struct SSqlObj * sqlList; struct SSqlObj * sqlList;
...@@ -360,7 +359,7 @@ typedef struct SSqlStream { ...@@ -360,7 +359,7 @@ typedef struct SSqlStream {
struct SSqlStream *prev, *next; struct SSqlStream *prev, *next;
} SSqlStream; } SSqlStream;
int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn); int32_t tscInitRpc(const char *user, const char *secret);
void tscInitMsgsFp(); void tscInitMsgsFp();
int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion); int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion);
...@@ -426,7 +425,7 @@ void tscQueueAsyncFreeResult(SSqlObj *pSql); ...@@ -426,7 +425,7 @@ void tscQueueAsyncFreeResult(SSqlObj *pSql);
int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo); int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo);
void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column); void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column);
extern void * pVnodeConn; extern void * pDnodeConn;
extern void * tscCacheHandle; extern void * tscCacheHandle;
extern void * tscTmr; extern void * tscTmr;
extern void * tscQhandle; extern void * tscQhandle;
......
...@@ -191,7 +191,6 @@ void tscProcessActivityTimer(void *handle, void *tmrId) { ...@@ -191,7 +191,6 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
} }
int tscSendMsgToServer(SSqlObj *pSql) { int tscSendMsgToServer(SSqlObj *pSql) {
STscObj* pObj = pSql->pTscObj;
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
char *pMsg = rpcMallocCont(pCmd->payloadLen); char *pMsg = rpcMallocCont(pCmd->payloadLen);
...@@ -201,20 +200,14 @@ int tscSendMsgToServer(SSqlObj *pSql) { ...@@ -201,20 +200,14 @@ int tscSendMsgToServer(SSqlObj *pSql) {
} }
if (pSql->cmd.command < TSDB_SQL_MGMT) { 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); memcpy(pMsg, pSql->cmd.payload + tsRpcHeadSize, pSql->cmd.payloadLen);
SRpcMsg rpcMsg = {
.msgType = pSql->cmd.msgType,
.pCont = pMsg,
.contLen = pSql->cmd.payloadLen,
.handle = pSql,
.code = 0
};
rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg);
} else { } else {
pSql->ipList = tscMgmtIpSet; pSql->ipList = tscMgmtIpSet;
memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen);
}
tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]);
SRpcMsg rpcMsg = { SRpcMsg rpcMsg = {
.msgType = pSql->cmd.msgType, .msgType = pSql->cmd.msgType,
.pCont = pMsg, .pCont = pMsg,
...@@ -222,9 +215,7 @@ int tscSendMsgToServer(SSqlObj *pSql) { ...@@ -222,9 +215,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
.handle = pSql, .handle = pSql,
.code = 0 .code = 0
}; };
tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]); rpcSendRequest(pDnodeConn, &pSql->ipList, &rpcMsg);
rpcSendRequest(pObj->pMgmtConn, &pSql->ipList, &rpcMsg);
}
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -485,7 +476,7 @@ void tscKillSTableQuery(SSqlObj *pSql) { ...@@ -485,7 +476,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
tscTrace("%p super table query cancelled", pSql); tscTrace("%p super table query cancelled", pSql);
} }
int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
char *pMsg, *pStart; char *pMsg, *pStart;
pStart = pSql->cmd.payload + tsRpcHeadSize; pStart = pSql->cmd.payload + tsRpcHeadSize;
...@@ -514,7 +505,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -514,7 +505,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pRetrieveMsg->header.contLen = htonl(pSql->cmd.payloadLen); 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; return TSDB_CODE_SUCCESS;
} }
...@@ -1353,7 +1344,7 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1353,7 +1344,7 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
pCmd->msgType = TSDB_MSG_TYPE_RETRIEVE; pCmd->msgType = TSDB_MSG_TYPE_CM_RETRIEVE;
pCmd->payloadLen = sizeof(SRetrieveTableMsg); pCmd->payloadLen = sizeof(SRetrieveTableMsg);
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
...@@ -2569,7 +2560,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) { ...@@ -2569,7 +2560,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
void tscInitMsgsFp() { void tscInitMsgsFp() {
tscBuildMsg[TSDB_SQL_SELECT] = tscBuildQueryMsg; tscBuildMsg[TSDB_SQL_SELECT] = tscBuildQueryMsg;
tscBuildMsg[TSDB_SQL_INSERT] = tscBuildSubmitMsg; 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_DB] = tscBuildCreateDbMsg;
tscBuildMsg[TSDB_SQL_CREATE_USER] = tscBuildUserMsg; tscBuildMsg[TSDB_SQL_CREATE_USER] = tscBuildUserMsg;
......
...@@ -66,8 +66,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con ...@@ -66,8 +66,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
return NULL; return NULL;
} }
void* pMgmtConn = NULL; if (tscInitRpc(user, pass) != 0) {
if (tscInitRpc(user, pass, &pMgmtConn) != 0) {
terrno = TSDB_CODE_NETWORK_UNAVAIL; terrno = TSDB_CODE_NETWORK_UNAVAIL;
return NULL; return NULL;
} }
...@@ -78,7 +77,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con ...@@ -78,7 +77,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
tscMgmtIpSet.inUse = 0; tscMgmtIpSet.inUse = 0;
tscMgmtIpSet.numOfIps = 1; tscMgmtIpSet.numOfIps = 1;
strcpy(tscMgmtIpSet.fqdn[0], ip); strcpy(tscMgmtIpSet.fqdn[0], ip);
tscMgmtIpSet.port[0] = port? port: tsMnodeShellPort; tscMgmtIpSet.port[0] = port? port: tsDnodeShellPort;
} else { } else {
if (tsFirst[0] != 0) { if (tsFirst[0] != 0) {
taosGetFqdnPortFromEp(tsFirst, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]); 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 ...@@ -101,7 +100,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
strncpy(pObj->user, user, TSDB_USER_LEN); strncpy(pObj->user, user, TSDB_USER_LEN);
taosEncryptPass((uint8_t *)pass, strlen(pass), pObj->pass); taosEncryptPass((uint8_t *)pass, strlen(pass), pObj->pass);
pObj->mgmtPort = port ? port : tsMnodeShellPort; pObj->mgmtPort = port ? port : tsDnodeShellPort;
if (db) { if (db) {
int32_t len = strlen(db); int32_t len = strlen(db);
...@@ -119,7 +118,6 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con ...@@ -119,7 +118,6 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
strtolower(pObj->db, tmp); strtolower(pObj->db, tmp);
} }
pObj->pMgmtConn = pMgmtConn;
pthread_mutex_init(&pObj->mutex, NULL); pthread_mutex_init(&pObj->mutex, NULL);
SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj)); SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj));
...@@ -168,13 +166,6 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) { ...@@ -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) { 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); 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); STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL);
if (pObj != NULL) { if (pObj != NULL) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "tlocale.h" #include "tlocale.h"
// global, not configurable // global, not configurable
void * pVnodeConn; void * pDnodeConn;
void * tscCacheHandle; void * tscCacheHandle;
void * tscTmr; void * tscTmr;
void * tscQhandle; void * tscQhandle;
...@@ -48,15 +48,15 @@ void tscCheckDiskUsage(void *UNUSED_PARAM(para), void* UNUSED_PARAM(param)) { ...@@ -48,15 +48,15 @@ void tscCheckDiskUsage(void *UNUSED_PARAM(para), void* UNUSED_PARAM(param)) {
taosTmrReset(tscCheckDiskUsage, 1000, NULL, tscTmr, &tscCheckDiskUsageTmr); 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; SRpcInit rpcInit;
char secretEncrypt[32] = {0}; char secretEncrypt[32] = {0};
taosEncryptPass((uint8_t *)secret, strlen(secret), secretEncrypt); taosEncryptPass((uint8_t *)secret, strlen(secret), secretEncrypt);
if (pVnodeConn == NULL) { if (pDnodeConn == NULL) {
memset(&rpcInit, 0, sizeof(rpcInit)); memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = 0; rpcInit.localPort = 0;
rpcInit.label = "TSC-vnode"; rpcInit.label = "TSC";
rpcInit.numOfThreads = tscNumOfThreads; rpcInit.numOfThreads = tscNumOfThreads;
rpcInit.cfp = tscProcessMsgFromServer; rpcInit.cfp = tscProcessMsgFromServer;
rpcInit.sessions = tsMaxVnodeConnections; rpcInit.sessions = tsMaxVnodeConnections;
...@@ -66,35 +66,13 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) { ...@@ -66,35 +66,13 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) {
rpcInit.ckey = "key"; rpcInit.ckey = "key";
rpcInit.secret = secretEncrypt; rpcInit.secret = secretEncrypt;
pVnodeConn = rpcOpen(&rpcInit); pDnodeConn = rpcOpen(&rpcInit);
if (pVnodeConn == NULL) { if (pDnodeConn == NULL) {
tscError("failed to init connection to vnode"); tscError("failed to init connection to vnode");
return -1; 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; return 0;
} }
...@@ -190,9 +168,9 @@ void taos_cleanup() { ...@@ -190,9 +168,9 @@ void taos_cleanup() {
taosCloseLog(); taosCloseLog();
if (pVnodeConn != NULL) { if (pDnodeConn != NULL) {
rpcClose(pVnodeConn); rpcClose(pDnodeConn);
pVnodeConn = NULL; pDnodeConn = NULL;
} }
taosTmrCleanUp(tscTmr); taosTmrCleanUp(tscTmr);
......
...@@ -755,7 +755,10 @@ void tscCloseTscObj(STscObj* pObj) { ...@@ -755,7 +755,10 @@ void tscCloseTscObj(STscObj* pObj) {
taosTmrStopA(&(pObj->pTimer)); taosTmrStopA(&(pObj->pTimer));
tscFreeSqlObj(pSql); tscFreeSqlObj(pSql);
rpcClose(pObj->pMgmtConn); if (pSql) {
sem_destroy(&pSql->rspSem);
}
pthread_mutex_destroy(&pObj->mutex); pthread_mutex_destroy(&pObj->mutex);
tscTrace("%p DB connection is closed", pObj); tscTrace("%p DB connection is closed", pObj);
......
...@@ -55,10 +55,8 @@ extern char tsFirst[]; ...@@ -55,10 +55,8 @@ extern char tsFirst[];
extern char tsSecond[]; extern char tsSecond[];
extern char tsLocalEp[]; extern char tsLocalEp[];
extern uint16_t tsServerPort; extern uint16_t tsServerPort;
extern uint16_t tsMnodeDnodePort;
extern uint16_t tsMnodeShellPort;
extern uint16_t tsDnodeShellPort; extern uint16_t tsDnodeShellPort;
extern uint16_t tsDnodeMnodePort; extern uint16_t tsDnodeDnodePort;
extern uint16_t tsSyncPort; extern uint16_t tsSyncPort;
extern int32_t tsStatusInterval; extern int32_t tsStatusInterval;
...@@ -141,7 +139,8 @@ extern int32_t tsMonitorInterval; ...@@ -141,7 +139,8 @@ extern int32_t tsMonitorInterval;
extern int32_t tsAsyncLog; extern int32_t tsAsyncLog;
extern int32_t tsNumOfLogLines; extern int32_t tsNumOfLogLines;
extern int32_t ddebugFlag; extern int32_t dDebugFlag;
extern int32_t vDebugFlag;
extern int32_t mdebugFlag; extern int32_t mdebugFlag;
extern int32_t cdebugFlag; extern int32_t cdebugFlag;
extern int32_t jnidebugFlag; extern int32_t jnidebugFlag;
......
...@@ -66,11 +66,9 @@ char tsSecond[TSDB_FQDN_LEN] = {0}; ...@@ -66,11 +66,9 @@ char tsSecond[TSDB_FQDN_LEN] = {0};
char tsArbitrator[TSDB_FQDN_LEN] = {0}; char tsArbitrator[TSDB_FQDN_LEN] = {0};
char tsLocalEp[TSDB_FQDN_LEN] = {0}; // Local End Point, hostname:port char tsLocalEp[TSDB_FQDN_LEN] = {0}; // Local End Point, hostname:port
uint16_t tsServerPort = 6030; uint16_t tsServerPort = 6030;
uint16_t tsMnodeShellPort = 6030; // udp[6030-6034] tcp[6030] uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035]
uint16_t tsDnodeShellPort = 6035; // udp[6035-6039] tcp[6035] uint16_t tsDnodeDnodePort = 6035; // udp/tcp
uint16_t tsMnodeDnodePort = 6040; // udp/tcp uint16_t tsSyncPort = 6040;
uint16_t tsDnodeMnodePort = 6045; // udp/tcp
uint16_t tsSyncPort = 6050;
int32_t tsStatusInterval = 1; // second int32_t tsStatusInterval = 1; // second
int32_t tsShellActivityTimer = 3; // second int32_t tsShellActivityTimer = 3; // second
...@@ -131,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN; ...@@ -131,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
int32_t tsNumOfLogLines = 10000000; int32_t tsNumOfLogLines = 10000000;
int32_t mdebugFlag = 135; int32_t mdebugFlag = 135;
int32_t sdbDebugFlag = 135; int32_t sdbDebugFlag = 135;
int32_t ddebugFlag = 131; int32_t dDebugFlag = 135;
int32_t cdebugFlag = 131; int32_t vDebugFlag = 135;
int32_t cdebugFlag = 135;
int32_t jnidebugFlag = 131; int32_t jnidebugFlag = 131;
int32_t odbcdebugFlag = 131; int32_t odbcdebugFlag = 131;
int32_t httpDebugFlag = 131; int32_t httpDebugFlag = 131;
int32_t monitorDebugFlag = 131; int32_t monitorDebugFlag = 131;
int32_t qdebugFlag = 131; int32_t qdebugFlag = 131;
int32_t rpcDebugFlag = 131; int32_t rpcDebugFlag = 135;
int32_t uDebugFlag = 131; int32_t uDebugFlag = 131;
int32_t debugFlag = 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 // the maximum number of results for projection query on super table that are returned from
// one virtual node, to order according to timestamp // one virtual node, to order according to timestamp
...@@ -1004,7 +1003,7 @@ static void doInitGlobalConfig() { ...@@ -1004,7 +1003,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
cfg.option = "dDebugFlag"; cfg.option = "dDebugFlag";
cfg.ptr = &ddebugFlag; cfg.ptr = &dDebugFlag;
cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG;
cfg.minValue = 0; cfg.minValue = 0;
...@@ -1233,10 +1232,8 @@ bool taosCheckGlobalCfg() { ...@@ -1233,10 +1232,8 @@ bool taosCheckGlobalCfg() {
tsVersion = 10 * tsVersion; tsVersion = 10 * tsVersion;
tsMnodeShellPort = tsServerPort + TSDB_PORT_MNODESHELL; // udp[6030-6034] tcp[6030]
tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035]
tsMnodeDnodePort = tsServerPort + TSDB_PORT_MNODEDNODE; // udp/tcp tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp
tsDnodeMnodePort = tsServerPort + TSDB_PORT_DNODEMNODE; // udp/tcp
tsSyncPort = tsServerPort + TSDB_PORT_SYNC; tsSyncPort = tsServerPort + TSDB_PORT_SYNC;
return true; return true;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __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 cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);}
#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);} #define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);}
#define cPrint(...) {taosPrintLog("WAL ", 255, __VA_ARGS__);} #define cPrint(...) {taosPrintLog("CQ ", 255, __VA_ARGS__);}
typedef struct { typedef struct {
int vgId; int vgId;
......
...@@ -33,13 +33,13 @@ int main(int argc, char *argv[]) { ...@@ -33,13 +33,13 @@ int main(int argc, char *argv[]) {
for (int i=1; i<argc; ++i) { for (int i=1; i<argc; ++i) {
if (strcmp(argv[i], "-d")==0 && i < argc-1) { if (strcmp(argv[i], "-d")==0 && i < argc-1) {
ddebugFlag = atoi(argv[++i]); dDebugFlag = atoi(argv[++i]);
} else if (strcmp(argv[i], "-n") == 0 && i <argc-1) { } else if (strcmp(argv[i], "-n") == 0 && i <argc-1) {
num = atoi(argv[++i]); num = atoi(argv[++i]);
} else { } else {
printf("\nusage: %s [options] \n", argv[0]); printf("\nusage: %s [options] \n", argv[0]);
printf(" [-n num]: number of streams, default:%d\n", num); printf(" [-n num]: number of streams, default:%d\n", num);
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"); printf(" [-h help]: print out this help\n\n");
exit(0); exit(0);
} }
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
int32_t dnodeInitMgmt(); int32_t dnodeInitMgmt();
void dnodeCleanupMgmt(); void dnodeCleanupMgmt();
void dnodeMgmt(SRpcMsg *rpcMsg); void dnodeDispatchToDnodeMgmt(SRpcMsg *rpcMsg);
void* dnodeGetVnode(int32_t vgId); void* dnodeGetVnode(int32_t vgId);
int32_t dnodeGetVnodeStatus(void *pVnode); int32_t dnodeGetVnodeStatus(void *pVnode);
......
...@@ -13,16 +13,17 @@ ...@@ -13,16 +13,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef TDENGINE_DNODE_MCLIENT_H #ifndef TDENGINE_DNODE_DNODE_H
#define TDENGINE_DNODE_MCLIENT_H #define TDENGINE_DNODE_DNODE_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int32_t dnodeInitMClient(); int32_t dnodeInitServer();
void dnodeCleanupMClient(); void dnodeCleanupServer();
void dnodeSendMsgToMnode(SRpcMsg *rpcMsg); int32_t dnodeInitClient();
void dnodeCleanupClient();
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
int32_t dnodeInitRead(); int32_t dnodeInitRead();
void dnodeCleanupRead(); void dnodeCleanupRead();
void dnodeRead(SRpcMsg *pMsg); void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
int32_t dnodeInitWrite(); int32_t dnodeInitWrite();
void dnodeCleanupWrite(); void dnodeCleanupWrite();
void dnodeWrite(SRpcMsg *pMsg); void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg);
void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code); void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code);
#ifdef __cplusplus #ifdef __cplusplus
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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;
}
...@@ -22,14 +22,13 @@ ...@@ -22,14 +22,13 @@
#include "tconfig.h" #include "tconfig.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h" #include "dnode.h"
#include "dnodeLog.h" #include "dnodeInt.h"
#include "dnodeMClient.h"
#include "dnodeMgmt.h" #include "dnodeMgmt.h"
#include "dnodeMnode.h" #include "dnodePeer.h"
#include "dnodeModule.h" #include "dnodeModule.h"
#include "dnodeRead.h" #include "dnodeVRead.h"
#include "dnodeShell.h" #include "dnodeShell.h"
#include "dnodeWrite.h" #include "dnodeVWrite.h"
#include "tgrant.h" #include "tgrant.h"
static int32_t dnodeInitSystem(); static int32_t dnodeInitSystem();
...@@ -167,9 +166,9 @@ static int32_t dnodeInitSystem() { ...@@ -167,9 +166,9 @@ static int32_t dnodeInitSystem() {
if (dnodeInitStorage() != 0) return -1; if (dnodeInitStorage() != 0) return -1;
if (dnodeInitRead() != 0) return -1; if (dnodeInitRead() != 0) return -1;
if (dnodeInitWrite() != 0) return -1; if (dnodeInitWrite() != 0) return -1;
if (dnodeInitMClient() != 0) return -1; if (dnodeInitClient() != 0) return -1;
if (dnodeInitModules() != 0) return -1; if (dnodeInitModules() != 0) return -1;
if (dnodeInitMnode() != 0) return -1; if (dnodeInitServer() != 0) return -1;
if (dnodeInitMgmt() != 0) return -1; if (dnodeInitMgmt() != 0) return -1;
if (dnodeInitShell() != 0) return -1; if (dnodeInitShell() != 0) return -1;
...@@ -185,9 +184,9 @@ static void dnodeCleanUpSystem() { ...@@ -185,9 +184,9 @@ static void dnodeCleanUpSystem() {
if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) { if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) {
dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED); dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED);
dnodeCleanupShell(); dnodeCleanupShell();
dnodeCleanupMnode(); dnodeCleanupServer();
dnodeCleanupMgmt(); dnodeCleanupMgmt();
dnodeCleanupMClient(); dnodeCleanupClient();
dnodeCleanupWrite(); dnodeCleanupWrite();
dnodeCleanupRead(); dnodeCleanupRead();
dnodeCleanUpModules(); dnodeCleanUpModules();
......
...@@ -15,19 +15,47 @@ ...@@ -15,19 +15,47 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "cJSON.h"
#include "ihash.h" #include "ihash.h"
#include "taoserror.h" #include "taoserror.h"
#include "taosmsg.h" #include "taosmsg.h"
#include "ttime.h"
#include "ttimer.h"
#include "trpc.h" #include "trpc.h"
#include "tsdb.h" #include "tsdb.h"
#include "twal.h" #include "twal.h"
#include "vnode.h" #include "tsync.h"
#include "ttime.h"
#include "ttimer.h"
#include "tbalance.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnodeLog.h" #include "dnode.h"
#include "dnodeMClient.h" #include "vnode.h"
#include "mnode.h"
#include "dnodeInt.h"
#include "dnodeMgmt.h" #include "dnodeMgmt.h"
#include "dnodeRead.h" #include "dnodeVRead.h"
#include "dnodeWrite.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 int32_t dnodeOpenVnodes();
static void dnodeCloseVnodes(); static void dnodeCloseVnodes();
...@@ -43,19 +71,63 @@ int32_t dnodeInitMgmt() { ...@@ -43,19 +71,63 @@ int32_t dnodeInitMgmt() {
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg;
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeProcessConfigDnodeMsg; 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(); int32_t code = dnodeOpenVnodes();
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
return -1; return -1;
} }
taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer);
dPrint("dnode mgmt is initialized");
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
void dnodeCleanupMgmt() { void dnodeCleanupMgmt() {
if (tsStatusTimer != NULL) {
taosTmrStopA(&tsStatusTimer);
tsStatusTimer = NULL;
}
if (tsDnodeTmr != NULL) {
taosTmrCleanUp(tsDnodeTmr);
tsDnodeTmr = NULL;
}
dnodeCloseVnodes(); dnodeCloseVnodes();
} }
void dnodeMgmt(SRpcMsg *pMsg) { void dnodeDispatchToDnodeMgmt(SRpcMsg *pMsg) {
SRpcMsg rsp; SRpcMsg rsp;
if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { if (dnodeProcessMgmtMsgFp[pMsg->msgType]) {
...@@ -116,7 +188,7 @@ static int32_t dnodeOpenVnodes() { ...@@ -116,7 +188,7 @@ static int32_t dnodeOpenVnodes() {
free(vnodeList); 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; return TSDB_CODE_SUCCESS;
} }
...@@ -193,3 +265,326 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) { ...@@ -193,3 +265,326 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
SMDCfgDnodeMsg *pCfg = (SMDCfgDnodeMsg *)pMsg->pCont; SMDCfgDnodeMsg *pCfg = (SMDCfgDnodeMsg *)pMsg->pCont;
return taosCfgDynamicOptions(pCfg->config); 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;
}
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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);
}
}
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
#include "os.h" #include "os.h"
#include "taosdef.h" #include "taosdef.h"
#include "tglobal.h" #include "tglobal.h"
#include "trpc.h"
#include "mnode.h" #include "mnode.h"
#include "http.h" #include "http.h"
#include "monitor.h" #include "monitor.h"
#include "dnodeLog.h" #include "dnodeInt.h"
#include "dnodeModule.h" #include "dnodeModule.h"
typedef struct { typedef struct {
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/* 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);
}
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#include "tglobal.h" #include "tglobal.h"
#include "http.h" #include "http.h"
#include "dnode.h" #include "dnode.h"
#include "dnodeLog.h" #include "dnodeInt.h"
#include "dnodeRead.h" #include "dnodeVRead.h"
#include "dnodeWrite.h" #include "dnodeVWrite.h"
#include "dnodeShell.h" #include "dnodeShell.h"
static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *);
...@@ -34,10 +34,43 @@ static void * tsDnodeShellRpc = NULL; ...@@ -34,10 +34,43 @@ static void * tsDnodeShellRpc = NULL;
static int32_t tsDnodeQueryReqNum = 0; static int32_t tsDnodeQueryReqNum = 0;
static int32_t tsDnodeSubmitReqNum = 0; static int32_t tsDnodeSubmitReqNum = 0;
void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg);
int32_t dnodeInitShell() { int32_t dnodeInitShell() {
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeWrite; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeDispatchToVnodeWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeRead; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeDispatchToVnodeReadQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_RETRIEVE] = dnodeRead; 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; int32_t numOfThreads = tsNumOfCores * tsNumOfThreadsPerCore;
numOfThreads = (int32_t) ((1.0 - tsRatioOfQueryThreads) * numOfThreads / 2.0); numOfThreads = (int32_t) ((1.0 - tsRatioOfQueryThreads) * numOfThreads / 2.0);
...@@ -48,7 +81,7 @@ int32_t dnodeInitShell() { ...@@ -48,7 +81,7 @@ int32_t dnodeInitShell() {
SRpcInit rpcInit; SRpcInit rpcInit;
memset(&rpcInit, 0, sizeof(rpcInit)); memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = tsDnodeShellPort; rpcInit.localPort = tsDnodeShellPort;
rpcInit.label = "DND-shell"; rpcInit.label = "SHELL";
rpcInit.numOfThreads = numOfThreads; rpcInit.numOfThreads = numOfThreads;
rpcInit.cfp = dnodeProcessMsgFromShell; rpcInit.cfp = dnodeProcessMsgFromShell;
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE; rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
...@@ -80,7 +113,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { ...@@ -80,7 +113,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) {
rpcMsg.contLen = 0; rpcMsg.contLen = 0;
if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { 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; rpcMsg.code = TSDB_CODE_NOT_READY;
rpcSendResponse(&rpcMsg); rpcSendResponse(&rpcMsg);
rpcFreeCont(pMsg->pCont); rpcFreeCont(pMsg->pCont);
...@@ -96,13 +129,15 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { ...@@ -96,13 +129,15 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) {
if ( dnodeProcessShellMsgFp[pMsg->msgType] ) { if ( dnodeProcessShellMsgFp[pMsg->msgType] ) {
(*dnodeProcessShellMsgFp[pMsg->msgType])(pMsg); (*dnodeProcessShellMsgFp[pMsg->msgType])(pMsg);
} else { } 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; rpcMsg.code = TSDB_CODE_MSG_NOT_PROCESSED;
rpcSendResponse(&rpcMsg); rpcSendResponse(&rpcMsg);
rpcFreeCont(pMsg->pCont); rpcFreeCont(pMsg->pCont);
return;
} }
} }
static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) { static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#include "trpc.h" #include "trpc.h"
#include "twal.h" #include "twal.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnodeLog.h" #include "dnodeInt.h"
#include "dnodeMgmt.h" #include "dnodeMgmt.h"
#include "dnodeRead.h" #include "dnodeVRead.h"
#include "vnode.h" #include "vnode.h"
typedef struct { typedef struct {
...@@ -84,7 +84,7 @@ void dnodeCleanupRead() { ...@@ -84,7 +84,7 @@ void dnodeCleanupRead() {
dPrint("dnode read is closed"); dPrint("dnode read is closed");
} }
void dnodeRead(SRpcMsg *pMsg) { void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) {
int32_t queuedMsgNum = 0; int32_t queuedMsgNum = 0;
int32_t leftLen = pMsg->contLen; int32_t leftLen = pMsg->contLen;
char *pCont = (char *) pMsg->pCont; char *pCont = (char *) pMsg->pCont;
...@@ -97,7 +97,7 @@ void dnodeRead(SRpcMsg *pMsg) { ...@@ -97,7 +97,7 @@ void dnodeRead(SRpcMsg *pMsg) {
pHead->vgId = htonl(pHead->vgId); pHead->vgId = htonl(pHead->vgId);
pHead->contLen = htonl(pHead->contLen); pHead->contLen = htonl(pHead->contLen);
if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { if (pMsg->msgType == TSDB_MSG_TYPE_FETCH) {
pVnode = vnodeGetVnode(pHead->vgId); pVnode = vnodeGetVnode(pHead->vgId);
} else { } else {
pVnode = vnodeAccquireVnode(pHead->vgId); pVnode = vnodeAccquireVnode(pHead->vgId);
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
#include "tglobal.h" #include "tglobal.h"
#include "vnode.h" #include "vnode.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "dnodeLog.h" #include "dnodeInt.h"
#include "dnodeWrite.h" #include "dnodeVWrite.h"
#include "dnodeMgmt.h" #include "dnodeMgmt.h"
typedef struct { typedef struct {
...@@ -82,7 +82,7 @@ void dnodeCleanupWrite() { ...@@ -82,7 +82,7 @@ void dnodeCleanupWrite() {
dPrint("dnode write is closed"); dPrint("dnode write is closed");
} }
void dnodeWrite(SRpcMsg *pMsg) { void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
char *pCont = (char *)pMsg->pCont; char *pCont = (char *)pMsg->pCont;
if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) { if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
extern "C" { extern "C" {
#endif #endif
#include "trpc.h"
typedef struct { typedef struct {
int32_t queryReqNum; int32_t queryReqNum;
int32_t submitReqNum; int32_t submitReqNum;
...@@ -47,6 +49,10 @@ void dnodeGetMnodeDnodeIpSet(void *ipSet); ...@@ -47,6 +49,10 @@ void dnodeGetMnodeDnodeIpSet(void *ipSet);
void * dnodeGetMnodeInfos(); void * dnodeGetMnodeInfos();
int32_t dnodeGetDnodeId(); 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 #ifdef __cplusplus
} }
#endif #endif
......
...@@ -26,6 +26,9 @@ void mgmtCleanUpSystem(); ...@@ -26,6 +26,9 @@ void mgmtCleanUpSystem();
void mgmtStopSystem(); void mgmtStopSystem();
void sdbUpdateSync(); void sdbUpdateSync();
void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg);
void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -338,11 +338,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); ...@@ -338,11 +338,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_MAX_NORMAL_TABLES 1000 #define TSDB_MAX_NORMAL_TABLES 1000
#define TSDB_MAX_CHILD_TABLES 100000 #define TSDB_MAX_CHILD_TABLES 100000
#define TSDB_PORT_MNODESHELL 0 #define TSDB_PORT_DNODESHELL 0
#define TSDB_PORT_DNODESHELL 5 #define TSDB_PORT_DNODEDNODE 5
#define TSDB_PORT_DNODEMNODE 10 #define TSDB_PORT_SYNC 10
#define TSDB_PORT_MNODEDNODE 15
#define TSDB_PORT_SYNC 20
#define TAOS_QTYPE_RPC 0 #define TAOS_QTYPE_RPC 0
#define TAOS_QTYPE_FWD 1 #define TAOS_QTYPE_FWD 1
......
...@@ -39,56 +39,70 @@ enum { ...@@ -39,56 +39,70 @@ enum {
TSDB_MESSAGE_NULL = 0, TSDB_MESSAGE_NULL = 0,
#endif #endif
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_REG, "registration" ) // 1 // message from client to dnode
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" ) // 3 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" ) // 5 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_RETRIEVE, "retrieve" ) // 7 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 // 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_CREATE_TABLE, "create-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" ) // 11 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" ) // 13 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" ) // 15 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" ) // 17 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" ) // 19 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" ) // 21 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) // 23 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 // message from client to mnode
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) // 31 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) // 33 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" ) // 35 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" ) // 37 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" ) // 39 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" ) // 41 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" ) // 43 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" ) // 45 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" ) // 47 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" ) // 49 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" ) // 51 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" ) // 53 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" ) // 55 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" ) // 57 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) // 59 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) // 61 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) // 63 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) // 65 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" ) // 67 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) // 69 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) // 71 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" ) // 73 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_RETRIEVE, "retrieve" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" ) // 75 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_CONN, "kill-conn" ) // 77 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_HEARTBEAT, "heartbeat" ) // 79 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 // 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_TABLE, "config-table" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" ) // 93 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" ) // 95 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_GRANT, "grant" ) // 97 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_SDB_SYNC, "sdb-sync" ) // 101 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY13, "dummy13" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 103 TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" )
#ifndef TAOS_MESSAGE_C #ifndef TAOS_MESSAGE_C
TSDB_MSG_TYPE_MAX // 105 TSDB_MSG_TYPE_MAX // 105
...@@ -96,9 +110,6 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 10 ...@@ -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 // IE type
#define TSDB_IE_TYPE_SEC 1 #define TSDB_IE_TYPE_SEC 1
#define TSDB_IE_TYPE_META 2 #define TSDB_IE_TYPE_META 2
......
...@@ -54,8 +54,8 @@ typedef struct { ...@@ -54,8 +54,8 @@ typedef struct {
int role[TAOS_SYNC_MAX_REPLICA]; int role[TAOS_SYNC_MAX_REPLICA];
} SNodesRole; } SNodesRole;
// if name is null, get the file from index or after, used by master // if name is empty(name[0] is zero), 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 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. // 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); 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); ...@@ -72,6 +72,9 @@ typedef void (*FConfirmForward)(void *ahandle, void *mhandle, int32_t code);
// when role is changed, call this to notify app // when role is changed, call this to notify app
typedef void (*FNotifyRole)(void *ahandle, int8_t role); typedef void (*FNotifyRole)(void *ahandle, int8_t role);
// when data file is synced successfully, notity app
typedef void (*FNotifyFileSynced)(void *ahandle);
typedef struct { typedef struct {
int32_t vgId; // vgroup ID int32_t vgId; // vgroup ID
uint64_t version; // initial version uint64_t version; // initial version
...@@ -84,7 +87,7 @@ typedef struct { ...@@ -84,7 +87,7 @@ typedef struct {
FWriteToCache writeToCache; FWriteToCache writeToCache;
FConfirmForward confirmForward; FConfirmForward confirmForward;
FNotifyRole notifyRole; FNotifyRole notifyRole;
FNotifyFileSynced notifyFileSynced;
} SSyncInfo; } SSyncInfo;
typedef void* tsync_h; typedef void* tsync_h;
......
...@@ -229,7 +229,7 @@ static void shellRunImportThreads(struct arguments* args) ...@@ -229,7 +229,7 @@ static void shellRunImportThreads(struct arguments* args)
ShellThreadObj *pThread = threadObj + t; ShellThreadObj *pThread = threadObj + t;
pThread->threadIndex = t; pThread->threadIndex = t;
pThread->totalThreads = args->threadNum; 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) { if (pThread->taos == NULL) {
fprintf(stderr, "ERROR: thread:%d failed connect to TDengine, error:%s\n", pThread->threadIndex, taos_errstr(pThread->taos)); fprintf(stderr, "ERROR: thread:%d failed connect to TDengine, error:%s\n", pThread->threadIndex, taos_errstr(pThread->taos));
exit(0); exit(0);
......
...@@ -63,7 +63,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -63,7 +63,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break; break;
case 'P': case 'P':
if (arg) { if (arg) {
arguments->port = atoi(arg); tsDnodeShellPort = atoi(arg);
} else { } else {
fprintf(stderr, "Invalid port\n"); fprintf(stderr, "Invalid port\n");
return -1; return -1;
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef TDENGINE_DNODE_MNODE_H #ifndef TDENGINE_MGMT_DSERVER_H
#define TDENGINE_DNODE_MNODE_H #define TDENGINE_MGMT_DSERVER_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int32_t dnodeInitMnode(); int32_t mgmtInitServer();
void dnodeCleanupMnode(); void mgmtCleanupServer();
#ifdef __cplusplus #ifdef __cplusplus
} }
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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);
}
...@@ -803,7 +803,7 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -803,7 +803,7 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
newCfg.daysToKeep2 = daysToKeep2; 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); mTrace("db:%s, compression:%d change to %d", pDb->name, pDb->cfg.compression, compression);
newCfg.compression = compression; newCfg.compression = compression;
} }
...@@ -811,7 +811,6 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -811,7 +811,6 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
if (replications > 0 && replications != pDb->cfg.replications) { if (replications > 0 && replications != pDb->cfg.replications) {
mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications); mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications);
newCfg.replications = replications; newCfg.replications = replications;
}
if (replications > mgmtGetDnodesNum()) { if (replications > mgmtGetDnodesNum()) {
mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications); mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications);
...@@ -822,9 +821,10 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { ...@@ -822,9 +821,10 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications); mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications);
terrno = TSDB_CODE_INVALID_OPTION; terrno = TSDB_CODE_INVALID_OPTION;
} }
}
if (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL) { if (walLevel >= 0 && (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL)) {
mError("db:%s, wal level should be between 0-2", pDb->name); mError("db:%s, wal level %d should be between 0-2, origin:%d", pDb->name, walLevel, pDb->cfg.walLevel);
terrno = TSDB_CODE_INVALID_OPTION; terrno = TSDB_CODE_INVALID_OPTION;
} }
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtDClient.h"
#include "mgmtDServer.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
...@@ -153,8 +151,8 @@ int32_t mgmtInitDnodes() { ...@@ -153,8 +151,8 @@ int32_t mgmtInitDnodes() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_DNODE, mgmtProcessCreateDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_DNODE, mgmtProcessCreateDnodeMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_DNODE, mgmtProcessDropDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_DNODE, mgmtProcessDropDnodeMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp);
mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg); dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg);
mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_MODULE, mgmtGetModuleMeta); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_MODULE, mgmtGetModuleMeta);
mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_MODULE, mgmtRetrieveModules); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_MODULE, mgmtRetrieveModules);
mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtGetConfigMeta); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtGetConfigMeta);
...@@ -242,7 +240,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) { ...@@ -242,7 +240,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
.pCont = pMdCfgDnode, .pCont = pMdCfgDnode,
.contLen = sizeof(SMDCfgDnodeMsg) .contLen = sizeof(SMDCfgDnodeMsg)
}; };
mgmtSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); dnodeSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg);
rpcRsp.code = TSDB_CODE_SUCCESS; rpcRsp.code = TSDB_CODE_SUCCESS;
} }
......
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtServer.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDClient.h"
#include "mgmtDServer.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
#include "mgmtVgroup.h" #include "mgmtVgroup.h"
#include "mgmtUser.h" #include "mgmtUser.h"
...@@ -100,11 +99,7 @@ int32_t mgmtStartSystem() { ...@@ -100,11 +99,7 @@ int32_t mgmtStartSystem() {
mError("failed to init balance") mError("failed to init balance")
} }
if (mgmtInitDClient() < 0) { if (mgmtInitServer() < 0) {
return -1;
}
if (mgmtInitDServer() < 0) {
return -1; return -1;
} }
...@@ -141,8 +136,7 @@ void mgmtCleanUpSystem() { ...@@ -141,8 +136,7 @@ void mgmtCleanUpSystem() {
mgmtCleanupMnodes(); mgmtCleanupMnodes();
balanceCleanUp(); balanceCleanUp();
mgmtCleanUpShell(); mgmtCleanUpShell();
mgmtCleanupDClient(); mgmtCleanupServer();
mgmtCleanupDServer();
mgmtCleanUpAccts(); mgmtCleanUpAccts();
mgmtCleanUpTables(); mgmtCleanUpTables();
mgmtCleanUpVgroups(); mgmtCleanUpVgroups();
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDServer.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtProfile.h" #include "mgmtProfile.h"
#include "mgmtShell.h" #include "mgmtShell.h"
...@@ -35,67 +34,49 @@ ...@@ -35,67 +34,49 @@
#include "mgmtTable.h" #include "mgmtTable.h"
#include "mgmtVgroup.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 (*mgmtProcessDnodeMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg);
static void *tsMgmtDServerRpc; static void *tsMgmtServerQhandle = NULL;
static void *tsMgmtDServerQhandle = NULL;
int32_t mgmtInitServer() {
int32_t mgmtInitDServer() {
SRpcInit rpcInit = {0}; tsMgmtServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS");
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;
tsMgmtDServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS");
tsMgmtDServerRpc = rpcOpen(&rpcInit);
if (tsMgmtDServerRpc == NULL) {
mError("failed to init server connection to dnode");
return -1;
}
mPrint("server connection to dnode is opened"); mPrint("server connection to dnode is opened");
return 0; return 0;
} }
void mgmtCleanupDServer() { void mgmtCleanupServer() {
if (tsMgmtDServerQhandle) { if (tsMgmtServerQhandle) {
taosCleanUpScheduler(tsMgmtDServerQhandle); taosCleanUpScheduler(tsMgmtServerQhandle);
tsMgmtDServerQhandle = NULL; tsMgmtServerQhandle = NULL;
}
if (tsMgmtDServerRpc) {
rpcClose(tsMgmtDServerRpc);
tsMgmtDServerRpc = NULL;
mPrint("server connection to dnode is closed");
} }
} }
void mgmtAddDServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { void dnodeAddServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) {
mgmtProcessDnodeMsgFp[msgType] = fp; mgmtProcessDnodeMsgFp[msgType] = fp;
} }
static void mgmtProcessDServerRequest(SSchedMsg *sched) { static void mgmtProcessRequestFromDnode(SSchedMsg *sched) {
SRpcMsg *pMsg = sched->msg; SRpcMsg *pMsg = sched->msg;
(*mgmtProcessDnodeMsgFp[pMsg->msgType])(pMsg); (*mgmtProcessDnodeMsgFp[pMsg->msgType])(pMsg);
rpcFreeCont(pMsg->pCont); rpcFreeCont(pMsg->pCont);
free(pMsg); free(pMsg);
} }
static void mgmtAddToDServerQueue(SRpcMsg *pMsg) { static void mgmtAddToServerQueue(SRpcMsg *pMsg) {
SSchedMsg schedMsg; SSchedMsg schedMsg;
schedMsg.msg = pMsg; schedMsg.msg = pMsg;
schedMsg.fp = mgmtProcessDServerRequest; schedMsg.fp = mgmtProcessRequestFromDnode;
taosScheduleTask(tsMgmtDServerQhandle, &schedMsg); 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) { if (rpcMsg->pCont == NULL) {
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
return; return;
...@@ -116,17 +97,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { ...@@ -116,17 +97,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
return; return;
} }
if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) {
SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); SRpcMsg *pMsg = malloc(sizeof(SRpcMsg));
memcpy(pMsg, rpcMsg, sizeof(SRpcMsg)); memcpy(pMsg, rpcMsg, sizeof(SRpcMsg));
mgmtAddToDServerQueue(pMsg); mgmtAddToServerQueue(pMsg);
} else {
mError("%s is not processed in mgmt dserver", taosMsg[rpcMsg->msgType]);
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_MSG_NOT_PROCESSED);
rpcFreeCont(rpcMsg->pCont);
}
} }
static int mgmtDServerRetrieveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
return TSDB_CODE_SUCCESS;
}
...@@ -41,9 +41,8 @@ ...@@ -41,9 +41,8 @@
typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, 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 bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg);
static void mgmtProcessMsgFromShell(SRpcMsg *pMsg);
static void mgmtProcessUnSupportMsg(SRpcMsg *rpcMsg); static void mgmtProcessUnSupportMsg(SRpcMsg *rpcMsg);
static void mgmtProcessShowMsg(SQueuedMsg *queuedMsg); static void mgmtProcessShowMsg(SQueuedMsg *queuedMsg);
static void mgmtProcessRetrieveMsg(SQueuedMsg *queuedMsg); static void mgmtProcessRetrieveMsg(SQueuedMsg *queuedMsg);
...@@ -52,7 +51,6 @@ static void mgmtProcessConnectMsg(SQueuedMsg *queuedMsg); ...@@ -52,7 +51,6 @@ static void mgmtProcessConnectMsg(SQueuedMsg *queuedMsg);
static void mgmtProcessUseMsg(SQueuedMsg *queuedMsg); static void mgmtProcessUseMsg(SQueuedMsg *queuedMsg);
void *tsMgmtTmr; void *tsMgmtTmr;
static void *tsMgmtShellRpc = NULL;
static void *tsMgmtTranQhandle = NULL; static void *tsMgmtTranQhandle = NULL;
static void (*tsMgmtProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SQueuedMsg *) = {0}; static void (*tsMgmtProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SQueuedMsg *) = {0};
static void *tsQhandleCache = NULL; static void *tsQhandleCache = NULL;
...@@ -61,7 +59,7 @@ static SShowRetrieveFp tsMgmtShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0}; ...@@ -61,7 +59,7 @@ static SShowRetrieveFp tsMgmtShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0};
int32_t mgmtInitShell() { int32_t mgmtInitShell() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mgmtProcessShowMsg); 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_HEARTBEAT, mgmtProcessHeartBeatMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mgmtProcessConnectMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mgmtProcessConnectMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mgmtProcessUseMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mgmtProcessUseMsg);
...@@ -70,28 +68,6 @@ int32_t mgmtInitShell() { ...@@ -70,28 +68,6 @@ int32_t mgmtInitShell() {
tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT"); tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT");
tsQhandleCache = taosCacheInit(tsMgmtTmr, 2); 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; return 0;
} }
...@@ -101,12 +77,6 @@ void mgmtCleanUpShell() { ...@@ -101,12 +77,6 @@ void mgmtCleanUpShell() {
tsMgmtTranQhandle = NULL; tsMgmtTranQhandle = NULL;
} }
if (tsMgmtShellRpc) {
rpcClose(tsMgmtShellRpc);
tsMgmtShellRpc = NULL;
mPrint("server connection to shell is closed");
}
if (tsQhandleCache) { if (tsQhandleCache) {
taosCacheCleanup(tsQhandleCache); taosCacheCleanup(tsQhandleCache);
tsQhandleCache = NULL; tsQhandleCache = NULL;
...@@ -147,8 +117,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) { ...@@ -147,8 +117,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) {
taosTmrReset(mgmtDoDealyedAddToShellQueue, 1000, queuedMsg, tsMgmtTmr, &unUsed); taosTmrReset(mgmtDoDealyedAddToShellQueue, 1000, queuedMsg, tsMgmtTmr, &unUsed);
} }
static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
assert(rpcMsg);
if (rpcMsg->pCont == NULL) { if (rpcMsg->pCont == NULL) {
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
...@@ -369,6 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) { ...@@ -369,6 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) {
rpcSendResponse(&rpcRsp); rpcSendResponse(&rpcRsp);
} }
/*
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) {
*spi = 1; *spi = 1;
*encrypt = 0; *encrypt = 0;
...@@ -389,6 +359,7 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr ...@@ -389,6 +359,7 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
} }
*/
static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) { static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) {
SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0}; SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0};
...@@ -489,7 +460,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) { ...@@ -489,7 +460,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) {
return mgmtCheckTableMetaMsgReadOnly(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_SHOW || pMsg->msgType == TSDB_MSG_TYPE_CM_TABLES_META ||
pMsg->msgType == TSDB_MSG_TYPE_CM_CONNECT) { pMsg->msgType == TSDB_MSG_TYPE_CM_CONNECT) {
return true; return true;
......
...@@ -24,13 +24,12 @@ ...@@ -24,13 +24,12 @@
#include "tname.h" #include "tname.h"
#include "tidpool.h" #include "tidpool.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDClient.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtDServer.h"
#include "tgrant.h" #include "tgrant.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtProfile.h" #include "mgmtProfile.h"
...@@ -539,12 +538,12 @@ int32_t mgmtInitTables() { ...@@ -539,12 +538,12 @@ int32_t mgmtInitTables() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_TABLE_META, mgmtProcessTableMetaMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_TABLE_META, mgmtProcessTableMetaMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_STABLE_VGROUP, mgmtProcessSuperTableVgroupMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_STABLE_VGROUP, mgmtProcessSuperTableVgroupMsg);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_ALTER_TABLE_RSP, mgmtProcessAlterTableRsp); 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); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mgmtGetShowTableMeta);
mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mgmtRetrieveShowTables); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mgmtRetrieveShowTables);
...@@ -812,7 +811,7 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) { ...@@ -812,7 +811,7 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) {
if (pVgroup != NULL) { if (pVgroup != NULL) {
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup); SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup);
SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE}; SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE};
mgmtSendMsgToDnode(&ipSet, &rpcMsg); dnodeSendMsgToDnode(&ipSet, &rpcMsg);
mgmtDecVgroupRef(pVgroup); mgmtDecVgroupRef(pVgroup);
} }
} }
...@@ -1514,7 +1513,7 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) { ...@@ -1514,7 +1513,7 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) {
.msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE
}; };
mgmtSendMsgToDnode(&ipSet, &rpcMsg); dnodeSendMsgToDnode(&ipSet, &rpcMsg);
} }
static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) {
...@@ -1552,7 +1551,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { ...@@ -1552,7 +1551,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) {
.msgType = TSDB_MSG_TYPE_MD_DROP_TABLE .msgType = TSDB_MSG_TYPE_MD_DROP_TABLE
}; };
mgmtSendMsgToDnode(&ipSet, &rpcMsg); dnodeSendMsgToDnode(&ipSet, &rpcMsg);
} }
static int32_t mgmtModifyChildTableTagValue(SChildTableObj *pTable, char *tagName, char *nContent) { static int32_t mgmtModifyChildTableTagValue(SChildTableObj *pTable, char *tagName, char *nContent) {
...@@ -1854,7 +1853,7 @@ static void mgmtProcessTableCfgMsg(SRpcMsg *rpcMsg) { ...@@ -1854,7 +1853,7 @@ static void mgmtProcessTableCfgMsg(SRpcMsg *rpcMsg) {
.code = 0, .code = 0,
.msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE
}; };
mgmtSendMsgToDnode(&ipSet, &rpcRsp); dnodeSendMsgToDnode(&ipSet, &rpcRsp);
mgmtDecTableRef(pTable); mgmtDecTableRef(pTable);
mgmtDecDnodeRef(pDnode); mgmtDecDnodeRef(pDnode);
......
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
#include "ttime.h" #include "ttime.h"
#include "tbalance.h" #include "tbalance.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDClient.h"
#include "mgmtDServer.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtProfile.h" #include "mgmtProfile.h"
...@@ -218,9 +217,9 @@ int32_t mgmtInitVgroups() { ...@@ -218,9 +217,9 @@ int32_t mgmtInitVgroups() {
mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mgmtGetVgroupMeta); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mgmtGetVgroupMeta);
mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mgmtRetrieveVgroups); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mgmtRetrieveVgroups);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp); dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp);
mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg); dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg);
mTrace("table:vgroups is created"); mTrace("table:vgroups is created");
...@@ -584,7 +583,7 @@ SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup) { ...@@ -584,7 +583,7 @@ SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup) {
}; };
for (int i = 0; i < pVgroup->numOfVnodes; ++i) { for (int i = 0; i < pVgroup->numOfVnodes; ++i) {
strcpy(ipSet.fqdn[i], pVgroup->vnodeGid[i].pDnode->dnodeFqdn); 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; return ipSet;
} }
...@@ -595,7 +594,7 @@ SRpcIpSet mgmtGetIpSetFromIp(char *ep) { ...@@ -595,7 +594,7 @@ SRpcIpSet mgmtGetIpSetFromIp(char *ep) {
ipSet.numOfIps = 1; ipSet.numOfIps = 1;
ipSet.inUse = 0; ipSet.inUse = 0;
taosGetFqdnPortFromEp(ep, ipSet.fqdn[0], &ipSet.port[0]); taosGetFqdnPortFromEp(ep, ipSet.fqdn[0], &ipSet.port[0]);
ipSet.port[0] += TSDB_PORT_DNODEMNODE; ipSet.port[0] += TSDB_PORT_DNODEDNODE;
return ipSet; return ipSet;
} }
...@@ -609,7 +608,7 @@ void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) { ...@@ -609,7 +608,7 @@ void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
.code = 0, .code = 0,
.msgType = TSDB_MSG_TYPE_MD_CREATE_VNODE .msgType = TSDB_MSG_TYPE_MD_CREATE_VNODE
}; };
mgmtSendMsgToDnode(ipSet, &rpcMsg); dnodeSendMsgToDnode(ipSet, &rpcMsg);
} }
void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) { void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) {
...@@ -675,7 +674,7 @@ void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) { ...@@ -675,7 +674,7 @@ void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
.code = 0, .code = 0,
.msgType = TSDB_MSG_TYPE_MD_DROP_VNODE .msgType = TSDB_MSG_TYPE_MD_DROP_VNODE
}; };
mgmtSendMsgToDnode(ipSet, &rpcMsg); dnodeSendMsgToDnode(ipSet, &rpcMsg);
} }
static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) { static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) {
......
...@@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) { ...@@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) {
for (i = 0; i < pServer->numOfThreads; ++i) { for (i = 0; i < pServer->numOfThreads; ++i) {
pThread = pServer->pThreads + i; pThread = pServer->pThreads + i;
if (pThread == NULL) continue;
//taosCloseSocket(pThread->pollFd); //taosCloseSocket(pThread->pollFd);
while (pThread->pHead) { //while (pThread->pHead) {
httpCleanUpContext(pThread->pHead, 0); // httpCleanUpContext(pThread->pHead, 0);
} //}
pthread_cancel(pThread->thread); pthread_cancel(pThread->thread);
pthread_join(pThread->thread, NULL); pthread_join(pThread->thread, NULL);
......
...@@ -131,7 +131,11 @@ void httpCleanUpSystem() { ...@@ -131,7 +131,11 @@ void httpCleanUpSystem() {
httpServer->timerHandle = NULL; httpServer->timerHandle = NULL;
} }
if (httpServer->pThreads != NULL) {
httpCleanUpConnect(httpServer); httpCleanUpConnect(httpServer);
httpServer->pThreads = NULL;
}
#if 0 #if 0
httpRemoveAllSessions(httpServer); httpRemoveAllSessions(httpServer);
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define SQL_LENGTH 1024 #define SQL_LENGTH 1024
#define LOG_LEN_STR 80 #define LOG_LEN_STR 80
#define IP_LEN_STR 15 #define IP_LEN_STR 18
#define CHECK_INTERVAL 1000 #define CHECK_INTERVAL 1000
typedef enum { typedef enum {
...@@ -115,6 +115,13 @@ static void monitorInitConn(void *para, void *unused) { ...@@ -115,6 +115,13 @@ static void monitorInitConn(void *para, void *unused) {
if (tsMonitorConn.ep[0] == 0) if (tsMonitorConn.ep[0] == 0)
strcpy(tsMonitorConn.ep, tsLocalEp); 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) { if (tsMonitorConn.conn == NULL) {
taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn)); taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn));
} else { } else {
...@@ -141,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { ...@@ -141,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
if (cmd == MONITOR_CMD_CREATE_DB) { if (cmd == MONITOR_CMD_CREATE_DB) {
snprintf(sql, SQL_LENGTH, snprintf(sql, SQL_LENGTH,
"create database if not exists %s replica 1 days 10 keep 30 rows 1024 cache 2048 " "create database if not exists %s replica 1 days 10 keep 30 cache 2 "
"ablocks 2 tblocks 32 tables 32 precision 'us'", "blocks 2 maxtables 32 precision 'us'",
tsMonitorDbName); tsMonitorDbName);
} else if (cmd == MONITOR_CMD_CREATE_MT_DN) { } else if (cmd == MONITOR_CMD_CREATE_MT_DN) {
snprintf(sql, SQL_LENGTH, snprintf(sql, SQL_LENGTH,
...@@ -154,7 +161,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { ...@@ -154,7 +161,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
", io_read float, io_write float" ", io_read float, io_write float"
", req_http int, req_select int, req_insert int" ", req_http int, req_select int, req_insert int"
") tags (ipaddr binary(%d))", ") tags (ipaddr binary(%d))",
tsMonitorDbName, IP_LEN_STR + 1); tsMonitorDbName, TSDB_FQDN_LEN + 1);
} else if (cmd == MONITOR_CMD_CREATE_TB_DN) { } 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, snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn_%s using %s.dn tags('%s')", tsMonitorDbName,
tsMonitorConn.ep, tsMonitorDbName, tsLocalEp); tsMonitorConn.ep, tsMonitorDbName, tsLocalEp);
......
...@@ -363,7 +363,7 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, const SRpcMsg *pMsg) ...@@ -363,7 +363,7 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, const SRpcMsg *pMsg)
// connection type is application specific. // connection type is application specific.
// for TDengine, all the query, show commands shall have TCP connection // for TDengine, all the query, show commands shall have TCP connection
char type = pMsg->msgType; 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_STABLE_VGROUP || type == TSDB_MSG_TYPE_CM_TABLES_META ||
type == TSDB_MSG_TYPE_CM_SHOW ) type == TSDB_MSG_TYPE_CM_SHOW )
pContext->connType = RPC_CONN_TCPC; pContext->connType = RPC_CONN_TCPC;
...@@ -802,7 +802,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { ...@@ -802,7 +802,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) {
pHead->code = htonl(pHead->code); pHead->code = htonl(pHead->code);
if (terrno == 0) { if (terrno == 0) {
if (pHead->msgType != TSDB_MSG_TYPE_REG && pHead->encrypt) { if (pHead->encrypt) {
// decrypt here // decrypt here
} }
......
...@@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) { ...@@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) {
sockFd = taosOpenTcpServerSocket(pServerObj->ip, pServerObj->port); sockFd = taosOpenTcpServerSocket(pServerObj->ip, pServerObj->port);
if (sockFd < 0) return; 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) { while (1) {
socklen_t addrlen = sizeof(caddr); socklen_t addrlen = sizeof(caddr);
......
...@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) { ...@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) {
commit = atoi(argv[++i]); commit = atoi(argv[++i]);
} else if (strcmp(argv[i], "-d")==0 && i < argc-1) { } else if (strcmp(argv[i], "-d")==0 && i < argc-1) {
rpcDebugFlag = atoi(argv[++i]); rpcDebugFlag = atoi(argv[++i]);
ddebugFlag = rpcDebugFlag; dDebugFlag = rpcDebugFlag;
uDebugFlag = rpcDebugFlag; uDebugFlag = rpcDebugFlag;
} else { } else {
printf("\nusage: %s [options] \n", argv[0]); printf("\nusage: %s [options] \n", argv[0]);
......
...@@ -20,8 +20,17 @@ ...@@ -20,8 +20,17 @@
extern "C" { extern "C" {
#endif #endif
#include "tlog.h"
#include "tsync.h" #include "tsync.h"
#include "twal.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 { typedef struct {
int32_t vgId; // global vnode group ID int32_t vgId; // global vnode group ID
......
...@@ -22,19 +22,19 @@ extern "C" { ...@@ -22,19 +22,19 @@ extern "C" {
#include "tlog.h" #include "tlog.h"
extern int32_t ddebugFlag; extern int32_t dDebugFlag;
#define dError(...) \ #define dError(...) \
if (ddebugFlag & DEBUG_ERROR) { \ if (dDebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \ taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \
} }
#define dWarn(...) \ #define dWarn(...) \
if (ddebugFlag & DEBUG_WARN) { \ if (dDebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \ taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); \
} }
#define dTrace(...) \ #define dTrace(...) \
if (ddebugFlag & DEBUG_TRACE) { \ if (dDebugFlag & DEBUG_TRACE) { \
taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \ taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); \
} }
#define dPrint(...) \ #define dPrint(...) \
{ taosPrintLog("DND ", 255, __VA_ARGS__); } { taosPrintLog("DND ", 255, __VA_ARGS__); }
......
...@@ -24,14 +24,10 @@ ...@@ -24,14 +24,10 @@
#include "ttime.h" #include "ttime.h"
#include "ttimer.h" #include "ttimer.h"
#include "cJSON.h" #include "cJSON.h"
#include "twal.h"
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h" #include "dnode.h"
#include "vnode.h" #include "vnode.h"
#include "vnodeInt.h" #include "vnodeInt.h"
#include "vnodeLog.h"
#include "tcq.h"
//#include "tsync.h"
static int32_t tsOpennedVnodes; static int32_t tsOpennedVnodes;
static void *tsDnodeVnodesHash; static void *tsDnodeVnodesHash;
...@@ -46,6 +42,7 @@ static int vnodeWalCallback(void *arg); ...@@ -46,6 +42,7 @@ static int vnodeWalCallback(void *arg);
static uint32_t vnodeGetFileInfo(void *ahandle, char *name, uint32_t *index, int32_t *size); 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 int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index);
static void vnodeNotifyRole(void *ahandle, int8_t role); static void vnodeNotifyRole(void *ahandle, int8_t role);
static void vnodeNotifyFileSynced(void *ahandle);
static pthread_once_t vnodeModuleInit = PTHREAD_ONCE_INIT; static pthread_once_t vnodeModuleInit = PTHREAD_ONCE_INIT;
...@@ -64,7 +61,7 @@ static void vnodeInit() { ...@@ -64,7 +61,7 @@ static void vnodeInit() {
tsDnodeVnodesHash = taosInitIntHash(TSDB_MAX_VNODES, sizeof(SVnodeObj *), taosHashInt); tsDnodeVnodesHash = taosInitIntHash(TSDB_MAX_VNODES, sizeof(SVnodeObj *), taosHashInt);
if (tsDnodeVnodesHash == NULL) { if (tsDnodeVnodesHash == NULL) {
dError("failed to init vnode list"); vError("failed to init vnode list");
} }
} }
...@@ -74,7 +71,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -74,7 +71,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
SVnodeObj *pTemp = (SVnodeObj *)taosGetIntHashData(tsDnodeVnodesHash, pVnodeCfg->cfg.vgId); SVnodeObj *pTemp = (SVnodeObj *)taosGetIntHashData(tsDnodeVnodesHash, pVnodeCfg->cfg.vgId);
if (pTemp != NULL) { 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; return TSDB_CODE_SUCCESS;
} }
...@@ -93,7 +90,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -93,7 +90,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
code = vnodeSaveCfg(pVnodeCfg); code = vnodeSaveCfg(pVnodeCfg);
if (code != TSDB_CODE_SUCCESS) { 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; return code;
} }
...@@ -113,11 +110,11 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -113,11 +110,11 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId); sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId);
code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL); code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL);
if (code != TSDB_CODE_SUCCESS) { 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; 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); code = vnodeOpen(pVnodeCfg->cfg.vgId, rootDir);
return code; return code;
...@@ -126,12 +123,12 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -126,12 +123,12 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
int32_t vnodeDrop(int32_t vgId) { int32_t vnodeDrop(int32_t vgId) {
SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
if (ppVnode == NULL || *ppVnode == NULL) { 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; return TSDB_CODE_INVALID_VGROUP_ID;
} }
SVnodeObj *pVnode = *ppVnode; 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; pVnode->status = TAOS_VN_STATUS_DELETING;
vnodeCleanUp(pVnode); vnodeCleanUp(pVnode);
...@@ -144,34 +141,34 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -144,34 +141,34 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) {
int32_t code = vnodeSaveCfg(pVnodeCfg); int32_t code = vnodeSaveCfg(pVnodeCfg);
if (code != TSDB_CODE_SUCCESS) { 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; return code;
} }
code = vnodeReadCfg(pVnode); code = vnodeReadCfg(pVnode);
if (code != TSDB_CODE_SUCCESS) { 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); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
return code; return code;
} }
code = syncReconfig(pVnode->sync, &pVnode->syncCfg); code = syncReconfig(pVnode->sync, &pVnode->syncCfg);
if (code != TSDB_CODE_SUCCESS) { 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)); tstrerror(code));
return code; return code;
} }
code = tsdbConfigRepo(pVnode->tsdb, &pVnode->tsdbCfg); code = tsdbConfigRepo(pVnode->tsdb, &pVnode->tsdbCfg);
if (code != TSDB_CODE_SUCCESS) { 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)); tstrerror(code));
return code; return code;
} }
pVnode->status = TAOS_VN_STATUS_READY; 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; return TSDB_CODE_SUCCESS;
} }
...@@ -189,7 +186,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { ...@@ -189,7 +186,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
int32_t code = vnodeReadCfg(pVnode); int32_t code = vnodeReadCfg(pVnode);
if (code != TSDB_CODE_SUCCESS) { 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); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
return code; return code;
} }
...@@ -214,7 +211,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { ...@@ -214,7 +211,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
sprintf(temp, "%s/tsdb", rootDir); sprintf(temp, "%s/tsdb", rootDir);
pVnode->tsdb = tsdbOpenRepo(temp, &appH); pVnode->tsdb = tsdbOpenRepo(temp, &appH);
if (pVnode->tsdb == NULL) { 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); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
return terrno; return terrno;
} }
...@@ -234,6 +231,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { ...@@ -234,6 +231,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
syncInfo.writeToCache = vnodeWriteToQueue; syncInfo.writeToCache = vnodeWriteToQueue;
syncInfo.confirmForward = dnodeSendRpcWriteRsp; syncInfo.confirmForward = dnodeSendRpcWriteRsp;
syncInfo.notifyRole = vnodeNotifyRole; syncInfo.notifyRole = vnodeNotifyRole;
syncInfo.notifyFileSynced = vnodeNotifyFileSynced;
pVnode->sync = syncStart(&syncInfo); pVnode->sync = syncStart(&syncInfo);
// start continuous query // start continuous query
...@@ -243,7 +241,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { ...@@ -243,7 +241,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode->events = NULL; pVnode->events = NULL;
pVnode->status = TAOS_VN_STATUS_READY; 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); atomic_add_fetch_32(&tsOpennedVnodes, 1);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -254,7 +252,7 @@ int32_t vnodeClose(int32_t vgId) { ...@@ -254,7 +252,7 @@ int32_t vnodeClose(int32_t vgId) {
if (ppVnode == NULL || *ppVnode == NULL) return 0; if (ppVnode == NULL || *ppVnode == NULL) return 0;
SVnodeObj *pVnode = *ppVnode; 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; pVnode->status = TAOS_VN_STATUS_CLOSING;
vnodeCleanUp(pVnode); vnodeCleanUp(pVnode);
...@@ -269,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) { ...@@ -269,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) {
assert(refCount >= 0); assert(refCount >= 0);
if (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; return;
} }
...@@ -290,7 +288,7 @@ void vnodeRelease(void *pVnodeRaw) { ...@@ -290,7 +288,7 @@ void vnodeRelease(void *pVnodeRaw) {
free(pVnode); free(pVnode);
int32_t count = atomic_sub_fetch_32(&tsOpennedVnodes, 1); 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) { if (count <= 0) {
taosCleanUpIntHash(tsDnodeVnodesHash); taosCleanUpIntHash(tsDnodeVnodesHash);
...@@ -303,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) { ...@@ -303,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) {
SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
if (ppVnode == NULL || *ppVnode == NULL) { if (ppVnode == NULL || *ppVnode == NULL) {
terrno = TSDB_CODE_INVALID_VGROUP_ID; terrno = TSDB_CODE_INVALID_VGROUP_ID;
dPrint("vgId:%d not exist", vgId); vPrint("vgId:%d not exist", vgId);
return NULL; return NULL;
} }
...@@ -315,7 +313,7 @@ void *vnodeAccquireVnode(int32_t vgId) { ...@@ -315,7 +313,7 @@ void *vnodeAccquireVnode(int32_t vgId) {
if (pVnode == NULL) return pVnode; if (pVnode == NULL) return pVnode;
atomic_add_fetch_32(&pVnode->refCount, 1); 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; return pVnode;
} }
...@@ -405,12 +403,19 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) { ...@@ -405,12 +403,19 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
cqStop(pVnode->cq); 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) { static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) {
char cfgFile[TSDB_FILENAME_LEN + 30] = {0}; char cfgFile[TSDB_FILENAME_LEN + 30] = {0};
sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnodeCfg->cfg.vgId); sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnodeCfg->cfg.vgId);
FILE *fp = fopen(cfgFile, "w"); FILE *fp = fopen(cfgFile, "w");
if (!fp) { 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)); strerror(errno));
return errno; return errno;
} }
...@@ -456,7 +461,7 @@ static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { ...@@ -456,7 +461,7 @@ static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) {
fclose(fp); fclose(fp);
free(content); free(content);
dPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId); vPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId);
return 0; return 0;
} }
...@@ -466,7 +471,7 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -466,7 +471,7 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId); sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId);
FILE *fp = fopen(cfgFile, "r"); FILE *fp = fopen(cfgFile, "r");
if (!fp) { 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)); cfgFile, strerror(errno));
return errno; return errno;
} }
...@@ -478,117 +483,117 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -478,117 +483,117 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
if (len <= 0) { if (len <= 0) {
free(content); free(content);
fclose(fp); 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; return false;
} }
cJSON *root = cJSON_Parse(content); cJSON *root = cJSON_Parse(content);
if (root == NULL) { 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; goto PARSE_OVER;
} }
cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion"); cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion");
if (!cfgVersion || cfgVersion->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->cfgVersion = cfgVersion->valueint; pVnode->cfgVersion = cfgVersion->valueint;
cJSON *cacheBlockSize = cJSON_GetObjectItem(root, "cacheBlockSize"); cJSON *cacheBlockSize = cJSON_GetObjectItem(root, "cacheBlockSize");
if (!cacheBlockSize || cacheBlockSize->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.cacheBlockSize = cacheBlockSize->valueint; pVnode->tsdbCfg.cacheBlockSize = cacheBlockSize->valueint;
cJSON *totalBlocks = cJSON_GetObjectItem(root, "totalBlocks"); cJSON *totalBlocks = cJSON_GetObjectItem(root, "totalBlocks");
if (!totalBlocks || totalBlocks->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.totalBlocks = totalBlocks->valueint; pVnode->tsdbCfg.totalBlocks = totalBlocks->valueint;
cJSON *maxTables = cJSON_GetObjectItem(root, "maxTables"); cJSON *maxTables = cJSON_GetObjectItem(root, "maxTables");
if (!maxTables || maxTables->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.maxTables = maxTables->valueint; pVnode->tsdbCfg.maxTables = maxTables->valueint;
cJSON *daysPerFile = cJSON_GetObjectItem(root, "daysPerFile"); cJSON *daysPerFile = cJSON_GetObjectItem(root, "daysPerFile");
if (!daysPerFile || daysPerFile->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.daysPerFile = daysPerFile->valueint; pVnode->tsdbCfg.daysPerFile = daysPerFile->valueint;
cJSON *daysToKeep = cJSON_GetObjectItem(root, "daysToKeep"); cJSON *daysToKeep = cJSON_GetObjectItem(root, "daysToKeep");
if (!daysToKeep || daysToKeep->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.keep = daysToKeep->valueint; pVnode->tsdbCfg.keep = daysToKeep->valueint;
cJSON *daysToKeep1 = cJSON_GetObjectItem(root, "daysToKeep1"); cJSON *daysToKeep1 = cJSON_GetObjectItem(root, "daysToKeep1");
if (!daysToKeep1 || daysToKeep1->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.keep1 = daysToKeep1->valueint; pVnode->tsdbCfg.keep1 = daysToKeep1->valueint;
cJSON *daysToKeep2 = cJSON_GetObjectItem(root, "daysToKeep2"); cJSON *daysToKeep2 = cJSON_GetObjectItem(root, "daysToKeep2");
if (!daysToKeep2 || daysToKeep2->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.keep2 = daysToKeep2->valueint; pVnode->tsdbCfg.keep2 = daysToKeep2->valueint;
cJSON *minRowsPerFileBlock = cJSON_GetObjectItem(root, "minRowsPerFileBlock"); cJSON *minRowsPerFileBlock = cJSON_GetObjectItem(root, "minRowsPerFileBlock");
if (!minRowsPerFileBlock || minRowsPerFileBlock->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.minRowsPerFileBlock = minRowsPerFileBlock->valueint; pVnode->tsdbCfg.minRowsPerFileBlock = minRowsPerFileBlock->valueint;
cJSON *maxRowsPerFileBlock = cJSON_GetObjectItem(root, "maxRowsPerFileBlock"); cJSON *maxRowsPerFileBlock = cJSON_GetObjectItem(root, "maxRowsPerFileBlock");
if (!maxRowsPerFileBlock || maxRowsPerFileBlock->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.maxRowsPerFileBlock = maxRowsPerFileBlock->valueint; pVnode->tsdbCfg.maxRowsPerFileBlock = maxRowsPerFileBlock->valueint;
cJSON *commitTime = cJSON_GetObjectItem(root, "commitTime"); cJSON *commitTime = cJSON_GetObjectItem(root, "commitTime");
if (!commitTime || commitTime->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.commitTime = (int8_t)commitTime->valueint; pVnode->tsdbCfg.commitTime = (int8_t)commitTime->valueint;
cJSON *precision = cJSON_GetObjectItem(root, "precision"); cJSON *precision = cJSON_GetObjectItem(root, "precision");
if (!precision || precision->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.precision = (int8_t)precision->valueint; pVnode->tsdbCfg.precision = (int8_t)precision->valueint;
cJSON *compression = cJSON_GetObjectItem(root, "compression"); cJSON *compression = cJSON_GetObjectItem(root, "compression");
if (!compression || compression->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->tsdbCfg.compression = (int8_t)compression->valueint; pVnode->tsdbCfg.compression = (int8_t)compression->valueint;
cJSON *walLevel = cJSON_GetObjectItem(root, "walLevel"); cJSON *walLevel = cJSON_GetObjectItem(root, "walLevel");
if (!walLevel || walLevel->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->walCfg.walLevel = (int8_t) walLevel->valueint; pVnode->walCfg.walLevel = (int8_t) walLevel->valueint;
cJSON *wals = cJSON_GetObjectItem(root, "wals"); cJSON *wals = cJSON_GetObjectItem(root, "wals");
if (!wals || wals->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->walCfg.wals = (int8_t)wals->valueint; pVnode->walCfg.wals = (int8_t)wals->valueint;
...@@ -596,27 +601,27 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -596,27 +601,27 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON *replica = cJSON_GetObjectItem(root, "replica"); cJSON *replica = cJSON_GetObjectItem(root, "replica");
if (!replica || replica->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->syncCfg.replica = (int8_t)replica->valueint; pVnode->syncCfg.replica = (int8_t)replica->valueint;
cJSON *quorum = cJSON_GetObjectItem(root, "quorum"); cJSON *quorum = cJSON_GetObjectItem(root, "quorum");
if (!quorum || quorum->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->syncCfg.quorum = (int8_t)quorum->valueint; pVnode->syncCfg.quorum = (int8_t)quorum->valueint;
cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos");
if (!nodeInfos || nodeInfos->type != cJSON_Array) { 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; goto PARSE_OVER;
} }
int size = cJSON_GetArraySize(nodeInfos); int size = cJSON_GetArraySize(nodeInfos);
if (size != pVnode->syncCfg.replica) { 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; goto PARSE_OVER;
} }
...@@ -626,14 +631,14 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -626,14 +631,14 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId");
if (!nodeId || nodeId->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->syncCfg.nodeInfo[i].nodeId = nodeId->valueint; pVnode->syncCfg.nodeInfo[i].nodeId = nodeId->valueint;
cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp");
if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { 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; goto PARSE_OVER;
} }
...@@ -643,9 +648,9 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -643,9 +648,9 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
ret = 0; 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++) { 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); pVnode->syncCfg.nodeInfo[i].nodeFqdn, pVnode->syncCfg.nodeInfo[i].nodePort);
} }
...@@ -661,7 +666,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { ...@@ -661,7 +666,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) {
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
FILE *fp = fopen(versionFile, "w"); FILE *fp = fopen(versionFile, "w");
if (!fp) { 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)); versionFile, strerror(errno));
return errno; return errno;
} }
...@@ -678,7 +683,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { ...@@ -678,7 +683,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) {
fclose(fp); fclose(fp);
free(content); 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; return 0;
} }
...@@ -688,7 +693,7 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { ...@@ -688,7 +693,7 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) {
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
FILE *fp = fopen(versionFile, "r"); FILE *fp = fopen(versionFile, "r");
if (!fp) { 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)); versionFile, strerror(errno));
return false; return false;
} }
...@@ -700,26 +705,26 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { ...@@ -700,26 +705,26 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) {
if (len <= 0) { if (len <= 0) {
free(content); free(content);
fclose(fp); 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; return false;
} }
cJSON *root = cJSON_Parse(content); cJSON *root = cJSON_Parse(content);
if (root == NULL) { 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; goto PARSE_OVER;
} }
cJSON *version = cJSON_GetObjectItem(root, "version"); cJSON *version = cJSON_GetObjectItem(root, "version");
if (!version || version->type != cJSON_Number) { 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; goto PARSE_OVER;
} }
pVnode->version = version->valueint; pVnode->version = version->valueint;
ret = true; 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: PARSE_OVER:
free(content); free(content);
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
static int32_t (*vnodeProcessReadMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, int32_t contLen, SRspRet *pRet); 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 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) { void vnodeInitReadFp(void) {
vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg; vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg;
vnodeProcessReadMsgFp[TSDB_MSG_TYPE_RETRIEVE] = vnodeProcessRetrieveMsg; vnodeProcessReadMsgFp[TSDB_MSG_TYPE_FETCH] = vnodeProcessFetchMsg;
} }
int32_t vnodeProcessRead(void *param, int msgType, void *pCont, int32_t contLen, SRspRet *ret) { 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 ...@@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
pRet->len = sizeof(SQueryTableRsp); pRet->len = sizeof(SQueryTableRsp);
pRet->rsp = pRsp; 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 { } else {
pQInfo = pCont; pQInfo = pCont;
code = TSDB_CODE_ACTION_IN_PROGRESS; code = TSDB_CODE_ACTION_IN_PROGRESS;
...@@ -76,14 +76,14 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont ...@@ -76,14 +76,14 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
return code; 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; SRetrieveTableMsg *pRetrieve = pCont;
void *pQInfo = (void*) htobe64(pRetrieve->qhandle); void *pQInfo = (void*) htobe64(pRetrieve->qhandle);
memset(pRet, 0, sizeof(SRspRet)); memset(pRet, 0, sizeof(SRspRet));
int32_t code = TSDB_CODE_SUCCESS; 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); pRet->code = qRetrieveQueryResultInfo(pQInfo);
if (pRet->code != TSDB_CODE_SUCCESS) { if (pRet->code != TSDB_CODE_SUCCESS) {
...@@ -104,6 +104,6 @@ static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t c ...@@ -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; return code;
} }
...@@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) { ...@@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if (vnodeProcessWriteMsgFp[pHead->msgType] == NULL) if (vnodeProcessWriteMsgFp[pHead->msgType] == NULL)
return TSDB_CODE_MSG_NOT_PROCESSED; 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; return TSDB_CODE_NOT_ACTIVE_VNODE;
if (pHead->version == 0) { // from client if (pHead->version == 0) { // from client
...@@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR ...@@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
// save insert result into item // 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); code = tsdbInsertData(pVnode->tsdb, pCont);
pRet->len = sizeof(SShellSubmitRspMsg); pRet->len = sizeof(SShellSubmitRspMsg);
...@@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe ...@@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
SMDCreateTableMsg *pTable = pCont; SMDCreateTableMsg *pTable = pCont;
int32_t code = 0; 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 numOfColumns = htons(pTable->numOfColumns);
int16_t numOfTags = htons(pTable->numOfTags); int16_t numOfTags = htons(pTable->numOfTags);
int32_t sid = htonl(pTable->sid); int32_t sid = htonl(pTable->sid);
...@@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe ...@@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
tfree(pDestTagSchema); tfree(pDestTagSchema);
tfree(pDestSchema); 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; return code;
} }
...@@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet ...@@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDDropTableMsg *pTable = pCont; SMDDropTableMsg *pTable = pCont;
int32_t code = 0; 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 = { STableId tableId = {
.uid = htobe64(pTable->uid), .uid = htobe64(pTable->uid),
.tid = htonl(pTable->sid) .tid = htonl(pTable->sid)
...@@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet ...@@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDCreateTableMsg *pTable = pCont; SMDCreateTableMsg *pTable = pCont;
int32_t code = 0; 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 numOfColumns = htons(pTable->numOfColumns);
int16_t numOfTags = htons(pTable->numOfTags); int16_t numOfTags = htons(pTable->numOfTags);
int32_t sid = htonl(pTable->sid); int32_t sid = htonl(pTable->sid);
...@@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet ...@@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
tfree(pDestSchema); 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; return code;
} }
...@@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet ...@@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDDropSTableMsg *pTable = pCont; SMDDropSTableMsg *pTable = pCont;
int32_t code = 0; 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 // TODO: drop stable in vvnode
//int64_t uid = htobe64(pTable->uid); //int64_t uid = htobe64(pTable->uid);
//void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode); //void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode);
//rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid); //rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid);
code = TSDB_CODE_SUCCESS; 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; return code;
} }
......
...@@ -79,6 +79,8 @@ void *walOpen(const char *path, const SWalCfg *pCfg) { ...@@ -79,6 +79,8 @@ void *walOpen(const char *path, const SWalCfg *pCfg) {
pthread_mutex_destroy(&pWal->mutex); pthread_mutex_destroy(&pWal->mutex);
free(pWal); free(pWal);
pWal = NULL; pWal = NULL;
} else {
wTrace("wal:%s, it is open, level:%d", path, pWal->level);
} }
return pWal; return pWal;
...@@ -177,8 +179,11 @@ void walFsync(void *handle) { ...@@ -177,8 +179,11 @@ void walFsync(void *handle) {
SWal *pWal = handle; SWal *pWal = handle;
if (pWal->level == TAOS_WAL_FSYNC) if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) {
fsync(pWal->fd); 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)) { int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int)) {
......
...@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { ...@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
} else if (strcmp(argv[i], "-v")==0 && i < argc-1) { } else if (strcmp(argv[i], "-v")==0 && i < argc-1) {
ver = atoll(argv[++i]); ver = atoll(argv[++i]);
} else if (strcmp(argv[i], "-d")==0 && i < argc-1) { } else if (strcmp(argv[i], "-d")==0 && i < argc-1) {
ddebugFlag = atoi(argv[++i]); dDebugFlag = atoi(argv[++i]);
} else { } else {
printf("\nusage: %s [options] \n", argv[0]); printf("\nusage: %s [options] \n", argv[0]);
printf(" [-p path]: wal file path default is:%s\n", path); printf(" [-p path]: wal file path default is:%s\n", path);
...@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { ...@@ -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(" [-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(" [-k keep]: keep the wal after closing, default is:%d\n", keep);
printf(" [-v version]: initial version, default is:%ld\n", ver); 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"); printf(" [-h help]: print out this help\n\n");
exit(0); exit(0);
} }
......
run general/agg/fill.sim
run general/agg/stream.sim
\ No newline at end of file
...@@ -117,3 +117,5 @@ endi ...@@ -117,3 +117,5 @@ endi
if $data12 != 2 then if $data12 != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -264,3 +264,4 @@ if $data00 != 31 then ...@@ -264,3 +264,4 @@ if $data00 != 31 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -47,3 +47,5 @@ sql select count(b) from tb ...@@ -47,3 +47,5 @@ sql select count(b) from tb
if $data00 != 5 then if $data00 != 5 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -20,25 +20,25 @@ endi ...@@ -20,25 +20,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
...@@ -61,25 +61,25 @@ endi ...@@ -61,25 +61,25 @@ endi
if $data02 != 0 then if $data02 != 0 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
...@@ -95,25 +95,25 @@ endi ...@@ -95,25 +95,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -122,22 +122,22 @@ endi ...@@ -122,22 +122,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -149,19 +149,19 @@ endi ...@@ -149,19 +149,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
...@@ -177,25 +177,25 @@ endi ...@@ -177,25 +177,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -204,22 +204,22 @@ endi ...@@ -204,22 +204,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -231,19 +231,19 @@ endi ...@@ -231,19 +231,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -258,16 +258,16 @@ endi ...@@ -258,16 +258,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
...@@ -291,25 +291,25 @@ endi ...@@ -291,25 +291,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -318,22 +318,22 @@ endi ...@@ -318,22 +318,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -345,19 +345,19 @@ endi ...@@ -345,19 +345,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -372,16 +372,16 @@ endi ...@@ -372,16 +372,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != -16 then if $data41 != -16 then
...@@ -399,13 +399,13 @@ endi ...@@ -399,13 +399,13 @@ endi
if $data45 != 3 then if $data45 != 3 then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
...@@ -421,25 +421,25 @@ endi ...@@ -421,25 +421,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -448,22 +448,22 @@ endi ...@@ -448,22 +448,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -475,19 +475,19 @@ endi ...@@ -475,19 +475,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -502,16 +502,16 @@ endi ...@@ -502,16 +502,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != -16 then if $data41 != -16 then
...@@ -529,13 +529,13 @@ endi ...@@ -529,13 +529,13 @@ endi
if $data45 != 3 then if $data45 != 3 then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
if $data51 != -13 then if $data51 != -13 then
...@@ -556,10 +556,10 @@ endi ...@@ -556,10 +556,10 @@ endi
if $data56 != 8.00000 then if $data56 != 8.00000 then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data58 != null then if $data58 != NULL then
return -1 return -1
endi endi
...@@ -575,25 +575,25 @@ endi ...@@ -575,25 +575,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -602,22 +602,22 @@ endi ...@@ -602,22 +602,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -629,19 +629,19 @@ endi ...@@ -629,19 +629,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -656,16 +656,16 @@ endi ...@@ -656,16 +656,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != -16 then if $data41 != -16 then
...@@ -683,13 +683,13 @@ endi ...@@ -683,13 +683,13 @@ endi
if $data45 != 3 then if $data45 != 3 then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
if $data51 != -13 then if $data51 != -13 then
...@@ -710,10 +710,10 @@ endi ...@@ -710,10 +710,10 @@ endi
if $data56 != 8.00000 then if $data56 != 8.00000 then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data58 != null then if $data58 != NULL then
return -1 return -1
endi endi
if $data61 != -10 then if $data61 != -10 then
...@@ -737,7 +737,7 @@ endi ...@@ -737,7 +737,7 @@ endi
if $data67 != 10.000000000 then if $data67 != 10.000000000 then
return -1 return -1
endi endi
if $data68 != null then if $data68 != NULL then
return -1 return -1
endi endi
...@@ -753,25 +753,25 @@ endi ...@@ -753,25 +753,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -780,22 +780,22 @@ endi ...@@ -780,22 +780,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -807,19 +807,19 @@ endi ...@@ -807,19 +807,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -834,16 +834,16 @@ endi ...@@ -834,16 +834,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != -16 then if $data41 != -16 then
...@@ -861,13 +861,13 @@ endi ...@@ -861,13 +861,13 @@ endi
if $data45 != 3 then if $data45 != 3 then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
if $data51 != -13 then if $data51 != -13 then
...@@ -888,10 +888,10 @@ endi ...@@ -888,10 +888,10 @@ endi
if $data56 != 8.00000 then if $data56 != 8.00000 then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data58 != null then if $data58 != NULL then
return -1 return -1
endi endi
if $data61 != -10 then if $data61 != -10 then
...@@ -915,7 +915,7 @@ endi ...@@ -915,7 +915,7 @@ endi
if $data67 != 10.000000000 then if $data67 != 10.000000000 then
return -1 return -1
endi endi
if $data68 != null then if $data68 != NULL then
return -1 return -1
endi endi
if $data71 != -7 then if $data71 != -7 then
...@@ -942,7 +942,7 @@ endi ...@@ -942,7 +942,7 @@ endi
if $data78 != 11 then if $data78 != 11 then
return -1 return -1
endi endi
if $data79 != null then if $data79 != NULL then
return -1 return -1
endi endi
...@@ -959,25 +959,25 @@ endi ...@@ -959,25 +959,25 @@ endi
if $data01 != -28 then if $data01 != -28 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -25 then if $data11 != -25 then
...@@ -986,22 +986,22 @@ endi ...@@ -986,22 +986,22 @@ endi
if $data12 != 0 then if $data12 != 0 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != -22 then if $data21 != -22 then
...@@ -1013,19 +1013,19 @@ endi ...@@ -1013,19 +1013,19 @@ endi
if $data23 != 0 then if $data23 != 0 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
...@@ -1040,16 +1040,16 @@ endi ...@@ -1040,16 +1040,16 @@ endi
if $data34 != 0 then if $data34 != 0 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != -16 then if $data41 != -16 then
...@@ -1067,13 +1067,13 @@ endi ...@@ -1067,13 +1067,13 @@ endi
if $data45 != 3 then if $data45 != 3 then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
if $data51 != -13 then if $data51 != -13 then
...@@ -1094,10 +1094,10 @@ endi ...@@ -1094,10 +1094,10 @@ endi
if $data56 != 8.00000 then if $data56 != 8.00000 then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data58 != null then if $data58 != NULL then
return -1 return -1
endi endi
if $data61 != -10 then if $data61 != -10 then
...@@ -1121,7 +1121,7 @@ endi ...@@ -1121,7 +1121,7 @@ endi
if $data67 != 10.000000000 then if $data67 != 10.000000000 then
return -1 return -1
endi endi
if $data68 != null then if $data68 != NULL then
return -1 return -1
endi endi
if $data71 != -7 then if $data71 != -7 then
...@@ -1148,3 +1148,5 @@ endi ...@@ -1148,3 +1148,5 @@ endi
if $data78 != 11 then if $data78 != 11 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -74,7 +74,7 @@ endi ...@@ -74,7 +74,7 @@ endi
if $data07 != 8 then if $data07 != 8 then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != 1 then if $data11 != 1 then
...@@ -98,7 +98,7 @@ endi ...@@ -98,7 +98,7 @@ endi
if $data17 != 8 then if $data17 != 8 then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
...@@ -129,10 +129,10 @@ endi ...@@ -129,10 +129,10 @@ endi
if $data06 != 8 then if $data06 != 8 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != 2 then if $data11 != 2 then
...@@ -153,10 +153,10 @@ endi ...@@ -153,10 +153,10 @@ endi
if $data16 != 8 then if $data16 != 8 then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
...@@ -177,10 +177,10 @@ endi ...@@ -177,10 +177,10 @@ endi
if $data26 != 8 then if $data26 != 8 then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
...@@ -206,16 +206,16 @@ endi ...@@ -206,16 +206,16 @@ endi
if $data04 != 0 then if $data04 != 0 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != 3 then if $data11 != 3 then
...@@ -230,16 +230,16 @@ endi ...@@ -230,16 +230,16 @@ endi
if $data14 != 8 then if $data14 != 8 then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != 2 then if $data21 != 2 then
...@@ -254,16 +254,16 @@ endi ...@@ -254,16 +254,16 @@ endi
if $data24 != 8 then if $data24 != 8 then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != 1 then if $data31 != 1 then
...@@ -278,16 +278,16 @@ endi ...@@ -278,16 +278,16 @@ endi
if $data34 != 8 then if $data34 != 8 then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
...@@ -313,19 +313,19 @@ endi ...@@ -313,19 +313,19 @@ endi
if $data03 != 5 then if $data03 != 5 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data11 != -19 then if $data11 != -19 then
...@@ -337,19 +337,19 @@ endi ...@@ -337,19 +337,19 @@ endi
if $data13 != 0 then if $data13 != 0 then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data21 != 3 then if $data21 != 3 then
...@@ -361,19 +361,19 @@ endi ...@@ -361,19 +361,19 @@ endi
if $data23 != 8 then if $data23 != 8 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != 2 then if $data31 != 2 then
...@@ -385,19 +385,19 @@ endi ...@@ -385,19 +385,19 @@ endi
if $data33 != 8 then if $data33 != 8 then
return -1 return -1
endi endi
if $data34 != null then if $data34 != NULL then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != 1 then if $data41 != 1 then
...@@ -409,19 +409,19 @@ endi ...@@ -409,19 +409,19 @@ endi
if $data43 != 8 then if $data43 != 8 then
return -1 return -1
endi endi
if $data44 != null then if $data44 != NULL then
return -1 return -1
endi endi
if $data45 != null then if $data45 != NULL then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
...@@ -443,22 +443,22 @@ endi ...@@ -443,22 +443,22 @@ endi
if $data12 != 5 then if $data12 != 5 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data21 != -19 then if $data21 != -19 then
...@@ -467,22 +467,22 @@ endi ...@@ -467,22 +467,22 @@ endi
if $data22 != 0 then if $data22 != 0 then
return -1 return -1
endi endi
if $data23 != null then if $data23 != NULL then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data31 != 3 then if $data31 != 3 then
...@@ -491,22 +491,22 @@ endi ...@@ -491,22 +491,22 @@ endi
if $data32 != 8 then if $data32 != 8 then
return -1 return -1
endi endi
if $data33 != null then if $data33 != NULL then
return -1 return -1
endi endi
if $data34 != null then if $data34 != NULL then
return -1 return -1
endi endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data37 != null then if $data37 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data41 != 2 then if $data41 != 2 then
...@@ -515,22 +515,22 @@ endi ...@@ -515,22 +515,22 @@ endi
if $data42 != 8 then if $data42 != 8 then
return -1 return -1
endi endi
if $data43 != null then if $data43 != NULL then
return -1 return -1
endi endi
if $data44 != null then if $data44 != NULL then
return -1 return -1
endi endi
if $data45 != null then if $data45 != NULL then
return -1 return -1
endi endi
if $data46 != null then if $data46 != NULL then
return -1 return -1
endi endi
if $data47 != null then if $data47 != NULL then
return -1 return -1
endi endi
if $data48 != null then if $data48 != NULL then
return -1 return -1
endi endi
if $data51 != 1 then if $data51 != 1 then
...@@ -539,19 +539,19 @@ endi ...@@ -539,19 +539,19 @@ endi
if $data52 != 8 then if $data52 != 8 then
return -1 return -1
endi endi
if $data53 != null then if $data53 != NULL then
return -1 return -1
endi endi
if $data54 != null then if $data54 != NULL then
return -1 return -1
endi endi
if $data55 != null then if $data55 != NULL then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data58 != null then if $data58 != NULL then
return -1 return -1
endi endi
...@@ -568,52 +568,52 @@ print data01 = $data01 ...@@ -568,52 +568,52 @@ print data01 = $data01
if $data01 != -10 then if $data01 != -10 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data11 != -13 then if $data11 != -13 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data21 != -16 then if $data21 != -16 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
return -1 return -1
endi endi
if $data32 != null then if $data32 != NULL then
return -1 return -1
endi endi
if $data33 != null then if $data33 != NULL then
return -1 return -1
endi endi
if $data41 != 3 then if $data41 != 3 then
return -1 return -1
endi endi
if $data42 != null then if $data42 != NULL then
return -1 return -1
endi endi
if $data51 != 2 then if $data51 != 2 then
return -1 return -1
endi endi
if $data52 != null then if $data52 != NULL then
return -1 return -1
endi endi
if $data53 != null then if $data53 != NULL then
return -1 return -1
endi endi
if $data61 != 1 then if $data61 != 1 then
return -1 return -1
endi endi
if $data62 != null then if $data62 != NULL then
return -1 return -1
endi endi
...@@ -632,52 +632,53 @@ endi ...@@ -632,52 +632,53 @@ endi
if $data01 != -10 then if $data01 != -10 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data11 != -13 then if $data11 != -13 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data21 != -16 then if $data21 != -16 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data31 != -19 then if $data31 != -19 then
return -1 return -1
endi endi
if $data32 != null then if $data32 != NULL then
return -1 return -1
endi endi
if $data33 != null then if $data33 != NULL then
return -1 return -1
endi endi
if $data41 != 3 then if $data41 != 3 then
return -1 return -1
endi endi
if $data42 != null then if $data42 != NULL then
return -1 return -1
endi endi
if $data51 != 2 then if $data51 != 2 then
return -1 return -1
endi endi
if $data52 != null then if $data52 != NULL then
return -1 return -1
endi endi
if $data53 != null then if $data53 != NULL then
return -1 return -1
endi endi
if $data61 != 1 then if $data61 != 1 then
return -1 return -1
endi endi
if $data62 != null then if $data62 != NULL then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -770,7 +770,7 @@ endi ...@@ -770,7 +770,7 @@ endi
if $data21 != INT then if $data21 != INT then
return -1 return -1
endi endi
if $data30 != null then if $data30 != NULL then
return -1 return -1
endi endi
...@@ -781,3 +781,4 @@ if $rows != 0 then ...@@ -781,3 +781,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -673,7 +673,7 @@ endi ...@@ -673,7 +673,7 @@ endi
if $data11 != INT then if $data11 != INT then
return -1 return -1
endi endi
if $data20 != null then if $data20 != NULL then
return -1 return -1
endi endi
...@@ -684,3 +684,4 @@ if $rows != 0 then ...@@ -684,3 +684,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/alter/count.sim
run general/alter/cached_schema_after_alter.sim run general/alter/cached_schema_after_alter.sim
run general/alter/count.sim
run general/alter/import.sim run general/alter/import.sim
run general/alter/insert1.sim run general/alter/insert1.sim
run general/alter/insert2.sim run general/alter/insert2.sim
......
...@@ -140,6 +140,4 @@ if $data04 != 10 then ...@@ -140,6 +140,4 @@ if $data04 != 10 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -83,3 +83,4 @@ if $data02 != 3 then ...@@ -83,3 +83,4 @@ if $data02 != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -56,4 +56,4 @@ if $data01 != 1 then ...@@ -56,4 +56,4 @@ if $data01 != 1 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/cache/new_metrics.sim
run general/cache/restart_table.sim run general/cache/restart_table.sim
run general/cache/restart_metrics.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
...@@ -152,3 +152,5 @@ endi ...@@ -152,3 +152,5 @@ endi
if $data09 != 10 then if $data09 != 10 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -215,3 +215,5 @@ endi ...@@ -215,3 +215,5 @@ endi
if $data09 != 20 then if $data09 != 20 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -211,3 +211,5 @@ endi ...@@ -211,3 +211,5 @@ endi
if $data07 != 2.872281323 then if $data07 != 2.872281323 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/column/table.sim
run general/column/metrics.sim
run general/column/stream.sim
run general/column/commit.sim run general/column/commit.sim
run general/column/metrics.sim
run general/column/table.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 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 system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -88,9 +87,9 @@ endi ...@@ -88,9 +87,9 @@ endi
print =============== step4 print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 20000 sleep 5000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 10000 sleep 3000
print =============== step5 print =============== step5
...@@ -124,4 +123,4 @@ if $rows != $N then ...@@ -124,4 +123,4 @@ if $rows != $N then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 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 system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -83,9 +82,9 @@ endi ...@@ -83,9 +82,9 @@ endi
print =============== step4 print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000 sleep 5000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 10000 sleep 3000
print =============== step5 print =============== step5
...@@ -119,4 +118,4 @@ if $rows != $N then ...@@ -119,4 +118,4 @@ if $rows != $N then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 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 system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -83,9 +82,9 @@ endi ...@@ -83,9 +82,9 @@ endi
print =============== step4 print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000 sleep 5000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 10000 sleep 3000
print =============== step5 print =============== step5
...@@ -119,4 +118,4 @@ if $rows != $N then ...@@ -119,4 +118,4 @@ if $rows != $N then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/compress/compress.sim
run general/compress/uncompress.sim
run general/compress/commitlog.sim run general/compress/commitlog.sim
run general/compress/compress2.sim run general/compress/compress2.sim
run general/compress/compress.sim
run general/compress/uncompress.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 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 system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -83,9 +81,9 @@ endi ...@@ -83,9 +81,9 @@ endi
print =============== step4 print =============== step4
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 10000 sleep 5000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 10000 sleep 3000
print =============== step5 print =============== step5
...@@ -119,4 +117,4 @@ if $rows != $N then ...@@ -119,4 +117,4 @@ if $rows != $N then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -154,3 +154,5 @@ sql show databases ...@@ -154,3 +154,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -95,3 +95,5 @@ sql show databases ...@@ -95,3 +95,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -170,3 +170,5 @@ sql show databases ...@@ -170,3 +170,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -87,3 +87,5 @@ sql show databases ...@@ -87,3 +87,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -153,3 +153,5 @@ print =============== clear ...@@ -153,3 +153,5 @@ print =============== clear
#if $rows != 0 then #if $rows != 0 then
# return -1 # return -1
#endi #endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -156,3 +156,5 @@ sql show databases ...@@ -156,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -172,3 +172,5 @@ sql show databases ...@@ -172,3 +172,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -155,3 +155,5 @@ sql show databases ...@@ -155,3 +155,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -96,3 +96,5 @@ sql show databases ...@@ -96,3 +96,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -155,3 +155,5 @@ sql show databases ...@@ -155,3 +155,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -156,3 +156,5 @@ sql show databases ...@@ -156,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -51,7 +51,7 @@ $tb = $tbPrefix . $i ...@@ -51,7 +51,7 @@ $tb = $tbPrefix . $i
sql select * from $tb sql select * from $tb
print $data00 $data01 $data02 print $data00 $data01 $data02
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != 0 then if $data02 != 0 then
...@@ -165,7 +165,7 @@ sql select * from t2 ...@@ -165,7 +165,7 @@ sql select * from t2
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -173,7 +173,7 @@ sql select * from t3 ...@@ -173,7 +173,7 @@ sql select * from t3
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -181,7 +181,7 @@ sql select * from t4 ...@@ -181,7 +181,7 @@ sql select * from t4
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -189,7 +189,7 @@ sql select * from t5 ...@@ -189,7 +189,7 @@ sql select * from t5
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -197,7 +197,7 @@ sql select * from t6 ...@@ -197,7 +197,7 @@ sql select * from t6
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -205,7 +205,7 @@ sql select * from t7 ...@@ -205,7 +205,7 @@ sql select * from t7
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -213,7 +213,7 @@ endi ...@@ -213,7 +213,7 @@ endi
#if $rows != 1 then #if $rows != 1 then
# return -1 # return -1
#endi #endi
#if $data01 != null then #if $data01 != NULL then
# return -1 # return -1
#endi #endi
...@@ -223,3 +223,5 @@ sql show databases ...@@ -223,3 +223,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -112,3 +112,5 @@ sql show databases ...@@ -112,3 +112,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -94,3 +94,5 @@ sql show databases ...@@ -94,3 +94,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -155,3 +155,5 @@ sql show databases ...@@ -155,3 +155,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/compute/count.sim
run general/compute/avg.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/bottom.sim
run general/compute/percentile.sim run general/compute/count.sim
run general/compute/diff.sim run general/compute/diff.sim
run general/compute/diff2.sim
run general/compute/first.sim
run general/compute/interval.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/null.sim
run general/compute/diff2.sim run general/compute/percentile.sim
run general/compute/stddev.sim
run general/compute/sum.sim
run general/compute/top.sim
...@@ -95,3 +95,5 @@ sql show databases ...@@ -95,3 +95,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
...@@ -202,3 +200,5 @@ sql show databases ...@@ -202,3 +200,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database print =============== create database
...@@ -57,3 +58,5 @@ endi ...@@ -57,3 +58,5 @@ endi
if $data03 != 0 then if $data03 != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database d1 print =============== create database d1
...@@ -49,3 +50,5 @@ sql show tables ...@@ -49,3 +50,5 @@ sql show tables
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database d1 print =============== create database d1
...@@ -47,3 +48,5 @@ sql show d2.tables ...@@ -47,3 +48,5 @@ sql show d2.tables
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database d1 print =============== create database d1
...@@ -116,3 +117,5 @@ sql show d1.vgroups ...@@ -116,3 +117,5 @@ sql show d1.vgroups
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database d1 print =============== create database d1
...@@ -55,3 +56,5 @@ if $rows != 0 then ...@@ -55,3 +56,5 @@ if $rows != 0 then
endi endi
sql_error show d1.vgroups sql_error show d1.vgroups
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 ...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print ======== step1 print ======== step1
...@@ -107,3 +108,5 @@ while $x < 20 ...@@ -107,3 +108,5 @@ while $x < 20
print ===> loop times: $x print ===> loop times: $x
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 ...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print ======== step1 print ======== step1
...@@ -115,3 +116,5 @@ while $x < 20 ...@@ -115,3 +116,5 @@ while $x < 20
print ===> loop times: $x print ===> loop times: $x
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 ...@@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print ======== step1 print ======== step1
...@@ -109,3 +110,5 @@ sql show databases ...@@ -109,3 +110,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 ...@@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print ======== step1 print ======== step1
...@@ -70,3 +71,5 @@ sql show databases ...@@ -70,3 +71,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 ...@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
sql create database db sql create database db
...@@ -52,3 +53,5 @@ while $x < 20 ...@@ -52,3 +53,5 @@ while $x < 20
$x = $x + 1 $x = $x + 1
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -6,6 +6,7 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 ...@@ -6,6 +6,7 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
print ========= start dnodes print ========= start dnodes
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
sql create database db sql create database db
...@@ -43,3 +44,5 @@ while $x < 10 ...@@ -43,3 +44,5 @@ while $x < 10
$x = $x + 1 $x = $x + 1
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -92,3 +92,5 @@ sql show databases ...@@ -92,3 +92,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
...@@ -69,3 +67,5 @@ sql drop database d9 ...@@ -69,3 +67,5 @@ sql drop database d9
sql drop database d10 sql drop database d10
sql drop database d11 sql drop database d11
sql drop database d12 sql drop database d12
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -139,3 +139,5 @@ sql select * from t4 ...@@ -139,3 +139,5 @@ sql select * from t4
if $data01 != 4 then if $data01 != 4 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -7,7 +7,7 @@ run general/db/basic5.sim ...@@ -7,7 +7,7 @@ run general/db/basic5.sim
run general/db/delete_reuse1.sim run general/db/delete_reuse1.sim
run general/db/delete_reuse2.sim run general/db/delete_reuse2.sim
run general/db/delete_reusevnode.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_writing1.sim
run general/db/delete_writing2.sim run general/db/delete_writing2.sim
run general/db/len.sim run general/db/len.sim
......
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_bt_db $dbPrefix = db
$tbPrefix = fi_bt_tb $tbPrefix = tb
$mtPrefix = fi_bt_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -233,6 +231,8 @@ if $data00 != 100 then ...@@ -233,6 +231,8 @@ if $data00 != 100 then
return -1 return -1
endi 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 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 print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then if $data00 != 100 then
...@@ -293,3 +293,5 @@ sql show databases ...@@ -293,3 +293,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_3_db $dbPrefix = db
$tbPrefix = fi_3_tb $tbPrefix = tb
$mtPrefix = fi_3_mt $mtPrefix = mt
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -519,3 +517,5 @@ sql show databases ...@@ -519,3 +517,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_4_db $dbPrefix = db
$tbPrefix = fi_4_tb $tbPrefix = tb
$mtPrefix = fi_4_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -709,3 +707,5 @@ sql show databases ...@@ -709,3 +707,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_5_db $dbPrefix = db
$tbPrefix = fi_5_tb $tbPrefix = tb
$mtPrefix = fi_5_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -832,3 +830,5 @@ sql show databases ...@@ -832,3 +830,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_6_db $dbPrefix = db
$tbPrefix = fi_6_tb $tbPrefix = tb
$mtPrefix = fi_6_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -987,3 +985,5 @@ sql show databases ...@@ -987,3 +985,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_bi_db $dbPrefix = db
$tbPrefix = fi_bi_tb $tbPrefix = tb
$mtPrefix = fi_bi_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -158,3 +156,5 @@ sql show databases ...@@ -158,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_by_db $dbPrefix = db
$tbPrefix = fi_by_tb $tbPrefix = tb
$mtPrefix = fi_by_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -82,3 +80,5 @@ sql show databases ...@@ -82,3 +80,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_bo_db $dbPrefix = db
$tbPrefix = fi_bo_tb $tbPrefix = tb
$mtPrefix = fi_bo_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -159,3 +157,5 @@ sql show databases ...@@ -159,3 +157,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_do_db $dbPrefix = db
$tbPrefix = fi_do_tb $tbPrefix = tb
$mtPrefix = fi_do_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -158,3 +156,5 @@ sql show databases ...@@ -158,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_fl_db $dbPrefix = db
$tbPrefix = fi_fl_tb $tbPrefix = tb
$mtPrefix = fi_fl_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -158,3 +156,5 @@ sql show databases ...@@ -158,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_in_db $dbPrefix = db
$tbPrefix = fi_in_tb $tbPrefix = tb
$mtPrefix = fi_in_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -158,3 +156,5 @@ sql show databases ...@@ -158,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_si_db $dbPrefix = db
$tbPrefix = fi_si_tb $tbPrefix = tb
$mtPrefix = fi_si_mt $mtPrefix = st
$rowNum = 20 $rowNum = 20
print =============== step1 print =============== step1
...@@ -216,3 +214,5 @@ sql show databases ...@@ -216,3 +214,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -9,9 +7,9 @@ sleep 3000 ...@@ -9,9 +7,9 @@ sleep 3000
sql connect sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_sm_db $dbPrefix = db
$tbPrefix = fi_sm_tb $tbPrefix = tb
$mtPrefix = fi_sm_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -158,3 +156,5 @@ sql show databases ...@@ -158,3 +156,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
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/2.sim
run general/field/3.sim run general/field/3.sim
run general/field/4.sim run general/field/4.sim
run general/field/5.sim run general/field/5.sim
run general/field/6.sim 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
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -10,9 +8,9 @@ sql connect ...@@ -10,9 +8,9 @@ sql connect
print ======================== dnode1 start print ======================== dnode1 start
$dbPrefix = fi_ti_db $dbPrefix = db
$tbPrefix = fi_ti_tb $tbPrefix = tb
$mtPrefix = fi_ti_mt $mtPrefix = st
$tbNum = 10 $tbNum = 10
$rowNum = 20 $rowNum = 20
$totalNum = 200 $totalNum = 200
...@@ -159,3 +157,5 @@ sql show databases ...@@ -159,3 +157,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
sleep 5000
system sh/deploy.sh -n dnode1 -i 1 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 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 adminRowLimit -v 10
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -54,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3) ...@@ -54,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3)
print =============== step2 - login 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 print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1 return -1
endi 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 print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1 return -1
endi 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 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 return -1
endi 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 print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
return -1 return -1
endi 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 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 return -1
endi 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 print 6-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi 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 print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi endi
sleep 3000 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 print 8-> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1 return -1
...@@ -180,3 +178,5 @@ print 19-> $system_content ...@@ -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 if $system_content != @[{"refId":"A","target":"3","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"15.299999714","datapoints":[[3,"-"]]}]@ then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
sleep 2000
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
#system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10 #system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
...@@ -237,3 +235,4 @@ if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]}, ...@@ -237,3 +235,4 @@ if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
sleep 5000
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -52,3 +50,5 @@ print curl 127.0.0.1:6020/rest/sql/d1 -----> $system_content ...@@ -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 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 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 5000 sleep 3000
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/cfg.sh -n dnode1 -c http -v 1 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 ...@@ -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 if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 5000 sleep 3000
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c http -v 1
...@@ -81,7 +81,7 @@ print =============== step2 - no db ...@@ -81,7 +81,7 @@ print =============== step2 - no db
#11 #11
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql
print 11-> $system_content 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 return -1
endi endi
...@@ -93,7 +93,7 @@ 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 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql
print 13-> $system_content 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 return -1
endi endi
...@@ -230,3 +230,4 @@ if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12- ...@@ -230,3 +230,4 @@ if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
sleep 5000
system sh/deploy.sh -n dnode1 -i 1 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 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 httpEnableRecordSql -v 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -51,3 +49,5 @@ print =============== step5 - query data ...@@ -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 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 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
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -43,3 +42,5 @@ print curl 127.0.0.1:6020/rest/sql -----> $system_content ...@@ -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 #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 #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
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
sleep 3000
sleep 5000
system sh/deploy.sh -n dnode1 -i 1 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 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 httpEnableRecordSql -v 1
system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0 system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -18,14 +16,14 @@ print =============== step1 - parse ...@@ -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/ 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 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 return -1
endi 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/ 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 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 return -1
endi endi
...@@ -172,7 +170,7 @@ 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 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 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 return -1
endi endi
...@@ -193,14 +191,14 @@ 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 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 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 return -1
endi 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 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 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 return -1
endi endi
...@@ -221,14 +219,14 @@ 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 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 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 return -1
endi 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 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 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 return -1
endi endi
...@@ -254,17 +252,17 @@ system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Perce ...@@ -254,17 +252,17 @@ system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Perce
print $system_content 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 #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 # return -1
endi #endi
system_content curl -u root:taosdata -d 'select * from db.win_cpu_windows_1_Processor' 127.0.0.1:6020/rest/sql/ 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 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 #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 # return -1
endi #endi
print =============== step3 - multi-query data 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/ 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 ...@@ -279,9 +277,9 @@ system_content curl -u root:taosdata -d 'select * from db.win_cpu_window1_1_Pro
print $system_content 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 #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 # return -1
endi #endi
system_content curl -u root:taosdata -d 'select count(*) from db.win_cpu' 127.0.0.1:6020/rest/sql/ 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": ...@@ -291,3 +289,4 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/http/restful.sim run general/http/restful.sim
run general/http/restful_insert.sim run general/http/restful_insert.sim
#run general/http/restful_limit.sim run general/http/restful_limit.sim
#run general/http/restful_full.sim run general/http/restful_full.sim
#run general/http/prepare.sim run general/http/prepare.sim
#run general/http/telegraf.sim run general/http/telegraf.sim
#run general/http/grafana_bug.sim run general/http/grafana_bug.sim
#run general/http/grafana.sim run general/http/grafana.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 ...@@ -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 dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -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 dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c commitlog -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c commitlog -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c commitlog -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0
print ========= start dnode1 print ========= start dnode1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -50,14 +44,14 @@ endi ...@@ -50,14 +44,14 @@ endi
print ================= step2 print ================= step2
sql insert into tb values(1564641708000, 8000) sql insert into tb values(1564641708000, 8000)
sql select * from tb; sql select * from tb;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
print ================= step3 print ================= step3
sql insert into tb values(1564641720000, 20000) sql insert into tb values(1564641720000, 20000)
sql select * from tb; sql select * from tb;
if $rows != 2 then if $rows != 3 then
return -1 return -1
endi endi
...@@ -76,7 +70,7 @@ sql insert into tb values(1564641714000, 14000) ...@@ -76,7 +70,7 @@ sql insert into tb values(1564641714000, 14000)
sql insert into tb values(1564641725000, 25000) sql insert into tb values(1564641725000, 25000)
sql insert into tb values(1564641740000, 40000) sql insert into tb values(1564641740000, 40000)
sql select * from tb; sql select * from tb;
if $rows != 6 then if $rows != 8 then
return -1 return -1
endi endi
...@@ -87,7 +81,7 @@ sql import into tb values(1564641723000, 23000) ...@@ -87,7 +81,7 @@ sql import into tb values(1564641723000, 23000)
sql import into tb values(1564641734000, 34000) sql import into tb values(1564641734000, 34000)
sql import into tb values(1564641750000, 50000) sql import into tb values(1564641750000, 50000)
sql select * from tb; sql select * from tb;
if $rows != 11 then if $rows != 13 then
return -1 return -1
endi endi
...@@ -98,7 +92,7 @@ sql import into tb values(1564641723001, 23001) ...@@ -98,7 +92,7 @@ sql import into tb values(1564641723001, 23001)
sql import into tb values(1564641734001, 34001) sql import into tb values(1564641734001, 34001)
sql import into tb values(1564641750001, 50001) sql import into tb values(1564641750001, 50001)
sql select * from tb; sql select * from tb;
if $rows != 16 then if $rows != 18 then
return -1 return -1
endi endi
...@@ -108,28 +102,28 @@ sql insert into tb values(1564641714002, 14002) ...@@ -108,28 +102,28 @@ sql insert into tb values(1564641714002, 14002)
sql insert into tb values(1564641725002, 25002) sql insert into tb values(1564641725002, 25002)
sql insert into tb values(1564641900000, 200000) sql insert into tb values(1564641900000, 200000)
sql select * from tb; sql select * from tb;
if $rows != 17 then if $rows != 22 then
return -1 return -1
endi endi
print ================= step9 only insert last one print ================= step9 only insert last one
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000)
sql select * from tb; sql select * from tb;
if $rows != 20 then if $rows != 25 then
return -1 return -1
endi endi
print ================= step10 print ================= step10
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000)
sql select * from tb; sql select * from tb;
if $rows != 20 then if $rows != 25 then
return -1 return -1
endi endi
print ================= step11 print ================= step11
sql import into tb values(1564642400000, 700000) sql import into tb values(1564642400000, 700000)
sql select * from tb; sql select * from tb;
if $rows != 20 then if $rows != 25 then
return -1 return -1
endi endi
...@@ -137,7 +131,7 @@ print ================= step12 ...@@ -137,7 +131,7 @@ print ================= step12
sql import into tb values(1564641709527, 9527)(1564641709527, 9528) sql import into tb values(1564641709527, 9527)(1564641709527, 9528)
sql select * from tb; sql select * from tb;
print rows=> $rows print rows=> $rows
if $rows != 21 then if $rows != 26 then
return -1 return -1
endi endi
...@@ -145,7 +139,8 @@ print ================= step13 ...@@ -145,7 +139,8 @@ print ================= step13
sql import into tb values(1564641709898, 9898)(1564641709897, 9897) sql import into tb values(1564641709898, 9898)(1564641709897, 9897)
sql select * from tb; sql select * from tb;
print rows=> $rows print rows=> $rows
if $rows != 23 then if $rows != 28 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 ...@@ -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 dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -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 dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c commitlog -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c commitlog -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c commitlog -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0
print ========= start dnode1 print ========= start dnode1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -93,6 +87,4 @@ if $rows != 12 then ...@@ -93,6 +87,4 @@ if $rows != 12 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 ...@@ -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 dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -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 dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c commitlog -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c commitlog -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c commitlog -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 0
print ========= start dnode1 print ========= start dnode1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -100,3 +94,5 @@ while $i < 1000 ...@@ -100,3 +94,5 @@ while $i < 1000
endw endw
print ================= step2 print ================= step2
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -25,10 +20,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 ...@@ -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 dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -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 dnode1 -c walLevel -v 2
system sh/cfg.sh -n dnode2 -c commitlog -v 0 system sh/cfg.sh -n dnode2 -c walLevel -v 2
system sh/cfg.sh -n dnode3 -c commitlog -v 0 system sh/cfg.sh -n dnode3 -c walLevel -v 2
system sh/cfg.sh -n dnode4 -c commitlog -v 0 system sh/cfg.sh -n dnode4 -c walLevel -v 2
print ========= start dnode1 print ========= start dnode1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -40,53 +35,59 @@ sql use ir1db ...@@ -40,53 +35,59 @@ sql use ir1db
sql create table tb(ts timestamp, i int) sql create table tb(ts timestamp, i int)
print ================= step1 print ================= step1
sql import into tb values(now+10000a, 10000) sql import into tb values(1520000010000, 10000)
sql select * from tb; sql select * from tb;
print $rows
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
print ================= step2 print ================= step2
sql insert into tb values(now+8000a, 8000) sql insert into tb values(1520000008000, 8000)
print $rows
sql select * from tb; sql select * from tb;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
print ================= step3 print ================= step3
sql insert into tb values(now+20000a, 20000) sql insert into tb values(1520000020000, 20000)
sql select * from tb; sql select * from tb;
if $rows != 2 then print $rows
if $rows != 3 then
return -1 return -1
endi endi
print ================= step4 print ================= step4
sql import into tb values(now+8000a, 9000) sql import into tb values(1520000009000, 9000)
sql import into tb values(now+15000a, 15000) sql import into tb values(1520000015000, 15000)
sql import into tb values(now+30000a, 30000) sql import into tb values(1520000030000, 30000)
sql select * from tb; sql select * from tb;
if $rows != 5 then print $rows
if $rows != 6 then
return -1 return -1
endi endi
print ================= step5 print ================= step5
sql insert into tb values(now+8000a, 8000) sql insert into tb values(1520000008000, 8000)
sql insert into tb values(now+14000a, 14000) sql insert into tb values(1520000014000, 14000)
sql insert into tb values(now+25000a, 25000) sql insert into tb values(1520000025000, 25000)
sql insert into tb values(now+40000a, 40000) sql insert into tb values(1520000040000, 40000)
sql select * from tb; sql select * from tb;
if $rows != 6 then print $rows
if $rows != 9 then
return -1 return -1
endi endi
print ================= step6 print ================= step6
sql import into tb values(now+7000a, 7000) sql import into tb values(1520000007000, 7000)
sql import into tb values(now+12000a, 12000) sql import into tb values(1520000012000, 12000)
sql import into tb values(now+23000a, 23000) sql import into tb values(1520000023000, 23000)
sql import into tb values(now+34000a, 34000) sql import into tb values(1520000034000, 34000)
sql import into tb values(now+50000a, 50000) sql import into tb values(1520000050000, 50000)
sql select * from tb; sql select * from tb;
if $rows != 11 then print $rows
if $rows != 14 then
return -1 return -1
endi endi
...@@ -98,46 +99,63 @@ sleep 5000 ...@@ -98,46 +99,63 @@ sleep 5000
sql use ir1db sql use ir1db
sql select * from tb; sql select * from tb;
if $rows != 11 then if $rows != 14 then
return -1 return -1
endi endi
print ================= step7 print ================= step7
sql import into tb values(now+7001a, 7001) sql import into tb values(1520000007001, 7001)
sql import into tb values(now+12001a, 12001) sql import into tb values(1520000012001, 12001)
sql import into tb values(now+23001a, 23001) sql import into tb values(1520000023001, 23001)
sql import into tb values(now+34001a, 34001) sql import into tb values(1520000034001, 34001)
sql import into tb values(now+50001a, 50001) sql import into tb values(1520000050001, 50001)
sql select * from tb; sql select * from tb;
if $rows != 16 then print $rows
if $rows != 19 then
return -1 return -1
endi endi
print ================= step8 print ================= step8
sql insert into tb values(now+8002a, 8002) sql insert into tb values(1520000008002, 8002)
sql insert into tb values(now+14002a, 14002) sql insert into tb values(1520000014002, 14002)
sql insert into tb values(now+25002a, 25002) sql insert into tb values(1520000025002, 25002)
sql insert into tb values(now+200000a, 60000) sql insert into tb values(1520000060000, 60000)
sql select * from tb; sql select * from tb;
if $rows != 17 then print $rows
if $rows != 24 then
return -1 return -1
endi endi
print ================= step9 print ================= step9
sql import into tb values(now-30d, 7003) #1520000000000
sql import into tb values(now-20d, 34003) #sql import into tb values(now-30d, 7003)
sql import into tb values(now-10d, 34003) #sql import into tb values(now-20d, 34003)
sql import into tb values(now-5d, 34003) #sql import into tb values(now-10d, 34003)
sql import into tb values(now+1m, 50001) #sql import into tb values(now-5d, 34003)
sql import into tb values(now+2m, 50001) #sql import into tb values(now+1d, 50001)
sql import into tb values(now+3m, 50001) #sql import into tb values(now+2d, 50001)
sql import into tb values(now+4m, 50002) #sql import into tb values(now+6d, 50001)
sql import into tb values(now+5m, 50003) #sql import into tb values(now+8d, 50002)
sql import into tb values(now+6m, 50004) #sql import into tb values(now+10d, 50003)
sql import into tb values(now+7m, 50001) #sql import into tb values(now+12d, 50004)
sql import into tb values(now+8m, 500051) #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; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
...@@ -149,23 +167,44 @@ sleep 5000 ...@@ -149,23 +167,44 @@ sleep 5000
sql use ir1db sql use ir1db
sql select * from tb; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
print ================= step11 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; sql select * from tb;
if $rows != 34 then if $rows != 41 then
return -1 return -1
endi 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; sql select * from tb;
if $rows != 43 then print $rows
if $rows != 50 then
return -1 return -1
endi 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
run general/import/basic.sim run general/import/basic.sim
#run general/import/commit.sim run general/import/commit.sim
run general/import/large.sim run general/import/large.sim
run general/import/replica1.sim run general/import/replica1.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -29,21 +28,23 @@ while $x < 10 ...@@ -29,21 +28,23 @@ while $x < 10
endw endw
print =============== step 2 print =============== step 2
sql insert into $tb values (now - 5m , 10) -x error_insert sql insert into $tb values (now - 5m , 10)
sql insert into $tb values (now - 6m , 10) -x error_insert sql insert into $tb values (now - 6m , 10)
sql insert into $tb values (now - 7m , 10) -x error_insert sql insert into $tb values (now - 7m , 10)
sql insert into $tb values (now - 8m , 10) -x error_insert sql insert into $tb values (now - 8m , 10)
error_insert:
sql select * from $tb sql select * from $tb
print $rows points data are retrieved print $rows points data are retrieved
if $rows != 10 then if $rows != 14 then
return -1 return -1
endi endi
sql drop database $db sql drop database $db
sleep 1000
sql show databases sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -75,9 +75,11 @@ sql connect ...@@ -75,9 +75,11 @@ sql connect
sleep 3000 sleep 3000
sql use $db sql use $db
sql create table tb5 using $stb tags(5) sql create table tb5 using $stb tags(5)
sql select * from tb5 sql select * from tb5
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -193,3 +193,5 @@ sql show databases ...@@ -193,3 +193,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -175,3 +175,4 @@ if $rows != 0 then ...@@ -175,3 +175,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -208,3 +208,4 @@ if $rows != 0 then ...@@ -208,3 +208,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -170,3 +170,5 @@ sql show databases ...@@ -170,3 +170,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -206,4 +206,4 @@ if $rows != 0 then ...@@ -206,4 +206,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -53,3 +53,4 @@ if $rows != 0 then ...@@ -53,3 +53,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -20,7 +19,6 @@ sql create database db ...@@ -20,7 +19,6 @@ sql create database db
sql use db sql use db
sql create table tb (ts timestamp, test binary(1000)) sql create table tb (ts timestamp, test binary(1000))
$x = 0 $x = 0
while $x < 10000 while $x < 10000
$ms = $x . s $ms = $x . s
...@@ -30,11 +28,4 @@ endw ...@@ -30,11 +28,4 @@ endw
sql select * from tb sql select * from tb
system sh/exec.sh -n dnode1 -s stop -x SIGINT
return \ No newline at end of file
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
#run general/insert/basic.sim run general/insert/basic.sim
#run general/insert/insert_drop.sim run general/insert/insert_drop.sim
#run general/insert/query_block1_memory.sim run general/insert/query_block1_memory.sim
#run general/insert/query_block2_memory.sim run general/insert/query_block2_memory.sim
#run general/insert/query_block1_file.sim run general/insert/query_block1_file.sim
#run general/insert/query_block2_file.sim run general/insert/query_block2_file.sim
#run general/insert/query_file_memory.sim run general/insert/query_file_memory.sim
#run general/insert/query_multi_file.sim run general/insert/query_multi_file.sim
run general/insert/tcp.sim
...@@ -195,3 +195,5 @@ sql show databases ...@@ -195,3 +195,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
...@@ -135,3 +133,5 @@ sql show databases ...@@ -135,3 +133,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -102,25 +102,4 @@ if $rows != 100 then ...@@ -102,25 +102,4 @@ if $rows != 100 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -176,3 +176,5 @@ sql show databases ...@@ -176,3 +176,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -38,7 +38,7 @@ endi ...@@ -38,7 +38,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
sql alter table tb add column c3 nchar(4) sql alter table tb add column c3 nchar(4)
...@@ -46,7 +46,7 @@ sql select * from tb order by ts desc ...@@ -46,7 +46,7 @@ sql select * from tb order by ts desc
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
sql insert into tb values (now, 2, 2, 'taos') sql insert into tb values (now, 2, 2, 'taos')
...@@ -72,13 +72,13 @@ endi ...@@ -72,13 +72,13 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
sql alter table mt add column c3 nchar(4) sql alter table mt add column c3 nchar(4)
sql select * from tb order by ts desc sql select * from tb order by ts desc
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
sql insert into tb values (now, 2, 2, 'taos') sql insert into tb values (now, 2, 2, 'taos')
...@@ -89,7 +89,7 @@ endi ...@@ -89,7 +89,7 @@ endi
if $data03 != taos then if $data03 != taos then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
sql drop table tb sql drop table tb
...@@ -169,7 +169,7 @@ endi ...@@ -169,7 +169,7 @@ endi
if $data01 != 2 then if $data01 != 2 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
sql alter table mt add column c2 int sql alter table mt add column c2 int
...@@ -200,7 +200,7 @@ if $data02 != insert then ...@@ -200,7 +200,7 @@ if $data02 != insert then
endi endi
sql alter table mt add column c3 nchar(4) sql alter table mt add column c3 nchar(4)
sql select * from tb order by ts desc sql select * from tb order by ts desc
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
# the query below should be deleted after bug fix # the query below should be deleted after bug fix
......
...@@ -36,16 +36,16 @@ print rows = $rows ...@@ -36,16 +36,16 @@ print rows = $rows
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data23 != null then if $data23 != NULL then
return -1 return -1
endi endi
if $data33 != null then if $data33 != NULL then
return -1 return -1
endi endi
...@@ -53,10 +53,10 @@ sql select c1 from stb ...@@ -53,10 +53,10 @@ sql select c1 from stb
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data00 != null then if $data00 != NULL then
return -1 return -1
endi endi
if $data30 != null then if $data30 != NULL then
return -1 return -1
endi endi
...@@ -69,10 +69,10 @@ sql select c1+speed from car1 ...@@ -69,10 +69,10 @@ sql select c1+speed from car1
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data00 != null then if $data00 != NULL then
return -1 return -1
endi endi
if $data10 != null then if $data10 != NULL then
return -1 return -1
endi endi
...@@ -80,10 +80,10 @@ sql select * from car1 ...@@ -80,10 +80,10 @@ sql select * from car1
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
......
...@@ -10,7 +10,7 @@ print ========== bool ...@@ -10,7 +10,7 @@ print ========== bool
sql create table mt_bool (ts timestamp, c bool) tags (tagname bool) sql create table mt_bool (ts timestamp, c bool) tags (tagname bool)
## case 00: static create table for test tag values ## 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 sql select tagname from st_bool_0
if $data00 != NULL then if $data00 != NULL then
print ==1== expect: NULL, actually: $data00 print ==1== expect: NULL, actually: $data00
...@@ -22,7 +22,7 @@ if $data00 != NULL then ...@@ -22,7 +22,7 @@ if $data00 != NULL then
print ==2== expect: NULL, actually: $data00 print ==2== expect: NULL, actually: $data00
return -1 return -1
endi 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 sql select tagname from st_bool_2
if $data00 != NULL then if $data00 != NULL then
print ==3== expect: NULL, actually: $data00 print ==3== expect: NULL, actually: $data00
...@@ -34,7 +34,7 @@ if $data00 != NULL then ...@@ -34,7 +34,7 @@ if $data00 != NULL then
print ==4== expect: NULL, actually: $data00 print ==4== expect: NULL, actually: $data00
return -1 return -1
endi 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 sql select tagname from st_bool_4
if $data00 != NULL then if $data00 != NULL then
print ==5== expect: NULL, actually: $data00 print ==5== expect: NULL, actually: $data00
...@@ -120,7 +120,7 @@ if $data00 != 1 then ...@@ -120,7 +120,7 @@ if $data00 != 1 then
endi endi
## case 01: insert values for test column values ## 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 sql select * from st_bool_0
if $rows != 1 then if $rows != 1 then
return -1 return -1
...@@ -138,7 +138,7 @@ if $data01 != NULL then ...@@ -138,7 +138,7 @@ if $data01 != NULL then
print ==18== expect: NULL, actually: $data01 print ==18== expect: NULL, actually: $data01
return -1 return -1
endi 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 sql select * from st_bool_2
if $rows != 1 then if $rows != 1 then
return -1 return -1
...@@ -156,7 +156,7 @@ if $data01 != NULL then ...@@ -156,7 +156,7 @@ if $data01 != NULL then
print ==20== expect: NULL, actually: $data01 print ==20== expect: NULL, actually: $data01
return -1 return -1
endi 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 sql select * from st_bool_4
if $rows != 1 then if $rows != 1 then
return -1 return -1
...@@ -284,7 +284,7 @@ if $data01 != 1 then ...@@ -284,7 +284,7 @@ if $data01 != 1 then
endi endi
## case 02: dynamic create table for test tag values ## 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 sql select tagname from st_bool_16
if $data00 != NULL then if $data00 != NULL then
print ==33== expect: NULL, actually: $data00 print ==33== expect: NULL, actually: $data00
...@@ -307,7 +307,7 @@ if $data01 != NULL then ...@@ -307,7 +307,7 @@ if $data01 != NULL then
print ==36== expect: NULL, actually: $data01 print ==36== expect: NULL, actually: $data01
return -1 return -1
endi 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 sql select tagname from st_bool_18
if $data00 != NULL then if $data00 != NULL then
print ==37== expect: NULL, actually: $data00 print ==37== expect: NULL, actually: $data00
...@@ -329,7 +329,7 @@ if $data01 != NULL then ...@@ -329,7 +329,7 @@ if $data01 != NULL then
print ==40== expect: NULL, actually: $data01 print ==40== expect: NULL, actually: $data01
return -1 return -1
endi 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 sql select tagname from st_bool_20
if $data00 != NULL then if $data00 != NULL then
print ==41== expect: NULL, actually: $data00 print ==41== expect: NULL, actually: $data00
...@@ -505,7 +505,7 @@ endi ...@@ -505,7 +505,7 @@ endi
#if $data00 != false then #if $data00 != false then
# return -1 # return -1
#endi #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 #sql select tagname from st_bool_0
#if $data00 != NULL then #if $data00 != NULL then
# return -1 # return -1
...@@ -515,7 +515,7 @@ endi ...@@ -515,7 +515,7 @@ endi
#if $data00 != true then #if $data00 != true then
# return -1 # return -1
#endi #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 #sql select tagname from st_bool_0
#if $data00 != NULL then #if $data00 != NULL then
# return -1 # return -1
...@@ -535,7 +535,7 @@ endi ...@@ -535,7 +535,7 @@ endi
#if $data00 != true then #if $data00 != true then
# return -1 # return -1
#endi #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 #sql select tagname from st_bool_0
#if $data00 != NULL then #if $data00 != NULL then
# return -1 # return -1
......
...@@ -46,7 +46,7 @@ if $rows != 0 then ...@@ -46,7 +46,7 @@ if $rows != 0 then
return -1 return -1
endi endi
print data00 = $data00 print data00 = $data00
if $data00 != null then if $data00 != NULL then
return -1 return -1
endi endi
print case_insensitivity test passed print case_insensitivity test passed
......
...@@ -45,7 +45,7 @@ if $rows != 0 then ...@@ -45,7 +45,7 @@ if $rows != 0 then
return -1 return -1
endi endi
print data00 = $data00 print data00 = $data00
if $data00 != null then if $data00 != NULL then
return -1 return -1
endi endi
print case_insensitivity test passed print case_insensitivity test passed
......
...@@ -390,7 +390,7 @@ sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $ ...@@ -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(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') 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 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_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)
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 ...@@ -649,25 +649,25 @@ endi
if $data01 != 1 then if $data01 != 1 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 1 then if $data41 != 1 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 1 then if $data61 != 1 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 1 then if $data81 != 1 then
...@@ -686,25 +686,25 @@ endi ...@@ -686,25 +686,25 @@ endi
if $data01 != 0.000000000 then if $data01 != 0.000000000 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1.000000000 then if $data21 != 1.000000000 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 2.000000000 then if $data41 != 2.000000000 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 3.000000000 then if $data61 != 3.000000000 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 4.000000000 then if $data81 != 4.000000000 then
...@@ -719,25 +719,25 @@ endi ...@@ -719,25 +719,25 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 2 then if $data41 != 2 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 3 then if $data61 != 3 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 4 then if $data81 != 4 then
...@@ -752,25 +752,25 @@ endi ...@@ -752,25 +752,25 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 2 then if $data41 != 2 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 3 then if $data61 != 3 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 4 then if $data81 != 4 then
...@@ -785,25 +785,25 @@ endi ...@@ -785,25 +785,25 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 2 then if $data41 != 2 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 3 then if $data61 != 3 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 4 then if $data81 != 4 then
...@@ -818,25 +818,25 @@ endi ...@@ -818,25 +818,25 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data21 != 1 then if $data21 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data41 != 2 then if $data41 != 2 then
return -1 return -1
endi endi
if $data51 != null then if $data51 != NULL then
return -1 return -1
endi endi
if $data61 != 3 then if $data61 != 3 then
return -1 return -1
endi endi
if $data71 != null then if $data71 != NULL then
return -1 return -1
endi endi
if $data81 != 4 then if $data81 != 4 then
......
...@@ -68,7 +68,7 @@ $tsu = $tsu + $ts0 ...@@ -68,7 +68,7 @@ $tsu = $tsu + $ts0
#### fill test cases for stables #### 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 #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 #$val = $tbNum * 2
#if rows != $val then #if rows != $val then
...@@ -227,7 +227,7 @@ sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= ...@@ -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(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') 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 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_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)
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 ...@@ -283,13 +283,13 @@ endi
if $data08 != 0 then if $data08 != 0 then
return -1 return -1
endi endi
if $data15 != null then if $data15 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != 0 then if $data18 != 0 then
...@@ -313,16 +313,16 @@ endi ...@@ -313,16 +313,16 @@ endi
if $data07 != nchar0 then if $data07 != nchar0 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data08 != 5 then if $data08 != 5 then
...@@ -341,7 +341,7 @@ endi ...@@ -341,7 +341,7 @@ endi
if $data07 != nchar0 then if $data07 != nchar0 then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
...@@ -359,16 +359,16 @@ endi ...@@ -359,16 +359,16 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data09 != 5 then if $data09 != 5 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data19 != 5 then if $data19 != 5 then
...@@ -386,17 +386,17 @@ endi ...@@ -386,17 +386,17 @@ endi
## NULL fill ## NULL fill
print fill(NULL) 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 if $rows != 25 then
return -1 return -1
endi endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data06 != 1 then if $data06 != 1 then
...@@ -405,16 +405,16 @@ endi ...@@ -405,16 +405,16 @@ endi
if $data09 != 5 then if $data09 != 5 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data19 != 5 then if $data19 != 5 then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data59 != 6 then if $data59 != 6 then
......
...@@ -40,27 +40,27 @@ print data03 = $data03 ...@@ -40,27 +40,27 @@ print data03 = $data03
if $data03 != 0.00000 then if $data03 != 0.00000 then
return -1 return -1
endi endi
#if $data04 != null then #if $data04 != NULL then
if $data04 != 0.000000000 then if $data04 != 0.000000000 then
return -1 return -1
endi endi
#if $data05 != null then #if $data05 != NULL then
if $data05 != 0 then if $data05 != 0 then
return -1 return -1
endi endi
#if $data06 != null then #if $data06 != NULL then
if $data06 != 0 then if $data06 != 0 then
return -1 return -1
endi endi
#if $data07 != null then #if $data07 != NULL then
if $data07 != 1 then if $data07 != 1 then
return -1 return -1
endi endi
#if $data08 != null then #if $data08 != NULL then
if $data08 != BINARY then if $data08 != BINARY then
return -1 return -1
endi endi
#if $data09 != null then #if $data09 != NULL then
if $data09 != NCHAR then if $data09 != NCHAR then
return -1 return -1
endi endi
......
...@@ -218,10 +218,10 @@ if $data46 != @quoted double@ then ...@@ -218,10 +218,10 @@ if $data46 != @quoted double@ then
return -1 return -1
endi endi
# case: support null char of the binary field [TBASE-660] # 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 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 insert into NULLb values ('2018-09-17 09:00:00.000', '', '', 3.746)
sql select * from nullb sql select * from NULLb
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
......
...@@ -87,7 +87,7 @@ $tb = $tbPrefix . 0 ...@@ -87,7 +87,7 @@ $tb = $tbPrefix . 0
### illegal queries on a table ### illegal queries on a table
sql_error select interp(ts), c1 from $tb where ts = $ts0 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) 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 ### interp from tb + fill
$t = $ts0 + 1000 $t = $ts0 + 1000
...@@ -107,7 +107,7 @@ $tb = $tbPrefix . 0 ...@@ -107,7 +107,7 @@ $tb = $tbPrefix . 0
return -1 return -1
endi endi
## fill(null) ## fill(NULL)
$t = $tsu - 1000 $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 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 if $rows != 1 then
...@@ -116,31 +116,31 @@ $tb = $tbPrefix . 0 ...@@ -116,31 +116,31 @@ $tb = $tbPrefix . 0
if $data00 != @18-11-25 19:29:59.000@ then if $data00 != @18-11-25 19:29:59.000@ then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
...@@ -209,7 +209,7 @@ $tb = $tbPrefix . 0 ...@@ -209,7 +209,7 @@ $tb = $tbPrefix . 0
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 0.00000 then if $data03 != 0.00000 then
...@@ -254,13 +254,13 @@ $tb = $tbPrefix . 0 ...@@ -254,13 +254,13 @@ $tb = $tbPrefix . 0
if $data06 != 0 then if $data06 != 0 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
# columns contain NULL values # columns contain NULL values
...@@ -276,13 +276,13 @@ $tb = $tbPrefix . 0 ...@@ -276,13 +276,13 @@ $tb = $tbPrefix . 0
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 0.00167 then if $data03 != 0.00167 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != 0 then if $data05 != 0 then
...@@ -291,13 +291,13 @@ $tb = $tbPrefix . 0 ...@@ -291,13 +291,13 @@ $tb = $tbPrefix . 0
if $data06 != 0 then if $data06 != 0 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
...@@ -346,13 +346,13 @@ $tb = $tbPrefix . 0 ...@@ -346,13 +346,13 @@ $tb = $tbPrefix . 0
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 0.00000 then if $data03 != 0.00000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != 0 then if $data05 != 0 then
...@@ -413,10 +413,10 @@ $tb = $tbPrefix . 0 ...@@ -413,10 +413,10 @@ $tb = $tbPrefix . 0
if $data07 != 1 then if $data07 != 1 then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
...@@ -454,7 +454,7 @@ $tb = $tbPrefix . 0 ...@@ -454,7 +454,7 @@ $tb = $tbPrefix . 0
if $data09 != nchar0 then if $data09 != nchar0 then
return -1 return -1
endi 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) 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 if $rows != 1 then
return -1 return -1
...@@ -465,13 +465,13 @@ $tb = $tbPrefix . 0 ...@@ -465,13 +465,13 @@ $tb = $tbPrefix . 0
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 0.00000 then if $data03 != 0.00000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -521,10 +521,10 @@ $tb = $tbPrefix . 0 ...@@ -521,10 +521,10 @@ $tb = $tbPrefix . 0
if $data08 != intp_tb0 then if $data08 != intp_tb0 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data28 != intp_tb2 then if $data28 != intp_tb2 then
...@@ -558,51 +558,51 @@ $tb = $tbPrefix . 0 ...@@ -558,51 +558,51 @@ $tb = $tbPrefix . 0
if $data21 != 0 then if $data21 != 0 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
## interp(*) from stb + group by + fill(none) ## interp(*) from stb + group by + fill(none)
$t = $ts0 + 1000 $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 if $rows != $tbNum then
return -1 return -1
endi endi
if $data00 != @18-09-17 09:00:01.000@ then if $data00 != @18-09-17 09:00:01.000@ then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data23 != null then if $data23 != NULL then
return -1 return -1
endi endi
if $data34 != null then if $data34 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data16 != null then if $data16 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi 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 print $rows
if $rows != 4 then if $rows != 4 then
...@@ -619,10 +619,10 @@ endi ...@@ -619,10 +619,10 @@ endi
if $data21 != 0 then if $data21 != 0 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
...@@ -670,13 +670,13 @@ endi ...@@ -670,13 +670,13 @@ endi
if $data21 != 0 then if $data21 != 0 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data23 != 0.00000 then if $data23 != 0.00000 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != 0 then if $data25 != 0 then
...@@ -724,13 +724,13 @@ endi ...@@ -724,13 +724,13 @@ endi
if $data06 != 0 then if $data06 != 0 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
if $data20 != @18-09-17 09:00:01.000@ then if $data20 != @18-09-17 09:00:01.000@ then
...@@ -739,13 +739,13 @@ endi ...@@ -739,13 +739,13 @@ endi
if $data21 != 0 then if $data21 != 0 then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data23 != 0.00167 then if $data23 != 0.00167 then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != 0 then if $data25 != 0 then
...@@ -754,13 +754,13 @@ endi ...@@ -754,13 +754,13 @@ endi
if $data26 != 0 then if $data26 != 0 then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data29 != null then if $data29 != NULL then
return -1 return -1
endi endi
...@@ -796,10 +796,10 @@ endi ...@@ -796,10 +796,10 @@ endi
if $data07 != 1 then if $data07 != 1 then
return -1 return -1
endi endi
if $data08 != null then if $data08 != NULL then
return -1 return -1
endi endi
if $data09 != null then if $data09 != NULL then
return -1 return -1
endi endi
if $data20 != @18-09-17 09:00:01.000@ then if $data20 != @18-09-17 09:00:01.000@ then
...@@ -826,9 +826,9 @@ endi ...@@ -826,9 +826,9 @@ endi
if $data27 != 1 then if $data27 != 1 then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data29 != null then if $data29 != NULL then
return -1 return -1
endi endi
...@@ -27,7 +27,7 @@ endi ...@@ -27,7 +27,7 @@ endi
if $data01 != 1439 then if $data01 != 1439 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 1439.00000 then if $data03 != 1439.00000 then
......
...@@ -62,13 +62,13 @@ endi ...@@ -62,13 +62,13 @@ endi
if $data01 != 9 then if $data01 != 9 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 9.00000 then if $data03 != 9.00000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != 9 then if $data05 != 9 then
...@@ -130,13 +130,13 @@ endi ...@@ -130,13 +130,13 @@ endi
if $data11 != 0 then if $data11 != 0 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != 0.00000 then if $data13 != 0.00000 then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != 0 then if $data15 != 0 then
...@@ -261,13 +261,13 @@ endi ...@@ -261,13 +261,13 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data23 != 2.00000 then if $data23 != 2.00000 then
return -1 return -1
endi endi
if $data34 != null then if $data34 != NULL then
return -1 return -1
endi endi
if $data45 != 4 then if $data45 != 4 then
...@@ -428,7 +428,7 @@ endi ...@@ -428,7 +428,7 @@ endi
if $data26 != 1 then if $data26 != 1 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data42 != 4.500000000 then if $data42 != 4.500000000 then
...@@ -458,7 +458,7 @@ endi ...@@ -458,7 +458,7 @@ endi
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data12 != 4.500000000 then if $data12 != 4.500000000 then
......
...@@ -111,16 +111,16 @@ endi ...@@ -111,16 +111,16 @@ endi
if $data09 != nchar0 then if $data09 != nchar0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
...@@ -543,7 +543,7 @@ endi ...@@ -543,7 +543,7 @@ endi
if $data14 != 8.000000000 then if $data14 != 8.000000000 then
return -1 return -1
endi endi
if $data21 != null then if $data21 != NULL then
return -1 return -1
endi endi
...@@ -613,7 +613,7 @@ endi ...@@ -613,7 +613,7 @@ endi
if $data21 != 7.000000000 then if $data21 != 7.000000000 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi 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 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
......
...@@ -166,13 +166,13 @@ endi ...@@ -166,13 +166,13 @@ endi
if $data47 != 1 then if $data47 != 1 then
return -1 return -1
endi endi
if $data57 != null then if $data57 != NULL then
return -1 return -1
endi endi
if $data68 != binary3 then if $data68 != binary3 then
return -1 return -1
endi endi
if $data79 != null then if $data79 != NULL then
return -1 return -1
endi endi
...@@ -216,10 +216,10 @@ endi ...@@ -216,10 +216,10 @@ endi
if $data09 != nchar5 then if $data09 != nchar5 then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data19 != null then if $data19 != NULL then
return -1 return -1
endi endi
if $data16 != -2.000000000 then if $data16 != -2.000000000 then
...@@ -269,10 +269,10 @@ endi ...@@ -269,10 +269,10 @@ endi
if $data27 != 1 then if $data27 != 1 then
return -1 return -1
endi endi
if $data38 != null then if $data38 != NULL then
return -1 return -1
endi endi
if $data49 != null then if $data49 != NULL then
return -1 return -1
endi endi
......
...@@ -117,13 +117,13 @@ endi ...@@ -117,13 +117,13 @@ endi
if $data01 != 9 then if $data01 != 9 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != 9.00000 then if $data03 != 9.00000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != 9 then if $data05 != 9 then
...@@ -185,13 +185,13 @@ endi ...@@ -185,13 +185,13 @@ endi
if $data11 != 0 then if $data11 != 0 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != 0.00000 then if $data13 != 0.00000 then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
if $data15 != 0 then if $data15 != 0 then
...@@ -405,7 +405,7 @@ endi ...@@ -405,7 +405,7 @@ endi
if $data28 != 4 then if $data28 != 4 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data47 != nchar0 then if $data47 != nchar0 then
...@@ -427,7 +427,7 @@ endi ...@@ -427,7 +427,7 @@ endi
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != 4.500000000 then if $data02 != 4.500000000 then
...@@ -726,16 +726,16 @@ endi ...@@ -726,16 +726,16 @@ endi
if $data00 != @18-09-17 09:10:00.000@ then if $data00 != @18-09-17 09:10:00.000@ then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data09 != 5 then if $data09 != 5 then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data19 != 5 then if $data19 != 5 then
...@@ -747,13 +747,13 @@ endi ...@@ -747,13 +747,13 @@ endi
if $data24 != 0 then if $data24 != 0 then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != 1 then if $data28 != 1 then
......
...@@ -111,16 +111,16 @@ endi ...@@ -111,16 +111,16 @@ endi
if $data09 != nchar0 then if $data09 != nchar0 then
return -1 return -1
endi endi
if $data11 != null then if $data11 != NULL then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
if $data14 != null then if $data14 != NULL then
return -1 return -1
endi endi
...@@ -537,7 +537,7 @@ endi ...@@ -537,7 +537,7 @@ endi
if $data14 != 8.000000000 then if $data14 != 8.000000000 then
return -1 return -1
endi endi
if $data21 != null then if $data21 != NULL then
return -1 return -1
endi endi
...@@ -554,7 +554,7 @@ endi ...@@ -554,7 +554,7 @@ endi
if $data21 != 9 then if $data21 != 9 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
...@@ -574,7 +574,7 @@ endi ...@@ -574,7 +574,7 @@ endi
if $data31 != 9 then if $data31 != 9 then
return -1 return -1
endi endi
if $data41 != null then if $data41 != NULL then
return -1 return -1
endi 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 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 ...@@ -590,7 +590,7 @@ endi
if $data21 != 9 then if $data21 != 9 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
...@@ -607,7 +607,7 @@ endi ...@@ -607,7 +607,7 @@ endi
if $data21 != 7.000000000 then if $data21 != 7.000000000 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi 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 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 ...@@ -623,7 +623,7 @@ endi
if $data21 != 9.000000000 then if $data21 != 9.000000000 then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
......
...@@ -9,57 +9,57 @@ system sh/exec.sh -n dnode1 -s start ...@@ -9,57 +9,57 @@ system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
print ========== null_char.sim print ========== NULL_char.sim
$db = db $db = db
sql drop database if exists $db sql drop database if exists $db
sql create database $db sql create database $db
sql use $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 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: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: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: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:03.000', NULL, NULL, NULL, NULL, 'NULL', 'NULL', 2002, 127, 'NULL')
sql select * from mt1 sql select * from mt1
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data21 != null then if $data21 != NULL then
return -1 return -1
endi endi
if $data22 != null then if $data22 != NULL then
return -1 return -1
endi endi
if $data23 != null then if $data23 != NULL then
return -1 return -1
endi endi
if $data24 != null then if $data24 != NULL then
return -1 return -1
endi endi
if $data25 != null then if $data25 != NULL then
return -1 return -1
endi endi
if $data26 != null then if $data26 != NULL then
return -1 return -1
endi endi
if $data27 != null then if $data27 != NULL then
return -1 return -1
endi endi
if $data28 != null then if $data28 != NULL then
return -1 return -1
endi endi
if $data29 != null then if $data29 != NULL then
return -1 return -1
endi endi
if $data31 != null then if $data31 != NULL then
return -1 return -1
endi endi
if $data32 != null then if $data32 != NULL then
return -1 return -1
endi endi
#if $data33 != 0.00000 then #if $data33 != 0.00000 then
...@@ -70,20 +70,20 @@ endi ...@@ -70,20 +70,20 @@ endi
# print === expect 0.00000, actually $data34 # print === expect 0.00000, actually $data34
# return -1 # return -1
#endi #endi
if $data35 != null then if $data35 != NULL then
return -1 return -1
endi endi
if $data36 != null then if $data36 != NULL then
return -1 return -1
endi endi
if $data39 != null then if $data39 != NULL then
return -1 return -1
endi 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 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 sql describe st2
if $rows != 10 then if $rows != 10 then
return -1 return -1
...@@ -92,7 +92,7 @@ if $data63 != NULL then ...@@ -92,7 +92,7 @@ if $data63 != NULL then
print ==1== expect: NULL, actually: $data63 print ==1== expect: NULL, actually: $data63
return -1 return -1
endi endi
if $data73 != null then if $data73 != NULL then
print ==2== expect: NULL, actually: $data73 print ==2== expect: NULL, actually: $data73
return -1 return -1
endi endi
...@@ -127,7 +127,7 @@ endi ...@@ -127,7 +127,7 @@ endi
### bool: ### bool:
sql_error create table stx using mt2 tags ('NULL', '123aBc', 104, '123') 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_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 sql describe st4
if $rows != 10 then if $rows != 10 then
return -1 return -1
...@@ -168,9 +168,9 @@ endi ...@@ -168,9 +168,9 @@ endi
#### case 2: dynamic create table using super table when insert into #### 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 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 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') 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 = "" ...@@ -214,9 +214,9 @@ sql alter table st41 set tag tag_binary = ""
#if $data23 != $tagvalue then #if $data23 != $tagvalue then
# return -1 # return -1
#endi #endi
sql alter table st41 set tag tag_binary = "null" sql alter table st41 set tag tag_binary = "NULL"
sql describe st41 sql describe st41
if $data23 != null then if $data23 != NULL then
return -1 return -1
endi endi
sql alter table st41 set tag tag_binary = NULL sql alter table st41 set tag tag_binary = NULL
...@@ -242,9 +242,9 @@ sql alter table st41 set tag tag_nchar = '' ...@@ -242,9 +242,9 @@ sql alter table st41 set tag tag_nchar = ''
#if $data33 != $tagvalue then #if $data33 != $tagvalue then
# return -1 # return -1
#endi #endi
sql alter table st41 set tag tag_nchar = "null" sql alter table st41 set tag tag_nchar = "NULL"
sql describe st41 sql describe st41
if $data33 != null then if $data33 != NULL then
return -1 return -1
endi endi
sql alter table st41 set tag tag_nchar = NULL sql alter table st41 set tag tag_nchar = NULL
...@@ -279,13 +279,13 @@ sql describe st41 ...@@ -279,13 +279,13 @@ sql describe st41
if $data43 != -2000 then if $data43 != -2000 then
return -1 return -1
endi endi
sql alter table st41 set tag tag_int = null sql alter table st41 set tag tag_int = NULL
sql describe st41 sql describe st41
if $data43 != NULL then if $data43 != NULL then
print ==10== expect: NULL, actually: $data43 print ==10== expect: NULL, actually: $data43
return -1 return -1
endi 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 = ''
sql_error alter table st41 set tag tag_int = abc379 sql_error alter table st41 set tag tag_int = abc379
...@@ -310,13 +310,13 @@ sql describe st41 ...@@ -310,13 +310,13 @@ sql describe st41
if $data53 != true then if $data53 != true then
return -1 return -1
endi endi
sql alter table st41 set tag tag_bool = 'null' sql alter table st41 set tag tag_bool = 'NULL'
sql describe st41 sql describe st41
if $data53 != NULL then if $data53 != NULL then
print ==14== expect: NULL, actually: $data53 print ==14== expect: NULL, actually: $data53
return -1 return -1
endi endi
sql alter table st41 set tag tag_bool = null sql alter table st41 set tag tag_bool = NULL
sql describe st41 sql describe st41
if $data53 != NULL then if $data53 != NULL then
return -1 return -1
...@@ -350,13 +350,13 @@ if $data63 != 54.123455 then ...@@ -350,13 +350,13 @@ if $data63 != 54.123455 then
print ==11== expect: 54.123455, actually : $data63 print ==11== expect: 54.123455, actually : $data63
return -1 return -1
endi endi
sql alter table st41 set tag tag_float = null sql alter table st41 set tag tag_float = NULL
sql describe st41 sql describe st41
if $data63 != NULL then if $data63 != NULL then
print ==12== expect: NULL, actually : $data63 print ==12== expect: NULL, actually : $data63
return -1 return -1
endi endi
sql alter table st41 set tag tag_float = 'null' sql alter table st41 set tag tag_float = 'NULL'
sql describe st41 sql describe st41
if $data63 != NULL then if $data63 != NULL then
print ==17== expect: NULL, actually : $data63 print ==17== expect: NULL, actually : $data63
...@@ -396,13 +396,13 @@ sql describe st41 ...@@ -396,13 +396,13 @@ sql describe st41
if $data73 != -2456.000000 then if $data73 != -2456.000000 then
return -1 return -1
endi endi
sql alter table st41 set tag tag_double = null sql alter table st41 set tag tag_double = NULL
sql describe st41 sql describe st41
if $data73 != NULL then if $data73 != NULL then
print ==13== expect: NULL, actually : $data73 print ==13== expect: NULL, actually : $data73
return -1 return -1
endi endi
sql alter table st41 set tag tag_double = 'null' sql alter table st41 set tag tag_double = 'NULL'
sql describe st41 sql describe st41
if $data73 != NULL then if $data73 != NULL then
print ==20== expect: NULL, actually : $data73 print ==20== expect: NULL, actually : $data73
...@@ -420,7 +420,7 @@ sql create table mt5 (ts timestamp, c1 int) tags (tag_bigint bigint, tag_smallin ...@@ -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 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 = '-379'
sql alter table st51 set tag tag_bigint = -2000 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 alter table st51 set tag tag_bigint = 9223372036854775807
sql describe st51 sql describe st51
if $data23 != 9223372036854775807 then if $data23 != 9223372036854775807 then
...@@ -439,13 +439,13 @@ endi ...@@ -439,13 +439,13 @@ endi
sql_error alter table st51 set tag tag_bigint = -9223372036854775808 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 = ''
sql_error alter table st51 set tag tag_bigint = abc379 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 = -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 alter table st51 set tag tag_smallint = 32767
sql describe st51 sql describe st51
if $data33 != 32767 then if $data33 != 32767 then
...@@ -460,13 +460,13 @@ if $data33 != -32767 then ...@@ -460,13 +460,13 @@ if $data33 != -32767 then
endi endi
sql_error alter table st51 set tag tag_smallint = -32768 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 = ''
sql_error alter table st51 set tag tag_smallint = abc379 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 = -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 alter table st51 set tag tag_tinyint = 127
sql describe st51 sql describe st51
if $data43 != 127 then if $data43 != 127 then
...@@ -479,7 +479,7 @@ if $data43 != -127 then ...@@ -479,7 +479,7 @@ if $data43 != -127 then
endi endi
sql_error alter table st51 set tag tag_tinyint = '-128' sql_error alter table st51 set tag tag_tinyint = '-128'
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 = ''
sql_error alter table st51 set tag tag_tinyint = abc379 sql_error alter table st51 set tag tag_tinyint = abc379
......
...@@ -344,11 +344,11 @@ if $data11 != 1 then ...@@ -344,11 +344,11 @@ if $data11 != 1 then
return -1 return -1
endi endi
if $data12 != null then if $data12 != NULL then
return -1 return -1
endi endi
if $data13 != null then if $data13 != NULL then
return -1 return -1
endi endi
......
...@@ -87,7 +87,7 @@ if $rows != 0 then ...@@ -87,7 +87,7 @@ if $rows != 0 then
return -1 return -1
endi 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 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 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) sql create table tb1_tg1 using stb1_tg tags(1,2,3,4,5,6)
...@@ -195,33 +195,33 @@ sql select * from stb1_tg ...@@ -195,33 +195,33 @@ sql select * from stb1_tg
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
sql select * from stb2_tg sql select * from stb2_tg
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
print $data03 print $data03
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -57,7 +57,7 @@ while $i < $tbNum ...@@ -57,7 +57,7 @@ while $i < $tbNum
$x = $x + 1 $x = $x + 1
endw endw
$ts = $ts + $delta $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 $i = $i + 1
endw endw
print ====== $db tables created print ====== $db tables created
...@@ -87,7 +87,7 @@ while $i < $tbNum ...@@ -87,7 +87,7 @@ while $i < $tbNum
while $x < $rowNum while $x < $rowNum
$xs = $x * $delta $xs = $x * $delta
$ts = $ts0 + $xs $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 $x = $x + 1
endw endw
$i = $i + 1 $i = $i + 1
......
...@@ -219,10 +219,10 @@ endi ...@@ -219,10 +219,10 @@ endi
if $data13 != -2.000000000 then if $data13 != -2.000000000 then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data19 != slm_tb6 then if $data19 != slm_tb6 then
...@@ -293,10 +293,10 @@ endi ...@@ -293,10 +293,10 @@ endi
if $data13 != -2.000000000 then if $data13 != -2.000000000 then
return -1 return -1
endi endi
if $data17 != null then if $data17 != NULL then
return -1 return -1
endi endi
if $data18 != null then if $data18 != NULL then
return -1 return -1
endi endi
if $data19 != slm_tb5 then if $data19 != slm_tb5 then
......
...@@ -49,7 +49,7 @@ while $i < $tbNum ...@@ -49,7 +49,7 @@ while $i < $tbNum
$x = $x + 1 $x = $x + 1
endw endw
$ts = $ts + $delta $ts = $ts + $delta
sql insert into $tb values ( $ts , null, null ) sql insert into $tb values ( $ts , NULL, NULL )
$i = $i + 1 $i = $i + 1
endw endw
print ====== $db tables created print ====== $db tables created
......
...@@ -228,47 +228,47 @@ if $data11 != @19-01-01 09:10:00.000@ then ...@@ -228,47 +228,47 @@ if $data11 != @19-01-01 09:10:00.000@ then
return -1 return -1
endi endi
sql create table tb_where_null (ts timestamp, c1 float, c2 binary(10)) 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: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:01.000', NULL, NULL)
sql insert into tb_where_null values ('2019-01-01 09:00:02.000', 2, 'val2') 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_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 select * from tb_where_NULL where c1 = "NULL"
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from tb_where_null where c1 <> "NULL" sql select * from tb_where_NULL where c1 <> "NULL"
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
sql select * from tb_where_null where c1 <> "nulL" sql select * from tb_where_NULL where c1 <> "nulL"
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
sql select * from tb_where_null where c1 > "NULL" sql select * from tb_where_NULL where c1 > "NULL"
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from tb_where_null where c1 >= "NULL" sql select * from tb_where_NULL where c1 >= "NULL"
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from tb_where_null where c2 = "NULL" sql select * from tb_where_NULL where c2 = "NULL"
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from tb_where_null where c2 <> "NULL" sql select * from tb_where_NULL where c2 <> "NULL"
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
sql select * from tb_where_null where c2 <> "nUll" sql select * from tb_where_NULL where c2 <> "nUll"
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
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
...@@ -84,12 +84,12 @@ $st = $stPrefix . c3 ...@@ -84,12 +84,12 @@ $st = $stPrefix . c3
sql select * from $st sql select * from $st
print ===> select * from $st print ===> select * from $st
print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -185,10 +185,10 @@ print select * from $st => $data01 $data02, $data03 ...@@ -185,10 +185,10 @@ print select * from $st => $data01 $data02, $data03
if $data01 != 200 then if $data01 != 200 then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -79,12 +79,12 @@ $st = $stPrefix . c3 ...@@ -79,12 +79,12 @@ $st = $stPrefix . c3
sql select * from $st sql select * from $st
print ===> select * from $st print ===> select * from $st
print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
if $data02 != null then if $data02 != NULL then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database print =============== create database
...@@ -100,3 +101,5 @@ sql select * from db.s4 ...@@ -100,3 +101,5 @@ sql select * from db.s4
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database print =============== create database
...@@ -69,3 +70,4 @@ if $data21 != 3 then ...@@ -69,3 +70,4 @@ if $data21 != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== one table print =============== one table
...@@ -65,3 +66,4 @@ if $data21 != 3 then ...@@ -65,3 +66,4 @@ if $data21 != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect sql connect
print =============== create database print =============== create database
...@@ -69,3 +70,4 @@ if $data21 != 3 then ...@@ -69,3 +70,4 @@ if $data21 != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -71,3 +69,5 @@ sql show databases ...@@ -71,3 +69,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -61,3 +59,5 @@ sql show databases ...@@ -61,3 +59,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -90,3 +88,5 @@ sql show databases ...@@ -90,3 +88,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -24,3 +22,5 @@ sql show databases ...@@ -24,3 +22,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -85,6 +83,4 @@ if $rows != 0 then ...@@ -85,6 +83,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -83,3 +81,5 @@ sql show databases ...@@ -83,3 +81,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -77,6 +75,4 @@ if $rows != 0 then ...@@ -77,6 +75,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -88,3 +86,5 @@ sql show databases ...@@ -88,3 +86,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -45,3 +43,5 @@ sql show databases ...@@ -45,3 +43,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -87,3 +82,5 @@ while $x < 20 ...@@ -87,3 +82,5 @@ while $x < 20
print ===> loop times: $x print ===> loop times: $x
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -89,3 +84,5 @@ while $x < 20 ...@@ -89,3 +84,5 @@ while $x < 20
print ===> loop times: $x print ===> loop times: $x
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -57,3 +52,5 @@ while $x < 20 ...@@ -57,3 +52,5 @@ while $x < 20
$x = $x + 1 $x = $x + 1
endw endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -48,3 +46,4 @@ if $rows != 0 then ...@@ -48,3 +46,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -96,3 +94,5 @@ sql show databases ...@@ -96,3 +94,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -96,3 +94,5 @@ sql show databases ...@@ -96,3 +94,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -24,7 +22,7 @@ sql select * from $tb order by ts desc ...@@ -24,7 +22,7 @@ sql select * from $tb order by ts desc
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -37,7 +35,7 @@ sql select * from $tb order by ts desc ...@@ -37,7 +35,7 @@ sql select * from $tb order by ts desc
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -60,7 +58,7 @@ sql select * from $tb order by ts desc ...@@ -60,7 +58,7 @@ sql select * from $tb order by ts desc
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -98,22 +96,22 @@ if $data01 != 2 then ...@@ -98,22 +96,22 @@ if $data01 != 2 then
endi endi
print =============== step8 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 sql select * from $tb order by ts desc
if $rows != 8 then if $rows != 8 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
print =============== step9 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 sql select * from $tb order by ts desc
if $rows != 9 then if $rows != 9 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -133,3 +131,4 @@ if $rows != 0 then ...@@ -133,3 +131,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
...@@ -92,3 +90,5 @@ sql show databases ...@@ -92,3 +90,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -24,7 +22,8 @@ sql select * from $tb order by ts desc ...@@ -24,7 +22,8 @@ sql select * from $tb order by ts desc
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then print $data01
if $data01 != NULL then
return -1 return -1
endi endi
...@@ -37,7 +36,7 @@ sql select * from $tb order by ts desc ...@@ -37,7 +36,7 @@ sql select * from $tb order by ts desc
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -60,7 +59,7 @@ sql select * from $tb order by ts desc ...@@ -60,7 +59,7 @@ sql select * from $tb order by ts desc
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -103,3 +102,4 @@ if $rows != 0 then ...@@ -103,3 +102,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -223,4 +221,4 @@ if $rows != 0 then ...@@ -223,4 +221,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -58,7 +56,7 @@ if $rows != 0 then ...@@ -58,7 +56,7 @@ if $rows != 0 then
endi endi
print =============== step4 print =============== step4
sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4
return -1 return -1
step4: step4:
sql show tables sql show tables
...@@ -103,3 +101,5 @@ sql show databases ...@@ -103,3 +101,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -3,24 +3,25 @@ run general/table/basic1.sim ...@@ -3,24 +3,25 @@ run general/table/basic1.sim
run general/table/basic2.sim run general/table/basic2.sim
run general/table/basic3.sim run general/table/basic3.sim
run general/table/bigint.sim run general/table/bigint.sim
#run general/table/binary.sim run general/table/binary.sim
run general/table/bool.sim run general/table/bool.sim
run general/table/column_name.sim run general/table/column_name.sim
run general/table/column_num.sim run general/table/column_num.sim
#run general/table/column_value.sim run general/table/column_value.sim
#run general/table/column2.sim run general/table/column2.sim
#run general/table/date.sim run general/table/date.sim
run general/table/db.table.sim run general/table/db.table.sim
#run general/table/delete_reuse1.sim run general/table/delete_reuse1.sim
#run general/table/delete_reuse2.sim run general/table/delete_reuse2.sim
#run general/table/delete_writing.sim run general/table/delete_writing.sim
#run general/table/describe.sim run general/table/describe.sim
run general/table/double.sim run general/table/double.sim
run general/table/fill.sim
run general/table/float.sim run general/table/float.sim
run general/table/int.sim run general/table/int.sim
#run general/table/limit.sim run general/table/limit.sim
run general/table/smallint.sim run general/table/smallint.sim
#run general/table/table_len.sim run general/table/table_len.sim
#run general/table/table.sim run general/table/table.sim
run general/table/tinyint.sim run general/table/tinyint.sim
#run general/table/vgroup.sim run general/table/vgroup.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -24,7 +22,7 @@ sql select * from $tb order by ts desc ...@@ -24,7 +22,7 @@ sql select * from $tb order by ts desc
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -37,7 +35,7 @@ sql select * from $tb order by ts desc ...@@ -37,7 +35,7 @@ sql select * from $tb order by ts desc
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -60,7 +58,7 @@ sql select * from $tb ...@@ -60,7 +58,7 @@ sql select * from $tb
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data01 != null then if $data01 != NULL then
return -1 return -1
endi endi
...@@ -102,3 +100,5 @@ sql show databases ...@@ -102,3 +100,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
...@@ -156,7 +154,4 @@ if $rows != 0 then ...@@ -156,7 +154,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 walLevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
sql reset query cache
print ======================== dnode1 start print ======================== dnode1 start
...@@ -521,3 +518,5 @@ sql show databases ...@@ -521,3 +518,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -711,3 +711,5 @@ sql show databases ...@@ -711,3 +711,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -834,3 +834,5 @@ sql show databases ...@@ -834,3 +834,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -989,3 +989,5 @@ sql show databases ...@@ -989,3 +989,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -545,7 +545,7 @@ endi ...@@ -545,7 +545,7 @@ endi
if $data04 != 0 then if $data04 != 0 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
...@@ -852,3 +852,5 @@ sql show databases ...@@ -852,3 +852,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -307,3 +307,5 @@ sql show databases ...@@ -307,3 +307,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -237,3 +237,5 @@ sql show databases ...@@ -237,3 +237,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -307,3 +307,5 @@ sql show databases ...@@ -307,3 +307,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -323,3 +323,5 @@ sql show databases ...@@ -323,3 +323,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -394,7 +394,7 @@ endi ...@@ -394,7 +394,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -421,7 +421,7 @@ endi ...@@ -421,7 +421,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -448,7 +448,7 @@ endi ...@@ -448,7 +448,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -475,7 +475,7 @@ endi ...@@ -475,7 +475,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -502,7 +502,7 @@ endi ...@@ -502,7 +502,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -512,3 +512,5 @@ sql show databases ...@@ -512,3 +512,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -92,3 +92,5 @@ sql show databases ...@@ -92,3 +92,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -544,7 +544,7 @@ endi ...@@ -544,7 +544,7 @@ endi
if $data04 != 0 then if $data04 != 0 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
...@@ -1054,7 +1054,7 @@ endi ...@@ -1054,7 +1054,7 @@ endi
if $data04 != 0 then if $data04 != 0 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
...@@ -1181,3 +1181,5 @@ sql show databases ...@@ -1181,3 +1181,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -598,3 +598,5 @@ print $data00 $data01 $data02 ...@@ -598,3 +598,5 @@ print $data00 $data01 $data02
if $data02 != 12345 then if $data02 != 12345 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -428,7 +428,7 @@ endi ...@@ -428,7 +428,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -452,7 +452,7 @@ endi ...@@ -452,7 +452,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -476,7 +476,7 @@ endi ...@@ -476,7 +476,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -500,7 +500,7 @@ endi ...@@ -500,7 +500,7 @@ endi
if $data02 != 1.000000000 then if $data02 != 1.000000000 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -524,10 +524,10 @@ endi ...@@ -524,10 +524,10 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -554,10 +554,10 @@ endi ...@@ -554,10 +554,10 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -584,10 +584,10 @@ endi ...@@ -584,10 +584,10 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -614,10 +614,10 @@ endi ...@@ -614,10 +614,10 @@ endi
if $data02 != 1.000000000 then if $data02 != 1.000000000 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -644,13 +644,13 @@ endi ...@@ -644,13 +644,13 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
...@@ -683,13 +683,13 @@ endi ...@@ -683,13 +683,13 @@ endi
if $data03 != 4.00000 then if $data03 != 4.00000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
...@@ -722,16 +722,16 @@ endi ...@@ -722,16 +722,16 @@ endi
if $data03 != 4.000000000 then if $data03 != 4.000000000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -771,13 +771,13 @@ endi ...@@ -771,13 +771,13 @@ endi
if $data04 != 5.000000000 then if $data04 != 5.000000000 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -824,3 +824,5 @@ sql show databases ...@@ -824,3 +824,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -146,3 +144,5 @@ sql show databases ...@@ -146,3 +144,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -307,3 +307,5 @@ sql show databases ...@@ -307,3 +307,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -323,3 +323,5 @@ sql show databases ...@@ -323,3 +323,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -338,7 +338,7 @@ endi ...@@ -338,7 +338,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -365,7 +365,7 @@ endi ...@@ -365,7 +365,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -392,7 +392,7 @@ endi ...@@ -392,7 +392,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -419,7 +419,7 @@ endi ...@@ -419,7 +419,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -446,7 +446,7 @@ endi ...@@ -446,7 +446,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -456,3 +456,5 @@ sql show databases ...@@ -456,3 +456,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
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/3.sim
run general/tag/4.sim run general/tag/4.sim
run general/tag/5.sim run general/tag/5.sim
run general/tag/6.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/create.sim
run general/tag/delete.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/set.sim
run general/tag/add.sim run general/tag/smallint.sim
run general/tag/commit.sim run general/tag/tinyint.sim
\ No newline at end of file
...@@ -240,3 +240,5 @@ sql show databases ...@@ -240,3 +240,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -71,4 +71,4 @@ print $data10 $data11 $data22 ...@@ -71,4 +71,4 @@ print $data10 $data11 $data22
print $data20 $data11 $data22 print $data20 $data11 $data22
print $data30 $data31 $data32 print $data30 $data31 $data32
system sh/exec.sh -n dnode1 -s stop system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file \ No newline at end of file
run general/user/basic1.sim
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
print ========== step1 print ========== step1
...@@ -16,7 +14,7 @@ print ========== step2 ...@@ -16,7 +14,7 @@ print ========== step2
sql drop database log -x step21 sql drop database log -x step21
return -1 return -1
step21: step21:
sql drop table log.cpu -x step22 sql drop table log.dn -x step22
return -1 return -1
step22: step22:
sql drop user log -x step23 sql drop user log -x step23
...@@ -31,6 +29,4 @@ if $rows == 0 then ...@@ -31,6 +29,4 @@ if $rows == 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -47,3 +45,5 @@ sql show users ...@@ -47,3 +45,5 @@ sql show users
if $rows != 6 then if $rows != 6 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -80,4 +79,4 @@ if $rows != 3 then ...@@ -80,4 +79,4 @@ if $rows != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/user/basic1.sim run general/user/basic1.sim
run general/user/monitor.sim
run general/user/pass_alter.sim run general/user/pass_alter.sim
run general/user/pass_len.sim run general/user/pass_len.sim
run general/user/user_create.sim run general/user/user_create.sim
run general/user/user_len.sim run general/user/user_len.sim
\ No newline at end of file
#run general/user/monitor.sim
\ No newline at end of file
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 wallevel -v 0
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
...@@ -82,7 +81,4 @@ step42: ...@@ -82,7 +81,4 @@ step42:
sql drop user read sql drop user read
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -86,3 +86,5 @@ sql show users ...@@ -86,3 +86,5 @@ sql show users
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -619,3 +619,5 @@ sql show databases ...@@ -619,3 +619,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -619,3 +619,5 @@ sql show databases ...@@ -619,3 +619,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -206,10 +206,11 @@ sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step ...@@ -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 return -1
step74: step74:
print =============== clear print =============== clear
sql drop database $db sql drop database $db
sql show databases sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -299,3 +299,5 @@ sql show databases ...@@ -299,3 +299,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -615,3 +615,5 @@ sql show databases ...@@ -615,3 +615,5 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
run general/vector/single.sim run general/vector/metrics_field.sim
run general/vector/multi.sim run general/vector/metrics_mix.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_query.sim run general/vector/metrics_query.sim
run general/vector/metrics_tag.sim run general/vector/metrics_tag.sim
run general/vector/metrics_time.sim run general/vector/metrics_time.sim
run general/vector/metrics_field.sim run general/vector/multi.sim
run general/vector/metrics_mix.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
...@@ -6,10 +6,45 @@ cd ../../../debug; cmake .. ...@@ -6,10 +6,45 @@ cd ../../../debug; cmake ..
#cd ../../../debug; make clean #cd ../../../debug; make clean
cd ../../../debug; make 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/basic1.sim
./test.sh -f general/db/basic2.sim ./test.sh -f general/db/basic2.sim
./test.sh -f general/db/basic3.sim ./test.sh -f general/db/basic3.sim
...@@ -25,29 +60,124 @@ cd ../../../debug; make ...@@ -25,29 +60,124 @@ cd ../../../debug; make
./test.sh -f general/db/repeat.sim ./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.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/autocreate.sim
./test.sh -f general/table/basic1.sim ./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim ./test.sh -f general/table/basic2.sim
./test.sh -f general/table/basic3.sim ./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.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/bool.sim
./test.sh -f general/table/column_name.sim ./test.sh -f general/table/column_name.sim
./test.sh -f general/table/column_num.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/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/double.sim
#./test.sh -f general/table/fill.sim
./test.sh -f general/table/float.sim ./test.sh -f general/table/float.sim
./test.sh -f general/table/int.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/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/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/basic1.sim
#./test.sh -f general/user/monitor.sim
./test.sh -f general/user/pass_alter.sim ./test.sh -f general/user/pass_alter.sim
./test.sh -f general/user/pass_len.sim ./test.sh -f general/user/pass_len.sim
./test.sh -f general/user/user_create.sim ./test.sh -f general/user/user_create.sim
./test.sh -f general/user/user_len.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_create.sim
./test.sh -u -f unique/account/account_delete.sim ./test.sh -u -f unique/account/account_delete.sim
...@@ -61,14 +191,20 @@ cd ../../../debug; make ...@@ -61,14 +191,20 @@ cd ../../../debug; make
./test.sh -u -f unique/account/user_create.sim ./test.sh -u -f unique/account/user_create.sim
./test.sh -u -f unique/account/user_len.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/balance1.sim
./test.sh -u -f unique/cluster/balance2.sim ./test.sh -u -f unique/cluster/balance2.sim
./test.sh -u -f unique/cluster/balance3.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/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_add12.sim
./test.sh -u -f unique/db/replica_add13.sim ./test.sh -u -f unique/db/replica_add13.sim
./test.sh -u -f unique/db/replica_add23.sim ./test.sh -u -f unique/db/replica_add23.sim
...@@ -83,12 +219,24 @@ cd ../../../debug; make ...@@ -83,12 +219,24 @@ cd ../../../debug; make
./test.sh -u -f unique/dnode/balancex.sim ./test.sh -u -f unique/dnode/balancex.sim
./test.sh -u -f unique/dnode/offline1.sim ./test.sh -u -f unique/dnode/offline1.sim
./test.sh -u -f unique/dnode/offline2.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/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/mgmt22.sim
./test.sh -u -f unique/mnode/mgmt23.sim ./test.sh -u -f unique/mnode/mgmt23.sim
...@@ -97,10 +245,21 @@ cd ../../../debug; make ...@@ -97,10 +245,21 @@ cd ../../../debug; make
./test.sh -u -f unique/mnode/mgmt26.sim ./test.sh -u -f unique/mnode/mgmt26.sim
./test.sh -u -f unique/mnode/mgmt33.sim ./test.sh -u -f unique/mnode/mgmt33.sim
./test.sh -u -f unique/mnode/mgmt34.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 #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
#./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_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_basic.sim
#./test.sh -u -f unique/vnode/replica3_repeat.sim
#./test.sh -u -f unique/vnode/replica3_vgroup.sim
...@@ -4,6 +4,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 0 ...@@ -4,6 +4,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec_up.sh -n dnode1 -s start system sh/exec_up.sh -n dnode1 -s start
sql connect sql connect
sleep 3000
print ============================ dnode1 start print ============================ dnode1 start
......
...@@ -29,6 +29,7 @@ endi ...@@ -29,6 +29,7 @@ endi
print =============== step2 print =============== step2
sql drop user a -x step2 sql drop user a -x step2
step2: step2:
sleep 1000
sql create user a PASS '123' sql create user a PASS '123'
sql show users sql show users
if $rows != 4 then if $rows != 4 then
......
...@@ -160,7 +160,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 ...@@ -160,7 +160,7 @@ print dnode3 freeVnodes $data3_192.168.0.3
if $data3_192.168.0.1 != 2 then if $data3_192.168.0.1 != 2 then
goto show3 goto show3
endi endi
if $data3_192.168.0.2 != null then if $data3_192.168.0.2 != NULL then
goto show3 goto show3
endi endi
if $data3_192.168.0.3 != 2 then if $data3_192.168.0.3 != 2 then
...@@ -216,7 +216,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 ...@@ -216,7 +216,7 @@ print dnode3 freeVnodes $data3_192.168.0.3
if $data3_192.168.0.1 != 0 then if $data3_192.168.0.1 != 0 then
goto show4 goto show4
endi endi
if $data3_192.168.0.3 != null then if $data3_192.168.0.3 != NULL then
goto show4 goto show4
endi endi
...@@ -304,3 +304,12 @@ print select count(*) from mt $data00 expect $rowNum ...@@ -304,3 +304,12 @@ print select count(*) from mt $data00 expect $rowNum
if $data00 != $totalNum then if $data00 != $totalNum then
goto show5 goto show5
endi 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
...@@ -79,3 +79,12 @@ sql select count(*) from mt ...@@ -79,3 +79,12 @@ sql select count(*) from mt
if $data00 != 25600 then if $data00 != 25600 then
return -1 return -1
endi 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
...@@ -103,5 +103,12 @@ while $i < 100 ...@@ -103,5 +103,12 @@ while $i < 100
$i = $i + 1 $i = $i + 1
endw 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
#run unique/big/balance.sim run unique/big/balance.sim
#run unique/big/maxvnodes.sim run unique/big/maxvnodes.sim
#run unique/big/tcp.sim run unique/big/tcp.sim
...@@ -77,7 +77,7 @@ print dnode2 $dnode2Vnodes ...@@ -77,7 +77,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 2 then if $dnode1Vnodes != 2 then
return -1 return -1
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
return -1 return -1
endi endi
...@@ -146,7 +146,7 @@ print dnode2 $dnode2Vnodes ...@@ -146,7 +146,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 3 then if $dnode1Vnodes != 3 then
goto show4 goto show4
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show4 goto show4
endi endi
...@@ -229,7 +229,7 @@ print dnode3 $dnode3Vnodes ...@@ -229,7 +229,7 @@ print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 3 then if $dnode1Vnodes != 3 then
goto show8 goto show8
endi endi
if $dnode3Vnodes != null then if $dnode3Vnodes != NULL then
goto show8 goto show8
endi endi
...@@ -245,7 +245,7 @@ if $dnode1Role != master then ...@@ -245,7 +245,7 @@ if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
......
...@@ -131,7 +131,7 @@ print dnode3 $dnode3Vnodes ...@@ -131,7 +131,7 @@ print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 3 then if $dnode1Vnodes != 3 then
goto show2 goto show2
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show2 goto show2
endi endi
if $dnode3Vnodes != 3 then if $dnode3Vnodes != 3 then
...@@ -194,7 +194,7 @@ print dnode4 ==> $dnode4Role ...@@ -194,7 +194,7 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -231,7 +231,7 @@ endi ...@@ -231,7 +231,7 @@ endi
if $dnode4Vnodes != 3 then if $dnode4Vnodes != 3 then
goto show4 goto show4
endi endi
if $dnode3Vnodes != null then if $dnode3Vnodes != NULL then
goto show4 goto show4
endi endi
...@@ -248,10 +248,10 @@ print dnode4 ==> $dnode4Role ...@@ -248,10 +248,10 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -339,7 +339,7 @@ print dnode4 $dnode4Vnodes ...@@ -339,7 +339,7 @@ print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data2_5 $dnode5Vnodes = $data2_5
print dnode5 $dnode5Vnodes print dnode5 $dnode5Vnodes
if $dnode1Vnodes != null then if $dnode1Vnodes != NULL then
goto show6 goto show6
endi endi
if $dnode4Vnodes != 3 then if $dnode4Vnodes != 3 then
......
...@@ -110,7 +110,7 @@ endi ...@@ -110,7 +110,7 @@ endi
if $dnode3Vnodes != 3 then if $dnode3Vnodes != 3 then
goto show1 goto show1
endi endi
if $dnode4Vnodes != null then if $dnode4Vnodes != NULL then
goto show1 goto show1
endi endi
...@@ -166,7 +166,7 @@ print dnode4 $dnode4Vnodes ...@@ -166,7 +166,7 @@ print dnode4 $dnode4Vnodes
if $dnode1Vnodes != 3 then if $dnode1Vnodes != 3 then
goto show3 goto show3
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show3 goto show3
endi endi
if $dnode3Vnodes != 3 then if $dnode3Vnodes != 3 then
...@@ -232,7 +232,7 @@ endi ...@@ -232,7 +232,7 @@ endi
if $dnode5Vnodes != 3 then if $dnode5Vnodes != 3 then
goto show5 goto show5
endi endi
if $dnode3Vnodes != null then if $dnode3Vnodes != NULL then
goto show5 goto show5
endi endi
if $dnode4Vnodes != 3 then if $dnode4Vnodes != 3 then
...@@ -298,7 +298,7 @@ endi ...@@ -298,7 +298,7 @@ endi
if $dnode6Vnodes != 3 then if $dnode6Vnodes != 3 then
goto show7 goto show7
endi endi
if $dnode4Vnodes != null then if $dnode4Vnodes != NULL then
goto show7 goto show7
endi endi
......
run unique/cluster/balance1.sim run unique/cluster/balance1.sim
run unique/cluster/balance2.sim run unique/cluster/balance2.sim
run unique/cluster/balance3.sim run unique/cluster/balance3.sim
run unique/cluster/cache.sim
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -118,3 +115,11 @@ if $data01 != 40 then ...@@ -118,3 +115,11 @@ if $data01 != 40 then
return -1 return -1
endi 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
...@@ -44,3 +44,12 @@ sql show databases ...@@ -44,3 +44,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -77,3 +72,11 @@ begin: ...@@ -77,3 +72,11 @@ begin:
goto 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
#run unique/db/commit.sim run unique/db/commit.sim
#run unique/db/delete.sim run unique/db/delete.sim
run unique/db/replica_add12.sim run unique/db/replica_add12.sim
run unique/db/replica_add13.sim run unique/db/replica_add13.sim
run unique/db/replica_add23.sim run unique/db/replica_add23.sim
...@@ -7,4 +7,4 @@ run unique/db/replica_reduce21.sim ...@@ -7,4 +7,4 @@ run unique/db/replica_reduce21.sim
run unique/db/replica_reduce32.sim run unique/db/replica_reduce32.sim
run unique/db/replica_reduce31.sim run unique/db/replica_reduce31.sim
run unique/db/replica_part.sim run unique/db/replica_part.sim
#run unique/db/delete_part.sim run unique/db/delete_part.sim
...@@ -103,7 +103,7 @@ print dnode2 openVnodes $data2_2 ...@@ -103,7 +103,7 @@ print dnode2 openVnodes $data2_2
if $data2_1 != 2 then if $data2_1 != 2 then
goto show4 goto show4
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show4 goto show4
endi endi
if $rows != 1 then if $rows != 1 then
...@@ -131,7 +131,7 @@ print dnode3 openVnodes $data2_3 ...@@ -131,7 +131,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 0 then if $data2_1 != 0 then
goto show5 goto show5
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show5 goto show5
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -155,7 +155,7 @@ print dnode3 openVnodes $data2_3 ...@@ -155,7 +155,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 0 then if $data2_1 != 0 then
return -1 return -1
endi endi
if $data2_2 != null then if $data2_2 != NULL then
return -1 return -1
endi endi
if $data2_3 != 3 then if $data2_3 != 3 then
...@@ -182,7 +182,7 @@ print dnode4 openVnodes $data2_4 ...@@ -182,7 +182,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then if $data2_1 != 0 then
goto show7 goto show7
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show7 goto show7
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -210,7 +210,7 @@ print dnode4 openVnodes $data2_4 ...@@ -210,7 +210,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then if $data2_1 != 0 then
return -1 return -1
endi endi
if $data2_2 != null then if $data2_2 != NULL then
return -1 return -1
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -240,10 +240,10 @@ print dnode4 openVnodes $data2_4 ...@@ -240,10 +240,10 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then if $data2_1 != 0 then
goto show9 goto show9
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show9 goto show9
endi endi
if $data2_3 != null then if $data2_3 != NULL then
goto show9 goto show9
endi endi
if $data2_4 != 4 then if $data2_4 != 4 then
......
...@@ -76,7 +76,7 @@ print dnode3 openVnodes $data2_3 ...@@ -76,7 +76,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 2 then if $data2_1 != 2 then
goto show2 goto show2
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show2 goto show2
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -105,7 +105,7 @@ print dnode4 openVnodes $data2_4 ...@@ -105,7 +105,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then if $data2_1 != 0 then
goto show3 goto show3
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show3 goto show3
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -132,7 +132,7 @@ print dnode4 openVnodes $data2_4 ...@@ -132,7 +132,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then if $data2_1 != 0 then
return -1 return -1
endi endi
if $data2_2 != null then if $data2_2 != NULL then
return -1 return -1
endi endi
if $data2_3 != 3 then if $data2_3 != 3 then
...@@ -163,7 +163,7 @@ print dnode5 openVnodes $data2_5 ...@@ -163,7 +163,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then if $data2_1 != 0 then
goto show5 goto show5
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show5 goto show5
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -196,10 +196,10 @@ print dnode5 openVnodes $data2_5 ...@@ -196,10 +196,10 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then if $data2_1 != 0 then
goto show6 goto show6
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show6 goto show6
endi endi
if $data2_3 != null then if $data2_3 != NULL then
goto show6 goto show6
endi endi
if $data2_4 != 3 then if $data2_4 != 3 then
......
...@@ -88,7 +88,7 @@ print dnode4 openVnodes $data2_4 ...@@ -88,7 +88,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 2 then if $data2_1 != 2 then
goto show2 goto show2
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show2 goto show2
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -122,7 +122,7 @@ print dnode5 openVnodes $data2_5 ...@@ -122,7 +122,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then if $data2_1 != 0 then
goto show3 goto show3
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show3 goto show3
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -162,7 +162,7 @@ print dnode5 openVnodes $data2_5 ...@@ -162,7 +162,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then if $data2_1 != 0 then
goto show4 goto show4
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show4 goto show4
endi endi
if $data2_3 != 3 then if $data2_3 != 3 then
...@@ -228,7 +228,7 @@ endi ...@@ -228,7 +228,7 @@ endi
if $data2_6 != 3 then if $data2_6 != 3 then
goto show6 goto show6
endi endi
if $data2_3 != null then if $data2_3 != NULL then
goto show6 goto show6
endi endi
if $data2_4 != 3 then if $data2_4 != 3 then
......
...@@ -132,7 +132,7 @@ print dnode3 openVnodes $data2_3 ...@@ -132,7 +132,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 1 then if $data2_1 != 1 then
goto show5 goto show5
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show5 goto show5
endi endi
if $data2_3 != 3 then if $data2_3 != 3 then
......
...@@ -63,7 +63,7 @@ print dnode1 $data4_2 ...@@ -63,7 +63,7 @@ print dnode1 $data4_2
if $data4_1 != ready then if $data4_1 != ready then
return -1 return -1
endi endi
if $data4_2 != null then if $data4_2 != NULL then
return -1 return -1
endi endi
......
...@@ -90,7 +90,7 @@ sql show dnodes ...@@ -90,7 +90,7 @@ sql show dnodes
if $data4_1 != ready then if $data4_1 != ready then
goto show4 goto show4
endi endi
if $data4_2 != null then if $data4_2 != NULL then
goto show4 goto show4
endi endi
if $data4_3 != ready then if $data4_3 != ready then
......
...@@ -105,7 +105,7 @@ sql show dnodes ...@@ -105,7 +105,7 @@ sql show dnodes
print dnode1 openVnodes $data2_1 print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2 print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3 print dnode3 openVnodes $data2_3
if $data2_2 != null then if $data2_2 != NULL then
goto show4 goto show4
endi endi
...@@ -130,7 +130,7 @@ print dnode4 openVnodes $data2_4 ...@@ -130,7 +130,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 4 then if $data2_1 != 4 then
goto show5 goto show5
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show5 goto show5
endi endi
if $data2_3 != 2 then if $data2_3 != 2 then
...@@ -194,3 +194,12 @@ endi ...@@ -194,3 +194,12 @@ endi
if $data41 != 35 then if $data41 != 35 then
return -1 return -1
endi 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
...@@ -106,7 +106,7 @@ sql show dnodes ...@@ -106,7 +106,7 @@ sql show dnodes
print dnode1 openVnodes $data2_1 print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2 print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3 print dnode3 openVnodes $data2_3
if $data2_2 != null then if $data2_2 != NULL then
goto show4 goto show4
endi endi
if $data2_1 != 3 then if $data2_1 != 3 then
...@@ -140,3 +140,12 @@ endi ...@@ -140,3 +140,12 @@ endi
if $data41 != 35 then if $data41 != 35 then
return -1 return -1
endi 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
...@@ -4,6 +4,6 @@ run unique/dnode/balance3.sim ...@@ -4,6 +4,6 @@ run unique/dnode/balance3.sim
run unique/dnode/balancex.sim run unique/dnode/balancex.sim
run unique/dnode/offline1.sim run unique/dnode/offline1.sim
run unique/dnode/offline2.sim run unique/dnode/offline2.sim
#run unique/dnode/remove1.sim run unique/dnode/remove1.sim
#run unique/dnode/remove2.sim run unique/dnode/remove2.sim
#run unique/dnode/vnode_clean.sim run unique/dnode/vnode_clean.sim
...@@ -91,7 +91,7 @@ print dnode2 openVnodes $data2_2 ...@@ -91,7 +91,7 @@ print dnode2 openVnodes $data2_2
if $data2_1 != 2 then if $data2_1 != 2 then
goto show4 goto show4
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show4 goto show4
endi endi
if $rows != 1 then if $rows != 1 then
...@@ -220,7 +220,7 @@ print dnode3 openVnodes $data2_3 ...@@ -220,7 +220,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 4 then if $data2_1 != 4 then
goto show9 goto show9
endi endi
if $data2_2 != null then if $data2_2 != NULL then
goto show9 goto show9
endi endi
if $data2_3 != 0 then if $data2_3 != 0 then
...@@ -302,3 +302,11 @@ if $data41 != 45 then ...@@ -302,3 +302,11 @@ if $data41 != 45 then
return -1 return -1
endi 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
...@@ -12,7 +12,7 @@ print ============================ dnode1 start ...@@ -12,7 +12,7 @@ print ============================ dnode1 start
print =============== step1 - parse 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/ 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 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 return -1
endi endi
...@@ -24,7 +24,7 @@ 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/ 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 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 return -1
endi endi
...@@ -129,7 +129,7 @@ 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 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 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 return -1
endi endi
...@@ -147,7 +147,7 @@ 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 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 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 return -1
endi endi
...@@ -235,3 +235,12 @@ print $system_content ...@@ -235,3 +235,12 @@ print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then
return -1 return -1
endi 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
run unique/http/admin.sim run unique/http/admin.sim
#run general/http/opentsdb.sim run general/http/opentsdb.sim
\ No newline at end of file \ No newline at end of file
...@@ -40,14 +40,16 @@ sql create table tb(ts timestamp, i int) ...@@ -40,14 +40,16 @@ sql create table tb(ts timestamp, i int)
print ================= step1 print ================= step1
sql import into tb values(1520000010000, 10000) sql import into tb values(1520000010000, 10000)
sql select * from tb; sql select * from tb;
print $rows
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
print ================= step2 print ================= step2
sql insert into tb values(1520000008000, 8000) sql insert into tb values(1520000008000, 8000)
print $rows
sql select * from tb; sql select * from tb;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -55,7 +57,7 @@ print ================= step3 ...@@ -55,7 +57,7 @@ print ================= step3
sql insert into tb values(1520000020000, 20000) sql insert into tb values(1520000020000, 20000)
sql select * from tb; sql select * from tb;
print $rows print $rows
if $rows != 2 then if $rows != 3 then
return -1 return -1
endi endi
...@@ -64,7 +66,8 @@ sql import into tb values(1520000009000, 9000) ...@@ -64,7 +66,8 @@ sql import into tb values(1520000009000, 9000)
sql import into tb values(1520000015000, 15000) sql import into tb values(1520000015000, 15000)
sql import into tb values(1520000030000, 30000) sql import into tb values(1520000030000, 30000)
sql select * from tb; sql select * from tb;
if $rows != 5 then print $rows
if $rows != 6 then
return -1 return -1
endi endi
...@@ -74,7 +77,8 @@ sql insert into tb values(1520000014000, 14000) ...@@ -74,7 +77,8 @@ sql insert into tb values(1520000014000, 14000)
sql insert into tb values(1520000025000, 25000) sql insert into tb values(1520000025000, 25000)
sql insert into tb values(1520000040000, 40000) sql insert into tb values(1520000040000, 40000)
sql select * from tb; sql select * from tb;
if $rows != 6 then print $rows
if $rows != 9 then
return -1 return -1
endi endi
...@@ -85,7 +89,8 @@ sql import into tb values(1520000023000, 23000) ...@@ -85,7 +89,8 @@ sql import into tb values(1520000023000, 23000)
sql import into tb values(1520000034000, 34000) sql import into tb values(1520000034000, 34000)
sql import into tb values(1520000050000, 50000) sql import into tb values(1520000050000, 50000)
sql select * from tb; sql select * from tb;
if $rows != 11 then print $rows
if $rows != 14 then
return -1 return -1
endi endi
...@@ -95,7 +100,7 @@ sleep 5000 ...@@ -95,7 +100,7 @@ sleep 5000
system sh/exec_up.sh -n dnode1 -s start system sh/exec_up.sh -n dnode1 -s start
sleep 5000 sleep 5000
sql select * from tb; sql select * from tb;
if $rows != 11 then if $rows != 14 then
return -1 return -1
endi endi
...@@ -106,7 +111,8 @@ sql import into tb values(1520000023001, 23001) ...@@ -106,7 +111,8 @@ sql import into tb values(1520000023001, 23001)
sql import into tb values(1520000034001, 34001) sql import into tb values(1520000034001, 34001)
sql import into tb values(1520000050001, 50001) sql import into tb values(1520000050001, 50001)
sql select * from tb; sql select * from tb;
if $rows != 16 then print $rows
if $rows != 19 then
return -1 return -1
endi endi
...@@ -116,7 +122,8 @@ sql insert into tb values(1520000014002, 14002) ...@@ -116,7 +122,8 @@ sql insert into tb values(1520000014002, 14002)
sql insert into tb values(1520000025002, 25002) sql insert into tb values(1520000025002, 25002)
sql insert into tb values(1520000060000, 60000) sql insert into tb values(1520000060000, 60000)
sql select * from tb; sql select * from tb;
if $rows != 17 then print $rows
if $rows != 24 then
return -1 return -1
endi endi
...@@ -148,7 +155,8 @@ sql import into tb values(1521900800000, 50004) ...@@ -148,7 +155,8 @@ sql import into tb values(1521900800000, 50004)
sql import into tb values(1523110400000, 50001) sql import into tb values(1523110400000, 50001)
sql import into tb values(1521382400000, 500051) sql import into tb values(1521382400000, 500051)
sql select * from tb; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
...@@ -158,7 +166,8 @@ sleep 5000 ...@@ -158,7 +166,8 @@ sleep 5000
system sh/exec_up.sh -n dnode1 -s start system sh/exec_up.sh -n dnode1 -s start
sleep 5000 sleep 5000
sql select * from tb; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
...@@ -167,7 +176,7 @@ print ================= step11 ...@@ -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(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 import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003)
sql select * from tb; sql select * from tb;
if $rows != 34 then if $rows != 41 then
return -1 return -1
endi endi
...@@ -176,7 +185,8 @@ print ================= step12 ...@@ -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(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 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; sql select * from tb;
if $rows != 43 then print $rows
if $rows != 50 then
return -1 return -1
endi endi
...@@ -195,7 +205,7 @@ sql import into tb values(1516716800000, 50001) ...@@ -195,7 +205,7 @@ sql import into tb values(1516716800000, 50001)
sql import into tb values(1517580800000, 50001) sql import into tb values(1517580800000, 50001)
sql select * from tb; sql select * from tb;
if $rows != 46 then if $rows != 50 then
return -1 return -1
endi endi
...@@ -205,6 +215,15 @@ sleep 8000 ...@@ -205,6 +215,15 @@ sleep 8000
system sh/exec_up.sh -n dnode1 -s stop system sh/exec_up.sh -n dnode1 -s stop
sleep 10000 sleep 10000
if $rows != 46 then if $rows != 50 then
return -1 return -1
endi 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
...@@ -41,53 +41,59 @@ sql use ir3db ...@@ -41,53 +41,59 @@ sql use ir3db
sql create table tb(ts timestamp, i int) sql create table tb(ts timestamp, i int)
print ================= step1 print ================= step1
sql import into tb values(now+10000a, 10000) sql import into tb values(1520000010000, 10000)
sql select * from tb; sql select * from tb;
print $rows
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
print ================= step2 print ================= step2
sql insert into tb values(now+8000a, 8000) sql insert into tb values(1520000008000, 8000)
print $rows
sql select * from tb; sql select * from tb;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
print ================= step3 print ================= step3
sql insert into tb values(now+20000a, 20000) sql insert into tb values(1520000020000, 20000)
sql select * from tb; sql select * from tb;
if $rows != 2 then print $rows
if $rows != 3 then
return -1 return -1
endi endi
print ================= step4 print ================= step4
sql import into tb values(now+8000a, 9000) sql import into tb values(1520000009000, 9000)
sql import into tb values(now+15000a, 15000) sql import into tb values(1520000015000, 15000)
sql import into tb values(now+30000a, 30000) sql import into tb values(1520000030000, 30000)
sql select * from tb; sql select * from tb;
if $rows != 5 then print $rows
if $rows != 6 then
return -1 return -1
endi endi
print ================= step5 print ================= step5
sql insert into tb values(now+8000a, 8000) sql insert into tb values(1520000008000, 8000)
sql insert into tb values(now+14000a, 14000) sql insert into tb values(1520000014000, 14000)
sql insert into tb values(now+25000a, 25000) sql insert into tb values(1520000025000, 25000)
sql insert into tb values(now+40000a, 40000) sql insert into tb values(1520000040000, 40000)
sql select * from tb; sql select * from tb;
if $rows != 6 then print $rows
if $rows != 9 then
return -1 return -1
endi endi
print ================= step6 print ================= step6
sql import into tb values(now+7000a, 7000) sql import into tb values(1520000007000, 7000)
sql import into tb values(now+12000a, 12000) sql import into tb values(1520000012000, 12000)
sql import into tb values(now+23000a, 23000) sql import into tb values(1520000023000, 23000)
sql import into tb values(now+34000a, 34000) sql import into tb values(1520000034000, 34000)
sql import into tb values(now+50000a, 50000) sql import into tb values(1520000050000, 50000)
sql select * from tb; sql select * from tb;
if $rows != 11 then print $rows
if $rows != 14 then
return -1 return -1
endi endi
...@@ -97,46 +103,63 @@ endi ...@@ -97,46 +103,63 @@ endi
#system sh/exec_up.sh -n dnode1 -s start #system sh/exec_up.sh -n dnode1 -s start
#sleep 5000 #sleep 5000
#sql select * from tb; #sql select * from tb;
#if $rows != 11 then #if $rows != 14 then
# return -1 # return -1
#endi #endi
print ================= step7 print ================= step7
sql import into tb values(now+7001a, 7001) sql import into tb values(1520000007001, 7001)
sql import into tb values(now+12001a, 12001) sql import into tb values(1520000012001, 12001)
sql import into tb values(now+23001a, 23001) sql import into tb values(1520000023001, 23001)
sql import into tb values(now+34001a, 34001) sql import into tb values(1520000034001, 34001)
sql import into tb values(now+50001a, 50001) sql import into tb values(1520000050001, 50001)
sql select * from tb; sql select * from tb;
if $rows != 16 then print $rows
if $rows != 19 then
return -1 return -1
endi endi
print ================= step8 print ================= step8
sql insert into tb values(now+8002a, 8002) sql insert into tb values(1520000008002, 8002)
sql insert into tb values(now+14002a, 14002) sql insert into tb values(1520000014002, 14002)
sql insert into tb values(now+25002a, 25002) sql insert into tb values(1520000025002, 25002)
sql insert into tb values(now+200000a, 60000) sql insert into tb values(1520000060000, 60000)
sql select * from tb; sql select * from tb;
if $rows != 17 then print $rows
if $rows != 24 then
return -1 return -1
endi endi
print ================= step9 print ================= step9
sql import into tb values(now-30d, 7003) #1520000000000
sql import into tb values(now-20d, 34003) #sql import into tb values(now-30d, 7003)
sql import into tb values(now-10d, 34003) #sql import into tb values(now-20d, 34003)
sql import into tb values(now-5d, 34003) #sql import into tb values(now-10d, 34003)
sql import into tb values(now+1m, 50001) #sql import into tb values(now-5d, 34003)
sql import into tb values(now+2m, 50001) #sql import into tb values(now+1d, 50001)
sql import into tb values(now+6m, 50001) #sql import into tb values(now+2d, 50001)
sql import into tb values(now+8m, 50002) #sql import into tb values(now+6d, 50001)
sql import into tb values(now+10m, 50003) #sql import into tb values(now+8d, 50002)
sql import into tb values(now+12m, 50004) #sql import into tb values(now+10d, 50003)
sql import into tb values(now+14m, 50001) #sql import into tb values(now+12d, 50004)
sql import into tb values(now+16m, 500051) #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; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
...@@ -146,21 +169,27 @@ sleep 5000 ...@@ -146,21 +169,27 @@ sleep 5000
system sh/exec_up.sh -n dnode1 -s start system sh/exec_up.sh -n dnode1 -s start
sleep 5000 sleep 5000
sql select * from tb; sql select * from tb;
if $rows != 29 then print $rows
if $rows != 36 then
return -1 return -1
endi endi
print ================= step11 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; sql select * from tb;
if $rows != 34 then if $rows != 41 then
return -1 return -1
endi endi
print ================= step12 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; sql select * from tb;
if $rows != 43 then print $rows
if $rows != 50 then
return -1 return -1
endi endi
...@@ -169,11 +198,17 @@ system sh/exec_up.sh -n dnode2 -s stop ...@@ -169,11 +198,17 @@ system sh/exec_up.sh -n dnode2 -s stop
sleep 5000 sleep 5000
print ================= step14 print ================= step14
sql import into tb values(now-48d, 34003) #1520000000000
sql import into tb values(now-38d, 50001) #sql import into tb values(now-48d, 34003)
sql import into tb values(now-28d, 50001) #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; sql select * from tb;
if $rows != 46 then if $rows != 50 then
return -1 return -1
endi endi
...@@ -183,6 +218,15 @@ sleep 8000 ...@@ -183,6 +218,15 @@ sleep 8000
system sh/exec_up.sh -n dnode3 -s stop system sh/exec_up.sh -n dnode3 -s stop
sleep 3000 sleep 3000
if $rows != 46 then if $rows != 50 then
return -1 return -1
endi 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
#run unique/import/replica2.sim run unique/import/replica2.sim
#run unique/import/replica3.sim run unique/import/replica3.sim
\ No newline at end of file \ No newline at end of file
...@@ -76,7 +76,7 @@ print dnode2 $dnode2Vnodes ...@@ -76,7 +76,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 0 then if $dnode1Vnodes != 0 then
goto show1 goto show1
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show1 goto show1
endi endi
print =============== step3 start dnode2 print =============== step3 start dnode2
...@@ -137,3 +137,12 @@ print select * from $mt ==> $rows ...@@ -137,3 +137,12 @@ print select * from $mt ==> $rows
if $rows != 2600 then if $rows != 2600 then
return -1 return -1
endi 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
...@@ -196,3 +196,12 @@ sql show databases ...@@ -196,3 +196,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -149,3 +149,12 @@ sql show databases ...@@ -149,3 +149,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -225,3 +225,12 @@ sql show databases ...@@ -225,3 +225,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -216,3 +216,12 @@ sql show databases ...@@ -216,3 +216,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -193,3 +193,12 @@ sql show databases ...@@ -193,3 +193,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -246,3 +246,12 @@ sql show databases ...@@ -246,3 +246,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
...@@ -215,3 +215,12 @@ sql show databases ...@@ -215,3 +215,12 @@ sql show databases
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi 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
#run unique/metrics/disk.sim run unique/metrics/balance_replica1.sim
#run unique/metrics/metrics.sim run unique/metrics/dnode2_stop.sim
#run unique/metrics/values.sim run unique/metrics/dnode2.sim
#run unique/metrics/vnode3.sim run unique/metrics/dnode3.sim
\ No newline at end of file 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
...@@ -100,7 +100,7 @@ endi ...@@ -100,7 +100,7 @@ endi
if $data2_2 != slave then if $data2_2 != slave then
goto show7 goto show7
endi endi
if $data3_3 != null then if $data3_3 != NULL then
goto show7 goto show7
endi endi
......
...@@ -59,7 +59,7 @@ endi ...@@ -59,7 +59,7 @@ endi
if $dnode2Role != slave then if $dnode2Role != slave then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role ...@@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role ...@@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
......
...@@ -59,7 +59,7 @@ endi ...@@ -59,7 +59,7 @@ endi
if $dnode2Role != slave then if $dnode2Role != slave then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role ...@@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
......
...@@ -59,7 +59,7 @@ endi ...@@ -59,7 +59,7 @@ endi
if $dnode2Role != slave then if $dnode2Role != slave then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -79,7 +79,7 @@ print dnode3 ==> $dnode3Role ...@@ -79,7 +79,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role ...@@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
......
...@@ -18,10 +18,10 @@ print dnode3 ==> $data3_3 ...@@ -18,10 +18,10 @@ print dnode3 ==> $data3_3
if $data2_1 != master then if $data2_1 != master then
return -1 return -1
endi endi
if $data3_2 != null then if $data3_2 != NULL then
return -1 return -1
endi endi
if $data3_3 != null then if $data3_3 != NULL then
return -1 return -1
endi endi
...@@ -44,7 +44,7 @@ endi ...@@ -44,7 +44,7 @@ endi
if $dnode2Role != slave then if $dnode2Role != slave then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -86,7 +86,7 @@ print dnode3 ==> $dnode3Role ...@@ -86,7 +86,7 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -156,7 +156,7 @@ print dnode1 ==> $dnode1Role ...@@ -156,7 +156,7 @@ print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role print dnode3 ==> $dnode3Role
if $dnode1Role != null then if $dnode1Role != NULL then
return -1 return -1
endi endi
#if $dnode2Role != master then #if $dnode2Role != master then
......
...@@ -22,10 +22,10 @@ print dnode3 ==> $data3_3 ...@@ -22,10 +22,10 @@ print dnode3 ==> $data3_3
if $data2_1 != master then if $data2_1 != master then
return -1 return -1
endi endi
if $data3_2 != null then if $data3_2 != NULL then
return -1 return -1
endi endi
if $data3_3 != null then if $data3_3 != NULL then
return -1 return -1
endi endi
...@@ -50,10 +50,10 @@ endi ...@@ -50,10 +50,10 @@ endi
if $dnode2Role != slave then if $dnode2Role != slave then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
if $dnode4Role != null then if $dnode4Role != NULL then
return -1 return -1
endi endi
...@@ -81,7 +81,7 @@ endi ...@@ -81,7 +81,7 @@ endi
if $dnode3Role != slave then if $dnode3Role != slave then
return -1 return -1
endi endi
if $dnode4Role != null then if $dnode4Role != NULL then
return -1 return -1
endi endi
...@@ -110,7 +110,7 @@ endi ...@@ -110,7 +110,7 @@ endi
if $dnode3Role != slave then if $dnode3Role != slave then
return -1 return -1
endi endi
if $dnode4Role != null then if $dnode4Role != NULL then
return -1 return -1
endi endi
...@@ -131,7 +131,7 @@ print dnode4 ==> $dnode4Role ...@@ -131,7 +131,7 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -165,7 +165,7 @@ print dnode4 ==> $dnode4Role ...@@ -165,7 +165,7 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != slave then if $dnode3Role != slave then
...@@ -207,7 +207,7 @@ print dnode2 ==> $dnode2Role ...@@ -207,7 +207,7 @@ print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role print dnode4 ==> $dnode4Role
if $dnode1Role != null then if $dnode1Role != NULL then
return -1 return -1
endi endi
if $dnode2Role != slave then if $dnode2Role != slave then
......
...@@ -23,10 +23,10 @@ print dnode3 ==> $dnode3Role ...@@ -23,10 +23,10 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then if $dnode1Role != master then
return -1 return -1
endi endi
if $dnode2Role != null then if $dnode2Role != NULL then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
...@@ -71,10 +71,15 @@ endi ...@@ -71,10 +71,15 @@ endi
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $dnode3Role != null then if $dnode3Role != NULL then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file 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
...@@ -34,6 +34,11 @@ if $data4_2 != 4 then ...@@ -34,6 +34,11 @@ if $data4_2 != 4 then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file 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
...@@ -192,7 +192,7 @@ print dnode2 $dnode2Vnodes ...@@ -192,7 +192,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 0 then if $dnode1Vnodes != 0 then
goto show1 goto show1
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show1 goto show1
endi endi
......
...@@ -129,7 +129,7 @@ print dnode2 $dnode2Vnodes ...@@ -129,7 +129,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 0 then if $dnode1Vnodes != 0 then
goto show1 goto show1
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show1 goto show1
endi endi
......
...@@ -163,7 +163,7 @@ print dnode2 $dnode2Vnodes ...@@ -163,7 +163,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 6 then if $dnode1Vnodes != 6 then
goto show1 goto show1
endi endi
if $dnode2Vnodes != null then if $dnode2Vnodes != NULL then
goto show1 goto show1
endi endi
...@@ -214,7 +214,7 @@ print dnode1 $dnode1Vnodes ...@@ -214,7 +214,7 @@ print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2 $dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes print dnode2 $dnode2Vnodes
if $dnode1Vnodes != null then if $dnode1Vnodes != NULL then
goto show6 goto show6
endi endi
if $dnode2Vnodes != 6 then if $dnode2Vnodes != 6 then
......
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode3 -i 3
...@@ -80,3 +75,11 @@ begin: ...@@ -80,3 +75,11 @@ begin:
goto 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
#run unique/table/delete_part.sim run unique/table/delete_part.sim
...@@ -148,4 +148,11 @@ if $rows != $remainRows then ...@@ -148,4 +148,11 @@ if $rows != $remainRows then
return -1 return -1
endi 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
...@@ -113,4 +113,11 @@ if $x < 5 then ...@@ -113,4 +113,11 @@ if $x < 5 then
goto loop goto loop
endi 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
...@@ -188,5 +188,12 @@ if $rows != $expect then ...@@ -188,5 +188,12 @@ if $rows != $expect then
endi endi
print =================== step 12 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
...@@ -71,4 +71,11 @@ if $x < 5 then ...@@ -71,4 +71,11 @@ if $x < 5 then
goto loop goto loop
endi 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
...@@ -80,4 +80,11 @@ if $x < 5 then ...@@ -80,4 +80,11 @@ if $x < 5 then
goto loop goto loop
endi 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
...@@ -61,5 +61,11 @@ endw ...@@ -61,5 +61,11 @@ endw
# return -1 # return -1
#endi #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
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_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_basic.sim
#run unique/vnode/replica3_repeat.sim run unique/vnode/replica3_repeat.sim
#run unique/vnode/commit.sim run unique/vnode/replica3_vgroup.sim
#run unique/vnode/many.sim
...@@ -763,7 +763,7 @@ endi ...@@ -763,7 +763,7 @@ endi
if $data21 != INT then if $data21 != INT then
return -1 return -1
endi endi
if $data30 != null then if $data30 != NULL then
return -1 return -1
endi endi
......
...@@ -666,7 +666,7 @@ endi ...@@ -666,7 +666,7 @@ endi
if $data11 != INT then if $data11 != INT then
return -1 return -1
endi endi
if $data20 != null then if $data20 != NULL then
return -1 return -1
endi endi
......
...@@ -537,7 +537,7 @@ endi ...@@ -537,7 +537,7 @@ endi
if $data04 != false then if $data04 != false then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
......
...@@ -386,7 +386,7 @@ endi ...@@ -386,7 +386,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -413,7 +413,7 @@ endi ...@@ -413,7 +413,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -440,7 +440,7 @@ endi ...@@ -440,7 +440,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -467,7 +467,7 @@ endi ...@@ -467,7 +467,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -494,7 +494,7 @@ endi ...@@ -494,7 +494,7 @@ endi
if $data06 != 6 then if $data06 != 6 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
......
...@@ -420,7 +420,7 @@ endi ...@@ -420,7 +420,7 @@ endi
if $data02 != true then if $data02 != true then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -444,7 +444,7 @@ endi ...@@ -444,7 +444,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -468,7 +468,7 @@ endi ...@@ -468,7 +468,7 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -492,7 +492,7 @@ endi ...@@ -492,7 +492,7 @@ endi
if $data02 != 1.000000000 then if $data02 != 1.000000000 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
...@@ -516,10 +516,10 @@ endi ...@@ -516,10 +516,10 @@ endi
if $data02 != true then if $data02 != true then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -546,10 +546,10 @@ endi ...@@ -546,10 +546,10 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -576,10 +576,10 @@ endi ...@@ -576,10 +576,10 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -606,10 +606,10 @@ endi ...@@ -606,10 +606,10 @@ endi
if $data02 != 1.000000000 then if $data02 != 1.000000000 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
...@@ -636,13 +636,13 @@ endi ...@@ -636,13 +636,13 @@ endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
if $data03 != null then if $data03 != NULL then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
...@@ -675,13 +675,13 @@ endi ...@@ -675,13 +675,13 @@ endi
if $data03 != 4.0000 then if $data03 != 4.0000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
...@@ -714,16 +714,16 @@ endi ...@@ -714,16 +714,16 @@ endi
if $data03 != 4.000000000 then if $data03 != 4.000000000 then
return -1 return -1
endi endi
if $data04 != null then if $data04 != NULL then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -763,13 +763,13 @@ endi ...@@ -763,13 +763,13 @@ endi
if $data04 != 5.000000000 then if $data04 != 5.000000000 then
return -1 return -1
endi endi
if $data05 != null then if $data05 != NULL then
return -1 return -1
endi endi
if $data06 != null then if $data06 != NULL then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
......
...@@ -330,7 +330,7 @@ endi ...@@ -330,7 +330,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -357,7 +357,7 @@ endi ...@@ -357,7 +357,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -384,7 +384,7 @@ endi ...@@ -384,7 +384,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -411,7 +411,7 @@ endi ...@@ -411,7 +411,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
...@@ -438,7 +438,7 @@ endi ...@@ -438,7 +438,7 @@ endi
if $data06 != 11 then if $data06 != 11 then
return -1 return -1
endi endi
if $data07 != null then if $data07 != NULL then
return -1 return -1
endi endi
......
...@@ -584,7 +584,7 @@ bool simCreateNativeConnect(SScript *script, char *user, char *pass) { ...@@ -584,7 +584,7 @@ bool simCreateNativeConnect(SScript *script, char *user, char *pass) {
void *taos = NULL; void *taos = NULL;
taosMsleep(2000); taosMsleep(2000);
for (int attempt = 0; attempt < 10; ++attempt) { 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) { if (taos == NULL) {
simTrace("script:%s, user:%s connect taosd failed:%s, attempt:%d", script->fileName, user, taos_errstr(NULL), attempt); simTrace("script:%s, user:%s connect taosd failed:%s, attempt:%d", script->fileName, user, taos_errstr(NULL), attempt);
taosMsleep(1000); taosMsleep(1000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册