Merge branch 'develop' into feature/query
This commit is contained in:
commit
59a77a3657
50
.travis.yml
50
.travis.yml
|
@ -24,10 +24,11 @@ matrix:
|
|||
- python-setuptools
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
- valgrind
|
||||
|
||||
before_install:
|
||||
- sudo apt update -y -qq
|
||||
- sudo apt install -y net-tools python-pip python-setuptools python3-pip python3-setuptools
|
||||
- sudo apt install -y net-tools python-pip python-setuptools python3-pip python3-setuptools valgrind
|
||||
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
|
@ -43,16 +44,32 @@ matrix:
|
|||
case $TRAVIS_OS_NAME in
|
||||
linux)
|
||||
cd ${TRAVIS_BUILD_DIR}/debug
|
||||
sudo make install || exit $?
|
||||
sudo make install || travis_terminate $?
|
||||
|
||||
pip install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python2/
|
||||
pip3 install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python3/
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}/tests
|
||||
bash ./test-all.sh
|
||||
./test-all.sh || travis_terminate $?
|
||||
|
||||
if [ "$?" -ne "0" ]; then
|
||||
exit $?
|
||||
cd ${TRAVIS_BUILD_DIR}/tests/pytest
|
||||
./simpletest.sh -g 2>&1 | tee mem-error-out.txt
|
||||
sleep 1
|
||||
|
||||
# Color setting
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[1;32m'
|
||||
GREEN_DARK='\033[0;32m'
|
||||
GREEN_UNDERLINE='\033[4;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
memError=`grep -m 1 'ERROR SUMMARY' mem-error-out.txt | awk '{print $4}'`
|
||||
|
||||
if [ -n "$memError" ]; then
|
||||
if [ "$memError" -gt 23 ]; then
|
||||
echo -e "${RED} ## Memory errors number valgrind reports is $memError. More than our threshold! ## ${NC} "
|
||||
travis_terminate $memError
|
||||
fi
|
||||
fi
|
||||
|
||||
;;
|
||||
|
@ -74,20 +91,20 @@ matrix:
|
|||
# GitHub project metadata
|
||||
# ** specific to your project **
|
||||
project:
|
||||
name: sangshuduo/TDengine
|
||||
name: TDengine
|
||||
version: 2.x
|
||||
description: sangshuduo/TDengine
|
||||
description: taosdata/TDengine
|
||||
|
||||
# Where email notification of build analysis results will be sent
|
||||
notification_email: sangshuduo@gmail.com
|
||||
notification_email: sdsang@taosdata.com
|
||||
|
||||
# Commands to prepare for build_command
|
||||
# ** likely specific to your build **
|
||||
build_command_prepend: cmake ..
|
||||
build_command_prepend: cmake .
|
||||
|
||||
# The command that will be added as an argument to "cov-build" to compile your project for analysis,
|
||||
# ** likely specific to your build **
|
||||
build_command: cmake --build .
|
||||
build_command: make
|
||||
|
||||
# Pattern to match selecting branches that will run analysis. We recommend leaving this set to 'coverity_scan'.
|
||||
# Take care in resource usage, and consider the build frequency allowances per
|
||||
|
@ -132,22 +149,25 @@ matrix:
|
|||
case $TRAVIS_OS_NAME in
|
||||
linux)
|
||||
cd ${TRAVIS_BUILD_DIR}/debug
|
||||
sudo make install || exit $?
|
||||
sudo make install || travis_terminate $?
|
||||
|
||||
pip install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python2/
|
||||
pip3 install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python3/
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}/tests
|
||||
|
||||
bash ./test-all.sh
|
||||
./test-all.sh
|
||||
|
||||
if [ "$?" -ne "0" ]; then
|
||||
exit $?
|
||||
travis_terminate $?
|
||||
fi
|
||||
|
||||
sudo pkill taosd
|
||||
sleep 1
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}
|
||||
lcov -d . --capture --rc lcov_branch_coverage=1 -o coverage.info
|
||||
lcov -l --rc lcov_branch_coverage=1 coverage.info || exit $?
|
||||
lcov -l --rc lcov_branch_coverage=1 coverage.info || travis_terminate $?
|
||||
|
||||
gem install coveralls-lcov
|
||||
|
||||
|
@ -163,7 +183,6 @@ matrix:
|
|||
echo -e "${GREEN} ## Uploaded to Coveralls.io! ## ${NC}"
|
||||
else
|
||||
echo -e "${RED} ## Coveralls.io not collect coverage report! ## ${NC} "
|
||||
exit $?
|
||||
fi
|
||||
|
||||
bash <(curl -s https://codecov.io/bash) -y .codecov.yml -f coverage.info
|
||||
|
@ -171,7 +190,6 @@ matrix:
|
|||
echo -e "${GREEN} ## Uploaded to Codecov! ## ${NC} "
|
||||
else
|
||||
echo -e "${RED} ## Codecov did not collect coverage report! ## ${NC} "
|
||||
exit $?
|
||||
fi
|
||||
|
||||
;;
|
||||
|
|
|
@ -451,7 +451,7 @@ extern void * tscQhandle;
|
|||
extern int tscKeepConn[];
|
||||
extern int tsInsertHeadSize;
|
||||
extern int tscNumOfThreads;
|
||||
extern SRpcIpSet tscMgmtIpList;
|
||||
extern SRpcIpSet tscMgmtIpSet;
|
||||
|
||||
typedef void (*__async_cb_func_t)(void *param, TAOS_RES *tres, int numOfRows);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#define TSC_MGMT_VNODE 999
|
||||
|
||||
SRpcIpSet tscMgmtIpList;
|
||||
SRpcIpSet tscMgmtIpSet;
|
||||
SRpcIpSet tscDnodeIpSet;
|
||||
|
||||
int (*tscBuildMsg[TSDB_SQL_MAX])(SSqlObj *pSql, SSqlInfo *pInfo) = {0};
|
||||
|
@ -58,35 +58,40 @@ static void tscSetDnodeIpList(SSqlObj* pSql, STableMeta* pTableMeta) {
|
|||
}
|
||||
|
||||
void tscPrintMgmtIp() {
|
||||
if (tscMgmtIpList.numOfIps <= 0) {
|
||||
tscError("invalid mgmt IP list:%d", tscMgmtIpList.numOfIps);
|
||||
if (tscMgmtIpSet.numOfIps <= 0) {
|
||||
tscError("invalid mgmt IP list:%d", tscMgmtIpSet.numOfIps);
|
||||
} else {
|
||||
for (int i = 0; i < tscMgmtIpList.numOfIps; ++i) {
|
||||
tscTrace("mgmt index:%d ip:%d", i, tscMgmtIpList.ip[i]);
|
||||
for (int i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
|
||||
tscTrace("mgmt index:%d ip:%d", i, tscMgmtIpSet.ip[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tscSetMgmtIpListFromCluster(SRpcIpSet *pIpList) {
|
||||
tscMgmtIpList.numOfIps = htons(pIpList->numOfIps);
|
||||
tscMgmtIpList.inUse = htons(pIpList->inUse);
|
||||
tscMgmtIpList.port = htons(pIpList->port);
|
||||
for (int32_t i = 0; i <tscMgmtIpList.numOfIps; ++i) {
|
||||
tscMgmtIpList.ip[i] = pIpList->ip[i];
|
||||
tscMgmtIpSet.numOfIps = pIpList->numOfIps;
|
||||
tscMgmtIpSet.inUse = pIpList->inUse;
|
||||
tscMgmtIpSet.port = htons(pIpList->port);
|
||||
for (int32_t i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
|
||||
tscMgmtIpSet.ip[i] = htonl(pIpList->ip[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void tscSetMgmtIpListFromEdge() {
|
||||
if (tscMgmtIpList.numOfIps != 1) {
|
||||
tscMgmtIpList.numOfIps = 1;
|
||||
tscMgmtIpList.inUse = 0;
|
||||
tscMgmtIpList.port = tsMnodeShellPort;
|
||||
tscMgmtIpList.ip[0] = inet_addr(tsMasterIp);
|
||||
if (tscMgmtIpSet.numOfIps != 1) {
|
||||
tscMgmtIpSet.numOfIps = 1;
|
||||
tscMgmtIpSet.inUse = 0;
|
||||
tscMgmtIpSet.port = tsMnodeShellPort;
|
||||
tscMgmtIpSet.ip[0] = inet_addr(tsMasterIp);
|
||||
tscTrace("edge mgmt IP list:");
|
||||
tscPrintMgmtIp();
|
||||
}
|
||||
}
|
||||
|
||||
void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
|
||||
tscTrace("mgmt IP list is changed for ufp is called");
|
||||
tscMgmtIpSet = *pIpSet;
|
||||
}
|
||||
|
||||
void tscSetMgmtIpList(SRpcIpSet *pIpList) {
|
||||
/*
|
||||
* The iplist returned by the cluster edition is the current management nodes
|
||||
|
@ -109,7 +114,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) {
|
|||
UNUSED_FUNC
|
||||
static int32_t tscGetMgmtConnMaxRetryTimes() {
|
||||
int32_t factor = 2;
|
||||
return tscMgmtIpList.numOfIps * factor;
|
||||
return tscMgmtIpSet.numOfIps * factor;
|
||||
}
|
||||
|
||||
void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
|
||||
|
@ -204,7 +209,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
|
|||
};
|
||||
rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg);
|
||||
} else {
|
||||
pSql->ipList = tscMgmtIpList;
|
||||
pSql->ipList = tscMgmtIpSet;
|
||||
pSql->ipList.port = tsMnodeShellPort;
|
||||
|
||||
tscTrace("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList.port);
|
||||
|
@ -425,7 +430,7 @@ int tscProcessSql(SSqlObj *pSql) {
|
|||
return pSql->res.code;
|
||||
}
|
||||
} else if (pSql->cmd.command < TSDB_SQL_LOCAL) {
|
||||
pSql->ipList = tscMgmtIpList;
|
||||
pSql->ipList = tscMgmtIpSet;
|
||||
} else { // local handler
|
||||
return (*tscProcessMsgRsp[pCmd->command])(pSql);
|
||||
}
|
||||
|
@ -2229,10 +2234,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
|
|||
assert(len <= tListLen(pObj->db));
|
||||
strncpy(pObj->db, temp, tListLen(pObj->db));
|
||||
|
||||
// SIpList * pIpList;
|
||||
// char *rsp = pRes->pRsp + sizeof(SCMConnectRsp);
|
||||
// pIpList = (SIpList *)rsp;
|
||||
// tscSetMgmtIpList(pIpList);
|
||||
tscSetMgmtIpList(&pConnect->ipList);
|
||||
|
||||
strcpy(pObj->sversion, pConnect->serverVersion);
|
||||
pObj->writeAuth = pConnect->writeAuth;
|
||||
|
|
|
@ -72,23 +72,23 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
|
|||
}
|
||||
|
||||
if (ip && ip[0]) {
|
||||
tscMgmtIpList.inUse = 0;
|
||||
tscMgmtIpList.port = tsMnodeShellPort;
|
||||
tscMgmtIpList.numOfIps = 1;
|
||||
tscMgmtIpList.ip[0] = inet_addr(ip);
|
||||
tscMgmtIpSet.inUse = 0;
|
||||
tscMgmtIpSet.port = tsMnodeShellPort;
|
||||
tscMgmtIpSet.numOfIps = 1;
|
||||
tscMgmtIpSet.ip[0] = inet_addr(ip);
|
||||
|
||||
if (tsMasterIp[0] && strcmp(ip, tsMasterIp) != 0) {
|
||||
tscMgmtIpList.numOfIps = 2;
|
||||
tscMgmtIpList.ip[1] = inet_addr(tsMasterIp);
|
||||
tscMgmtIpSet.numOfIps = 2;
|
||||
tscMgmtIpSet.ip[1] = inet_addr(tsMasterIp);
|
||||
}
|
||||
|
||||
if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) {
|
||||
tscMgmtIpList.numOfIps = 3;
|
||||
tscMgmtIpList.ip[2] = inet_addr(tsSecondIp);
|
||||
tscMgmtIpSet.numOfIps = 3;
|
||||
tscMgmtIpSet.ip[2] = inet_addr(tsSecondIp);
|
||||
}
|
||||
}
|
||||
|
||||
tscMgmtIpList.port = port ? port : tsMnodeShellPort;
|
||||
tscMgmtIpSet.port = port ? port : tsMnodeShellPort;
|
||||
|
||||
STscObj *pObj = (STscObj *)calloc(1, sizeof(STscObj));
|
||||
if (NULL == pObj) {
|
||||
|
|
|
@ -42,11 +42,13 @@ void * tscTmr;
|
|||
void * tscQhandle;
|
||||
void * tscCheckDiskUsageTmr;
|
||||
int tsInsertHeadSize;
|
||||
char tsLastUser[TSDB_USER_LEN + 1];
|
||||
|
||||
int tscNumOfThreads;
|
||||
|
||||
static pthread_once_t tscinit = PTHREAD_ONCE_INIT;
|
||||
void taosInitNote(int numOfNoteLines, int maxNotes, char* lable);
|
||||
void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet);
|
||||
|
||||
void tscCheckDiskUsage(void *para, void *unused) {
|
||||
taosGetDisk();
|
||||
|
@ -65,6 +67,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
|
|||
rpcInit.label = "TSC-vnode";
|
||||
rpcInit.numOfThreads = tscNumOfThreads;
|
||||
rpcInit.cfp = tscProcessMsgFromServer;
|
||||
rpcInit.ufp = tscUpdateIpSet;
|
||||
rpcInit.sessions = tsMaxVnodeConnections;
|
||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||
rpcInit.user = (char*)user;
|
||||
|
@ -79,6 +82,13 @@ int32_t tscInitRpc(const char *user, const char *secret) {
|
|||
}
|
||||
}
|
||||
|
||||
// not stop service, switch users
|
||||
if (strcmp(tsLastUser, user) != 0 && pTscMgmtConn != NULL) {
|
||||
tscTrace("switch user from %s to %s", user, tsLastUser);
|
||||
rpcClose(pTscMgmtConn);
|
||||
pTscMgmtConn = NULL;
|
||||
}
|
||||
|
||||
if (pTscMgmtConn == NULL) {
|
||||
memset(&rpcInit, 0, sizeof(rpcInit));
|
||||
rpcInit.localIp = tsLocalIp;
|
||||
|
@ -92,6 +102,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
|
|||
rpcInit.user = (char*)user;
|
||||
rpcInit.ckey = "key";
|
||||
rpcInit.secret = secretEncrypt;
|
||||
strcpy(tsLastUser, user);
|
||||
|
||||
pTscMgmtConn = rpcOpen(&rpcInit);
|
||||
if (pTscMgmtConn == NULL) {
|
||||
|
@ -145,14 +156,14 @@ void taos_init_imp() {
|
|||
taosInitNote(tsNumOfLogLines / 10, 1, (char*)"tsc_note");
|
||||
}
|
||||
|
||||
tscMgmtIpList.inUse = 0;
|
||||
tscMgmtIpList.port = tsMnodeShellPort;
|
||||
tscMgmtIpList.numOfIps = 1;
|
||||
tscMgmtIpList.ip[0] = inet_addr(tsMasterIp);
|
||||
tscMgmtIpSet.inUse = 0;
|
||||
tscMgmtIpSet.port = tsMnodeShellPort;
|
||||
tscMgmtIpSet.numOfIps = 1;
|
||||
tscMgmtIpSet.ip[0] = inet_addr(tsMasterIp);
|
||||
|
||||
if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) {
|
||||
tscMgmtIpList.numOfIps = 2;
|
||||
tscMgmtIpList.ip[1] = inet_addr(tsSecondIp);
|
||||
tscMgmtIpSet.numOfIps = 2;
|
||||
tscMgmtIpSet.ip[1] = inet_addr(tsSecondIp);
|
||||
}
|
||||
|
||||
tscInitMsgsFp();
|
||||
|
|
|
@ -59,6 +59,7 @@ extern uint16_t tsMnodeDnodePort;
|
|||
extern uint16_t tsMnodeShellPort;
|
||||
extern uint16_t tsDnodeShellPort;
|
||||
extern uint16_t tsDnodeMnodePort;
|
||||
extern uint16_t tsSyncPort;
|
||||
|
||||
extern int tsStatusInterval;
|
||||
extern int tsShellActivityTimer;
|
||||
|
|
|
@ -44,6 +44,11 @@ extern int32_t tscEmbedded;
|
|||
#define uPrint(...) \
|
||||
{ taosPrintLog("UTL ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }
|
||||
|
||||
#define pError(...) \
|
||||
{ taosPrintLog("ERROR APP ", 255, __VA_ARGS__); }
|
||||
#define pPrint(...) \
|
||||
{ taosPrintLog("APP ", 255, __VA_ARGS__); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -65,7 +65,8 @@ char tsSecondIp[TSDB_IPv4ADDR_LEN] = {0};
|
|||
uint16_t tsMnodeShellPort = 6030; // udp[6030-6034] tcp[6030]
|
||||
uint16_t tsDnodeShellPort = 6035; // udp[6035-6039] tcp[6035]
|
||||
uint16_t tsMnodeDnodePort = 6040; // udp/tcp
|
||||
uint16_t tsDnodeMnodePort = 6041; // udp/tcp
|
||||
uint16_t tsDnodeMnodePort = 6045; // udp/tcp
|
||||
uint16_t tsSyncPort = 6050;
|
||||
|
||||
int32_t tsStatusInterval = 1; // second
|
||||
int32_t tsShellActivityTimer = 3; // second
|
||||
|
|
|
@ -34,26 +34,33 @@
|
|||
|
||||
#define MPEER_CONTENT_LEN 2000
|
||||
|
||||
static bool dnodeReadMnodeIpList();
|
||||
static void dnodeSaveMnodeIpList();
|
||||
static void dnodeReadDnodeInfo();
|
||||
static void dnodeUpdateDnodeInfo(int32_t dnodeId);
|
||||
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 SRpcIpSet tsMnodeIpList = {0};
|
||||
static SDMNodeInfos tsMnodeInfos = {0};
|
||||
static void *tsDnodeMClientRpc = NULL;
|
||||
static void *tsDnodeTmr = NULL;
|
||||
static void *tsStatusTimer = NULL;
|
||||
static uint32_t tsRebootTime;
|
||||
static int32_t tsDnodeId = 0;
|
||||
static char tsDnodeName[TSDB_NODE_NAME_LEN];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int32_t dnodeInitMClient() {
|
||||
dnodeReadDnodeInfo();
|
||||
dnodeReadDnodeCfg();
|
||||
tsRebootTime = taosGetTimestampSec();
|
||||
|
||||
tsDnodeTmr = taosTmrInit(100, 200, 60000, "DND-DM");
|
||||
|
@ -62,22 +69,22 @@ int32_t dnodeInitMClient() {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!dnodeReadMnodeIpList()) {
|
||||
memset(&tsMnodeIpList, 0, sizeof(SRpcIpSet));
|
||||
memset(&tsMnodeInfos, 0, sizeof(SDMNodeInfos));
|
||||
tsMnodeIpList.port = tsMnodeDnodePort;
|
||||
tsMnodeIpList.numOfIps = 1;
|
||||
tsMnodeIpList.ip[0] = inet_addr(tsMasterIp);
|
||||
if (!dnodeReadMnodeInfos()) {
|
||||
memset(&tsMnodeIpSet, 0, sizeof(SRpcIpSet));
|
||||
memset(&tsMnodeInfos, 0, sizeof(SDMMnodeInfos));
|
||||
tsMnodeIpSet.port = tsMnodeDnodePort;
|
||||
tsMnodeIpSet.numOfIps = 1;
|
||||
tsMnodeIpSet.ip[0] = inet_addr(tsMasterIp);
|
||||
if (strcmp(tsSecondIp, tsMasterIp) != 0) {
|
||||
tsMnodeIpList.numOfIps = 2;
|
||||
tsMnodeIpList.ip[1] = inet_addr(tsSecondIp);
|
||||
tsMnodeIpSet.numOfIps = 2;
|
||||
tsMnodeIpSet.ip[1] = inet_addr(tsSecondIp);
|
||||
}
|
||||
} else {
|
||||
tsMnodeIpList.inUse = tsMnodeInfos.inUse;
|
||||
tsMnodeIpList.numOfIps = tsMnodeInfos.nodeNum;
|
||||
tsMnodeIpList.port = tsMnodeInfos.nodeInfos[0].nodePort;
|
||||
tsMnodeIpSet.inUse = tsMnodeInfos.inUse;
|
||||
tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum;
|
||||
tsMnodeIpSet.port = tsMnodeInfos.nodeInfos[0].nodePort;
|
||||
for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) {
|
||||
tsMnodeIpList.ip[i] = tsMnodeInfos.nodeInfos[i].nodeIp;
|
||||
tsMnodeIpSet.ip[i] = tsMnodeInfos.nodeInfos[i].nodeIp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,6 +95,7 @@ int32_t dnodeInitMClient() {
|
|||
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;
|
||||
|
@ -144,58 +152,68 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
|
|||
}
|
||||
|
||||
SDMStatusRsp *pStatusRsp = pMsg->pCont;
|
||||
SDMNodeInfos *mnodes = &pStatusRsp->mnodes;
|
||||
if (mnodes->nodeNum <= 0) {
|
||||
dError("status msg is invalid, num of ips is %d", mnodes->nodeNum);
|
||||
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;
|
||||
}
|
||||
|
||||
SDnodeState *pState = &pStatusRsp->dnodeState;
|
||||
pState->numOfVnodes = htonl(pState->numOfVnodes);
|
||||
pState->moduleStatus = htonl(pState->moduleStatus);
|
||||
pState->createdTime = htonl(pState->createdTime);
|
||||
pState->dnodeId = htonl(pState->dnodeId);
|
||||
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);
|
||||
pMnodeInfo->nodeIp = htonl(pMnodeInfo->nodeIp);
|
||||
pMnodeInfo->nodePort = htons(pMnodeInfo->nodePort);
|
||||
pMnodeInfo->syncPort = htons(pMnodeInfo->syncPort);
|
||||
}
|
||||
|
||||
SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess;
|
||||
for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) {
|
||||
pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId);
|
||||
}
|
||||
|
||||
dnodeProcessModuleStatus(pState->moduleStatus);
|
||||
dnodeUpdateDnodeInfo(pState->dnodeId);
|
||||
|
||||
SRpcIpSet mgmtIpSet = {0};
|
||||
mgmtIpSet.inUse = mnodes->inUse;
|
||||
mgmtIpSet.numOfIps = mnodes->nodeNum;
|
||||
mgmtIpSet.port = htons(mnodes->nodeInfos[0].nodePort);
|
||||
for (int32_t i = 0; i < mnodes->nodeNum; i++) {
|
||||
mgmtIpSet.ip[i] = htonl(mnodes->nodeInfos[i].nodeIp);
|
||||
}
|
||||
|
||||
if (memcmp(&mgmtIpSet, &tsMnodeIpList, sizeof(SRpcIpSet)) != 0 || tsMnodeInfos.nodeNum == 0) {
|
||||
memcpy(&tsMnodeIpList, &mgmtIpSet, sizeof(SRpcIpSet));
|
||||
tsMnodeInfos.inUse = mnodes->inUse;
|
||||
tsMnodeInfos.nodeNum = mnodes->nodeNum;
|
||||
dPrint("mnode ip list is changed, numOfIps:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse);
|
||||
for (int32_t i = 0; i < mnodes->nodeNum; i++) {
|
||||
tsMnodeInfos.nodeInfos[i].nodeId = htonl(mnodes->nodeInfos[i].nodeId);
|
||||
tsMnodeInfos.nodeInfos[i].nodeIp = htonl(mnodes->nodeInfos[i].nodeIp);
|
||||
tsMnodeInfos.nodeInfos[i].nodePort = htons(mnodes->nodeInfos[i].nodePort);
|
||||
strcpy(tsMnodeInfos.nodeInfos[i].nodeName, mnodes->nodeInfos[i].nodeName);
|
||||
dPrint("mnode:%d, ip:%s:%u name:%s", tsMnodeInfos.nodeInfos[i].nodeId,
|
||||
taosIpStr(tsMnodeInfos.nodeInfos[i].nodeIp), tsMnodeInfos.nodeInfos[i].nodePort,
|
||||
tsMnodeInfos.nodeInfos[i].nodeName);
|
||||
}
|
||||
dnodeSaveMnodeIpList();
|
||||
sdbUpdateSync();
|
||||
}
|
||||
|
||||
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;
|
||||
tsMnodeIpSet.port = tsMnodeInfos.nodeInfos[0].nodePort;
|
||||
for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) {
|
||||
tsMnodeIpSet.ip[i] = tsMnodeInfos.nodeInfos[i].nodeIp;
|
||||
}
|
||||
|
||||
dPrint("mnodes is changed, nodeNum:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse);
|
||||
for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) {
|
||||
dPrint("mnode:%d, ip:%s:%u name:%s", tsMnodeInfos.nodeInfos[i].nodeId, taosIpStr(tsMnodeInfos.nodeInfos[i].nodeIp),
|
||||
tsMnodeInfos.nodeInfos[i].nodePort, tsMnodeInfos.nodeInfos[i].nodeName);
|
||||
}
|
||||
|
||||
dnodeSaveMnodeInfos();
|
||||
sdbUpdateSync();
|
||||
}
|
||||
|
||||
void dnodeSendMsgToMnode(SRpcMsg *rpcMsg) {
|
||||
if (tsDnodeMClientRpc) {
|
||||
rpcSendRequest(tsDnodeMClientRpc, &tsMnodeIpList, rpcMsg);
|
||||
rpcSendRequest(tsDnodeMClientRpc, &tsMnodeIpSet, rpcMsg);
|
||||
}
|
||||
}
|
||||
|
||||
static bool dnodeReadMnodeIpList() {
|
||||
static bool dnodeReadMnodeInfos() {
|
||||
char ipFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir);
|
||||
FILE *fp = fopen(ipFile, "r");
|
||||
|
@ -272,8 +290,15 @@ static bool dnodeReadMnodeIpList() {
|
|||
}
|
||||
tsMnodeInfos.nodeInfos[i].nodePort = (uint16_t)nodePort->valueint;
|
||||
|
||||
cJSON *syncPort = cJSON_GetObjectItem(nodeInfo, "syncPort");
|
||||
if (!syncPort || syncPort->type != cJSON_Number) {
|
||||
dError("failed to read mnode mgmtIpList.json, syncPort not found");
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
tsMnodeInfos.nodeInfos[i].syncPort = (uint16_t)syncPort->valueint;
|
||||
|
||||
cJSON *nodeName = cJSON_GetObjectItem(nodeInfo, "nodeName");
|
||||
if (!nodeIp || nodeName->type != cJSON_String || nodeName->valuestring == NULL) {
|
||||
if (!nodeName || nodeName->type != cJSON_String || nodeName->valuestring == NULL) {
|
||||
dError("failed to read mnode mgmtIpList.json, nodeName not found");
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
@ -285,7 +310,7 @@ static bool dnodeReadMnodeIpList() {
|
|||
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, ip:%s:%u name:%s", tsMnodeInfos.nodeInfos[i].nodeId,
|
||||
taosIpStr(tsMnodeInfos.nodeInfos[i].nodeId), tsMnodeInfos.nodeInfos[i].nodePort,
|
||||
taosIpStr(tsMnodeInfos.nodeInfos[i].nodeIp), tsMnodeInfos.nodeInfos[i].nodePort,
|
||||
tsMnodeInfos.nodeInfos[i].nodeName);
|
||||
}
|
||||
|
||||
|
@ -296,7 +321,7 @@ PARSE_OVER:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void dnodeSaveMnodeIpList() {
|
||||
static void dnodeSaveMnodeInfos() {
|
||||
char ipFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir);
|
||||
FILE *fp = fopen(ipFile, "w");
|
||||
|
@ -314,6 +339,7 @@ static void dnodeSaveMnodeIpList() {
|
|||
len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", tsMnodeInfos.nodeInfos[i].nodeId);
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeIp\": \"%s\",\n", taosIpStr(tsMnodeInfos.nodeInfos[i].nodeIp));
|
||||
len += snprintf(content + len, maxLen - len, " \"nodePort\": %u,\n", tsMnodeInfos.nodeInfos[i].nodePort);
|
||||
len += snprintf(content + len, maxLen - len, " \"syncPort\": %u,\n", tsMnodeInfos.nodeInfos[i].syncPort);
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeName\": \"%s\"\n", tsMnodeInfos.nodeInfos[i].nodeName);
|
||||
if (i < tsMnodeInfos.nodeNum -1) {
|
||||
len += snprintf(content + len, maxLen - len, " },{\n");
|
||||
|
@ -331,10 +357,10 @@ static void dnodeSaveMnodeIpList() {
|
|||
}
|
||||
|
||||
uint32_t dnodeGetMnodeMasteIp() {
|
||||
return tsMnodeIpList.ip[tsMnodeIpList.inUse];
|
||||
return tsMnodeIpSet.ip[tsMnodeIpSet.inUse];
|
||||
}
|
||||
|
||||
void* dnodeGetMnodeList() {
|
||||
void* dnodeGetMnodeInfos() {
|
||||
return &tsMnodeInfos;
|
||||
}
|
||||
|
||||
|
@ -358,9 +384,9 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
|
|||
return;
|
||||
}
|
||||
|
||||
strcpy(pStatus->dnodeName, tsDnodeName);
|
||||
//strcpy(pStatus->dnodeName, tsDnodeName);
|
||||
pStatus->version = htonl(tsVersion);
|
||||
pStatus->dnodeId = htonl(tsDnodeId);
|
||||
pStatus->dnodeId = htonl(tsDnodeCfg.dnodeId);
|
||||
pStatus->privateIp = htonl(inet_addr(tsPrivateIp));
|
||||
pStatus->publicIp = htonl(inet_addr(tsPublicIp));
|
||||
pStatus->lastReboot = htonl(tsRebootTime);
|
||||
|
@ -368,7 +394,7 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
|
|||
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);
|
||||
|
@ -382,47 +408,81 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
|
|||
dnodeSendMsgToMnode(&rpcMsg);
|
||||
}
|
||||
|
||||
static void dnodeReadDnodeInfo() {
|
||||
char dnodeIdFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(dnodeIdFile, "%s/dnodeId", tsDnodeDir);
|
||||
static bool dnodeReadDnodeCfg() {
|
||||
char dnodeCfgFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir);
|
||||
|
||||
FILE *fp = fopen(dnodeIdFile, "r");
|
||||
if (!fp) return;
|
||||
|
||||
char option[32] = {0};
|
||||
int32_t value = 0;
|
||||
int32_t num = 0;
|
||||
|
||||
num = fscanf(fp, "%s %d", option, &value);
|
||||
if (num != 2) return;
|
||||
if (strcmp(option, "dnodeId") != 0) return;
|
||||
tsDnodeId = value;;
|
||||
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);
|
||||
dPrint("read dnodeId:%d successed", tsDnodeId);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void dnodeSaveDnodeInfo() {
|
||||
char dnodeIdFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(dnodeIdFile, "%s/dnodeId", tsDnodeDir);
|
||||
static void dnodeSaveDnodeCfg() {
|
||||
char dnodeCfgFile[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir);
|
||||
|
||||
FILE *fp = fopen(dnodeIdFile, "w");
|
||||
FILE *fp = fopen(dnodeCfgFile, "w");
|
||||
if (!fp) return;
|
||||
|
||||
fprintf(fp, "dnodeId %d\n", tsDnodeId);
|
||||
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 dnodeUpdateDnodeInfo(int32_t dnodeId) {
|
||||
if (tsDnodeId == 0) {
|
||||
dPrint("dnodeId is set to %d", dnodeId);
|
||||
tsDnodeId = dnodeId;
|
||||
dnodeSaveDnodeInfo();
|
||||
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 tsDnodeId;
|
||||
return tsDnodeCfg.dnodeId;
|
||||
}
|
|
@ -33,7 +33,6 @@ static int32_t dnodeOpenVnodes();
|
|||
static void dnodeCloseVnodes();
|
||||
static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *pMsg);
|
||||
static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *pMsg);
|
||||
static int32_t dnodeProcessAlterVnodeMsg(SRpcMsg *pMsg);
|
||||
static int32_t dnodeProcessAlterStreamMsg(SRpcMsg *pMsg);
|
||||
static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg);
|
||||
static int32_t (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *pMsg);
|
||||
|
@ -41,7 +40,6 @@ static int32_t (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *pMsg);
|
|||
int32_t dnodeInitMgmt() {
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeProcessCreateVnodeMsg;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeProcessDropVnodeMsg;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_VNODE] = dnodeProcessAlterVnodeMsg;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeProcessConfigDnodeMsg;
|
||||
|
||||
|
@ -129,25 +127,31 @@ static void dnodeCloseVnodes() {
|
|||
|
||||
static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
|
||||
SMDCreateVnodeMsg *pCreate = rpcMsg->pCont;
|
||||
pCreate->cfg.vgId = htonl(pCreate->cfg.vgId);
|
||||
pCreate->cfg.maxSessions = htonl(pCreate->cfg.maxSessions);
|
||||
pCreate->cfg.cacheBlockSize = htonl(pCreate->cfg.cacheBlockSize);
|
||||
pCreate->cfg.daysPerFile = htonl(pCreate->cfg.daysPerFile);
|
||||
pCreate->cfg.daysToKeep1 = htonl(pCreate->cfg.daysToKeep1);
|
||||
pCreate->cfg.daysToKeep2 = htonl(pCreate->cfg.daysToKeep2);
|
||||
pCreate->cfg.daysToKeep = htonl(pCreate->cfg.daysToKeep);
|
||||
pCreate->cfg.commitTime = htonl(pCreate->cfg.commitTime);
|
||||
pCreate->cfg.rowsInFileBlock = htonl(pCreate->cfg.rowsInFileBlock);
|
||||
pCreate->cfg.blocksPerTable = htons(pCreate->cfg.blocksPerTable);
|
||||
pCreate->cfg.cacheNumOfBlocks.totalBlocks = htonl(pCreate->cfg.cacheNumOfBlocks.totalBlocks);
|
||||
|
||||
pCreate->cfg.vgId = htonl(pCreate->cfg.vgId);
|
||||
pCreate->cfg.maxTables = htonl(pCreate->cfg.maxTables);
|
||||
pCreate->cfg.maxCacheSize = htobe64(pCreate->cfg.maxCacheSize);
|
||||
pCreate->cfg.minRowsPerFileBlock = htonl(pCreate->cfg.minRowsPerFileBlock);
|
||||
pCreate->cfg.maxRowsPerFileBlock = htonl(pCreate->cfg.maxRowsPerFileBlock);
|
||||
pCreate->cfg.daysPerFile = htonl(pCreate->cfg.daysPerFile);
|
||||
pCreate->cfg.daysToKeep1 = htonl(pCreate->cfg.daysToKeep1);
|
||||
pCreate->cfg.daysToKeep2 = htonl(pCreate->cfg.daysToKeep2);
|
||||
pCreate->cfg.daysToKeep = htonl(pCreate->cfg.daysToKeep);
|
||||
pCreate->cfg.commitTime = htonl(pCreate->cfg.commitTime);
|
||||
pCreate->cfg.arbitratorIp = htonl(pCreate->cfg.arbitratorIp);
|
||||
|
||||
for (int32_t j = 0; j < pCreate->cfg.replications; ++j) {
|
||||
pCreate->vpeerDesc[j].vgId = htonl(pCreate->vpeerDesc[j].vgId);
|
||||
pCreate->vpeerDesc[j].dnodeId = htonl(pCreate->vpeerDesc[j].dnodeId);
|
||||
pCreate->vpeerDesc[j].ip = htonl(pCreate->vpeerDesc[j].ip);
|
||||
pCreate->nodes[j].nodeId = htonl(pCreate->nodes[j].nodeId);
|
||||
pCreate->nodes[j].nodeIp = htonl(pCreate->nodes[j].nodeIp);
|
||||
}
|
||||
|
||||
return vnodeCreate(pCreate);
|
||||
void *pVnode = vnodeAccquireVnode(pCreate->cfg.vgId);
|
||||
if (pVnode != NULL) {
|
||||
int32_t code = vnodeAlter(pVnode, pCreate);
|
||||
vnodeRelease(pVnode);
|
||||
return code;
|
||||
} else {
|
||||
return vnodeCreate(pCreate);
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *rpcMsg) {
|
||||
|
@ -157,15 +161,6 @@ static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *rpcMsg) {
|
|||
return vnodeDrop(pDrop->vgId);
|
||||
}
|
||||
|
||||
static int32_t dnodeProcessAlterVnodeMsg(SRpcMsg *rpcMsg) {
|
||||
SMDCreateVnodeMsg *pCreate = rpcMsg->pCont;
|
||||
pCreate->cfg.vgId = htonl(pCreate->cfg.vgId);
|
||||
pCreate->cfg.maxSessions = htonl(pCreate->cfg.maxSessions);
|
||||
pCreate->cfg.daysPerFile = htonl(pCreate->cfg.daysPerFile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t dnodeProcessAlterStreamMsg(SRpcMsg *pMsg) {
|
||||
// SMDAlterStreamMsg *pStream = pCont;
|
||||
// pStream->uid = htobe64(pStream->uid);
|
||||
|
|
|
@ -33,7 +33,6 @@ int32_t dnodeInitMnode() {
|
|||
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_VNODE] = dnodeMgmt;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeMgmt;
|
||||
dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeMgmt;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ void dnodeSendRpcWriteRsp(void *pVnode, void *param, int32_t code);
|
|||
|
||||
bool dnodeIsFirstDeploy();
|
||||
uint32_t dnodeGetMnodeMasteIp();
|
||||
void * dnodeGetMnodeList();
|
||||
void * dnodeGetMnodeInfos();
|
||||
int32_t dnodeGetDnodeId();
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -75,14 +75,19 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NOT_CONFIGURED, 0, 27, "not configured")
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_NODE_OFFLINE, 0, 28, "node offline")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_NETWORK_UNAVAIL, 0, 29, "network unavailable")
|
||||
|
||||
// db & user
|
||||
// db
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_DB_NOT_SELECTED, 0, 100, "db not selected")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_DB_ALREADY_EXIST, 0, 101, "database aleady exist")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_DB, 0, 102, "invalid database")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_MONITOR_DB_FORBIDDEN, 0, 103, "monitor db forbidden")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_USER_ALREADY_EXIST, 0, 104, "user already exist")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_USER, 0, 105, "invalid user")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PASS, 0, 106, "invalid password")
|
||||
|
||||
// user
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_USER_ALREADY_EXIST, 0, 150, "user already exist")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_USER, 0, 151, "invalid user")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PASS, 0, 152, "invalid password")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_USER_FORMAT, 0, 153, "invalid user format")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PASS_FORMAT, 0, 154, "invalid password format")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_NO_USER_FROM_CONN, 0, 155, "can not get user from conn")
|
||||
|
||||
// table
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_TABLE_ALREADY_EXIST, 0, 200, "table already exist")
|
||||
|
|
|
@ -48,14 +48,12 @@ extern "C" {
|
|||
#define TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP 16
|
||||
#define TSDB_MSG_TYPE_MD_DROP_VNODE 17
|
||||
#define TSDB_MSG_TYPE_MD_DROP_VNODE_RSP 18
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_VNODE 19
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP 20
|
||||
#define TSDB_MSG_TYPE_MD_DROP_STABLE 21
|
||||
#define TSDB_MSG_TYPE_MD_DROP_STABLE_RSP 22
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_STREAM 23
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_STREAM_RSP 24
|
||||
#define TSDB_MSG_TYPE_MD_CONFIG_DNODE 25
|
||||
#define TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP 26
|
||||
#define TSDB_MSG_TYPE_MD_DROP_STABLE 19
|
||||
#define TSDB_MSG_TYPE_MD_DROP_STABLE_RSP 20
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_STREAM 21
|
||||
#define TSDB_MSG_TYPE_MD_ALTER_STREAM_RSP 22
|
||||
#define TSDB_MSG_TYPE_MD_CONFIG_DNODE 23
|
||||
#define TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP 24
|
||||
|
||||
// message from client to mnode
|
||||
#define TSDB_MSG_TYPE_CM_CONNECT 31
|
||||
|
@ -245,12 +243,6 @@ typedef struct SSchema {
|
|||
int16_t bytes;
|
||||
} SSchema;
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId;
|
||||
int32_t dnodeId;
|
||||
uint32_t ip;
|
||||
} SVnodeDesc;
|
||||
|
||||
typedef struct {
|
||||
int32_t contLen;
|
||||
int32_t vgId;
|
||||
|
@ -518,18 +510,10 @@ typedef struct {
|
|||
uint8_t status;
|
||||
uint8_t role;
|
||||
uint8_t accessState;
|
||||
uint8_t replica;
|
||||
uint8_t reserved[5];
|
||||
} SVnodeLoad;
|
||||
|
||||
typedef struct {
|
||||
uint32_t vnode;
|
||||
uint8_t accessState;
|
||||
uint8_t reserved[3];
|
||||
} SVnodeAccess;
|
||||
|
||||
/*
|
||||
* NOTE: sizeof(SVnodeCfg) < TSDB_FILE_HEADER_LEN / 4
|
||||
*/
|
||||
typedef struct {
|
||||
char acct[TSDB_USER_LEN + 1];
|
||||
char db[TSDB_DB_NAME_LEN + 1];
|
||||
|
@ -554,7 +538,7 @@ typedef struct {
|
|||
int8_t loadLatest; // load into mem or not
|
||||
uint8_t precision; // time resolution
|
||||
int8_t reserved[16];
|
||||
} SVnodeCfg, SDbCfg, SCMCreateDbMsg, SCMAlterDbMsg;
|
||||
} SDbCfg, SCMCreateDbMsg, SCMAlterDbMsg;
|
||||
|
||||
typedef struct {
|
||||
char db[TSDB_TABLE_ID_LEN + 1];
|
||||
|
@ -571,12 +555,30 @@ typedef struct {
|
|||
char reserved[64];
|
||||
} SVnodeStatisticInfo;
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId;
|
||||
int8_t accessState;
|
||||
} SDMVgroupAccess;
|
||||
|
||||
typedef struct {
|
||||
int32_t dnodeId;
|
||||
uint32_t moduleStatus;
|
||||
uint32_t createdTime;
|
||||
uint32_t numOfVnodes;
|
||||
} SDnodeState;
|
||||
} SDMDnodeCfg;
|
||||
|
||||
typedef struct {
|
||||
int32_t nodeId;
|
||||
uint32_t nodeIp;
|
||||
uint16_t nodePort;
|
||||
uint16_t syncPort;
|
||||
char nodeName[TSDB_NODE_NAME_LEN + 1];
|
||||
} SDMMnodeInfo;
|
||||
|
||||
typedef struct {
|
||||
int8_t inUse;
|
||||
int8_t nodeNum;
|
||||
SDMMnodeInfo nodeInfos[TSDB_MAX_MPEERS];
|
||||
} SDMMnodeInfos;
|
||||
|
||||
typedef struct {
|
||||
uint32_t version;
|
||||
|
@ -596,27 +598,41 @@ typedef struct {
|
|||
} SDMStatusMsg;
|
||||
|
||||
typedef struct {
|
||||
int32_t nodeId;
|
||||
uint32_t nodeIp;
|
||||
uint16_t nodePort;
|
||||
char nodeName[TSDB_NODE_NAME_LEN + 1];
|
||||
} SDMNodeInfo;
|
||||
|
||||
typedef struct {
|
||||
int8_t inUse;
|
||||
int8_t nodeNum;
|
||||
SDMNodeInfo nodeInfos[TSDB_MAX_MPEERS];
|
||||
} SDMNodeInfos;
|
||||
|
||||
typedef struct {
|
||||
SDMNodeInfos mnodes;
|
||||
SDnodeState dnodeState;
|
||||
SVnodeAccess vnodeAccess[];
|
||||
SDMMnodeInfos mnodes;
|
||||
SDMDnodeCfg dnodeCfg;
|
||||
SDMVgroupAccess vgAccess[];
|
||||
} SDMStatusRsp;
|
||||
|
||||
typedef struct {
|
||||
SVnodeCfg cfg;
|
||||
SVnodeDesc vpeerDesc[TSDB_MAX_MPEERS];
|
||||
uint32_t vgId;
|
||||
int32_t maxTables;
|
||||
int64_t maxCacheSize;
|
||||
int32_t minRowsPerFileBlock;
|
||||
int32_t maxRowsPerFileBlock;
|
||||
int32_t daysPerFile;
|
||||
int32_t daysToKeep;
|
||||
int32_t daysToKeep1;
|
||||
int32_t daysToKeep2;
|
||||
int32_t commitTime;
|
||||
uint8_t precision; // time resolution
|
||||
int8_t compression;
|
||||
int8_t wals;
|
||||
int8_t commitLog;
|
||||
int8_t replications;
|
||||
int8_t quorum;
|
||||
uint32_t arbitratorIp;
|
||||
int8_t reserved[16];
|
||||
} SMDVnodeCfg;
|
||||
|
||||
typedef struct {
|
||||
int32_t nodeId;
|
||||
uint32_t nodeIp;
|
||||
char nodeName[TSDB_NODE_NAME_LEN + 1];
|
||||
} SMDVnodeDesc;
|
||||
|
||||
typedef struct {
|
||||
SMDVnodeCfg cfg;
|
||||
SMDVnodeDesc nodes[TSDB_MAX_MPEERS];
|
||||
} SMDCreateVnodeMsg;
|
||||
|
||||
typedef struct {
|
||||
|
@ -674,9 +690,16 @@ typedef struct {
|
|||
int32_t metaElem[TSDB_MAX_JOIN_TABLE_NUM];
|
||||
} SSuperTableMetaMsg;
|
||||
|
||||
typedef struct {
|
||||
int32_t nodeId;
|
||||
uint32_t nodeIp;
|
||||
uint16_t nodePort;
|
||||
} SVnodeDesc;
|
||||
|
||||
typedef struct {
|
||||
SVnodeDesc vpeerDesc[TSDB_REPLICA_MAX_NUM];
|
||||
int16_t index; // used locally
|
||||
int32_t vgId;
|
||||
int32_t numOfSids;
|
||||
int32_t pSidExtInfoList[]; // offset value of STableIdInfo
|
||||
} SVnodeSidList;
|
||||
|
|
|
@ -104,10 +104,10 @@ extern char *syncRole[];
|
|||
extern int tsMaxSyncNum;
|
||||
extern int tsSyncTcpThreads;
|
||||
extern int tsMaxWatchFiles;
|
||||
extern short tsSyncPort;
|
||||
extern int tsSyncTimer;
|
||||
extern int tsMaxFwdInfo;
|
||||
extern int sDebugFlag;
|
||||
extern uint16_t tsSyncPort;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ typedef struct {
|
|||
int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg);
|
||||
int32_t vnodeDrop(int32_t vgId);
|
||||
int32_t vnodeOpen(int32_t vgId, char *rootDir);
|
||||
int32_t vnodeAlter(void *pVnode, SMDCreateVnodeMsg *pVnodeCfg);
|
||||
int32_t vnodeClose(int32_t vgId);
|
||||
|
||||
void vnodeRelease(void *pVnode);
|
||||
|
|
|
@ -24,10 +24,10 @@ extern "C" {
|
|||
|
||||
int32_t mgmtInitAccts();
|
||||
void mgmtCleanUpAccts();
|
||||
void *mgmtGetAcct(char *acctName);
|
||||
void * mgmtGetAcct(char *acctName);
|
||||
void * mgmtGetNextAcct(void *pNode, SAcctObj **pAcct);
|
||||
void mgmtIncAcctRef(SAcctObj *pAcct);
|
||||
void mgmtDecAcctRef(SAcctObj *pAcct);
|
||||
|
||||
void mgmtAddDbToAcct(SAcctObj *pAcct, SDbObj *pDb);
|
||||
void mgmtDropDbFromAcct(SAcctObj *pAcct, SDbObj *pDb);
|
||||
void mgmtAddUserToAcct(SAcctObj *pAcct, SUserObj *pUser);
|
||||
|
|
|
@ -51,7 +51,6 @@ typedef struct SDnodeObj {
|
|||
int8_t reserved[15];
|
||||
int8_t updateEnd[1];
|
||||
int32_t refCount;
|
||||
SVnodeLoad vload[TSDB_MAX_VNODES];
|
||||
uint32_t moduleStatus;
|
||||
uint32_t lastReboot; // time stamp for last reboot
|
||||
float score; // calc in balance function
|
||||
|
@ -72,13 +71,6 @@ typedef struct SMnodeObj {
|
|||
SDnodeObj *pDnode;
|
||||
} SMnodeObj;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t dnodeId;
|
||||
uint32_t privateIp;
|
||||
uint32_t publicIp;
|
||||
} SVnodeGid;
|
||||
|
||||
typedef struct {
|
||||
char tableId[TSDB_TABLE_ID_LEN + 1];
|
||||
int8_t type;
|
||||
|
@ -120,24 +112,34 @@ typedef struct {
|
|||
SSuperTableObj *superTable;
|
||||
} SChildTableObj;
|
||||
|
||||
typedef struct {
|
||||
int32_t dnodeId;
|
||||
int8_t role;
|
||||
int8_t reserved[3];
|
||||
SDnodeObj* pDnode;
|
||||
} SVnodeGid;
|
||||
|
||||
typedef struct SVgObj {
|
||||
uint32_t vgId;
|
||||
char dbName[TSDB_DB_NAME_LEN + 1];
|
||||
int64_t createdTime;
|
||||
SVnodeGid vnodeGid[TSDB_VNODES_SUPPORT];
|
||||
int32_t numOfVnodes;
|
||||
int32_t lbDnodeId;
|
||||
int32_t lbTime;
|
||||
int8_t status;
|
||||
int8_t inUse;
|
||||
int8_t reserved[13];
|
||||
int8_t updateEnd[1];
|
||||
int32_t refCount;
|
||||
uint32_t vgId;
|
||||
char dbName[TSDB_DB_NAME_LEN + 1];
|
||||
int64_t createdTime;
|
||||
SVnodeGid vnodeGid[TSDB_VNODES_SUPPORT];
|
||||
int32_t numOfVnodes;
|
||||
int32_t lbDnodeId;
|
||||
int32_t lbTime;
|
||||
int8_t status;
|
||||
int8_t inUse;
|
||||
int8_t reserved[13];
|
||||
int8_t updateEnd[1];
|
||||
int32_t refCount;
|
||||
struct SVgObj *prev, *next;
|
||||
struct SDbObj *pDb;
|
||||
int32_t numOfTables;
|
||||
void * idPool;
|
||||
SChildTableObj ** tableList;
|
||||
int32_t numOfTables;
|
||||
int64_t totalStorage;
|
||||
int64_t compStorage;
|
||||
int64_t pointsWritten;
|
||||
void * idPool;
|
||||
SChildTableObj **tableList;
|
||||
} SVgObj;
|
||||
|
||||
typedef struct SDbObj {
|
||||
|
|
|
@ -35,12 +35,15 @@ void mgmtMonitorDnodeModule();
|
|||
|
||||
int32_t mgmtGetDnodesNum();
|
||||
void * mgmtGetNextDnode(void *pNode, SDnodeObj **pDnode);
|
||||
void mgmtReleaseDnode(SDnodeObj *pDnode);
|
||||
void mgmtIncDnodeRef(SDnodeObj *pDnode);
|
||||
void mgmtDecDnodeRef(SDnodeObj *pDnode);
|
||||
void * mgmtGetDnode(int32_t dnodeId);
|
||||
void * mgmtGetDnodeByIp(uint32_t ip);
|
||||
void mgmtUpdateDnode(SDnodeObj *pDnode);
|
||||
int32_t mgmtDropDnode(SDnodeObj *pDnode);
|
||||
|
||||
extern int32_t tsAccessSquence;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -40,8 +40,8 @@ void * mgmtGetNextMnode(void *pNode, struct SMnodeObj **pMnode);
|
|||
void mgmtReleaseMnode(struct SMnodeObj *pMnode);
|
||||
|
||||
char * mgmtGetMnodeRoleStr();
|
||||
void mgmtGetMnodeIpList(SRpcIpSet *ipSet, bool usePublicIp);
|
||||
void mgmtGetMnodeList(void *mnodes);
|
||||
void mgmtGetMnodeIpSet(SRpcIpSet *ipSet, bool usePublicIp);
|
||||
void mgmtGetMnodeInfos(void *mnodes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -24,7 +24,9 @@ extern "C" {
|
|||
int32_t mgmtInitUsers();
|
||||
void mgmtCleanUpUsers();
|
||||
SUserObj *mgmtGetUser(char *name);
|
||||
void mgmtReleaseUser(SUserObj *pUser);
|
||||
void * mgmtGetNextUser(void *pNode, SUserObj **pUser);
|
||||
void mgmtIncUserRef(SUserObj *pUser);
|
||||
void mgmtDecUserRef(SUserObj *pUser);
|
||||
SUserObj *mgmtGetUserFromConn(void *pConn, bool *usePublicIp);
|
||||
int32_t mgmtCreateUser(SAcctObj *pAcct, char *name, char *pass);
|
||||
void mgmtDropAllUsers(SAcctObj *pAcct);
|
||||
|
|
|
@ -30,12 +30,13 @@ enum _TSDB_VG_STATUS {
|
|||
int32_t mgmtInitVgroups();
|
||||
void mgmtCleanUpVgroups();
|
||||
SVgObj *mgmtGetVgroup(int32_t vgId);
|
||||
void mgmtReleaseVgroup(SVgObj *pVgroup);
|
||||
void mgmtIncVgroupRef(SVgObj *pVgroup);
|
||||
void mgmtDecVgroupRef(SVgObj *pVgroup);
|
||||
void mgmtDropAllVgroups(SDbObj *pDropDb);
|
||||
|
||||
void * mgmtGetNextVgroup(void *pNode, SVgObj **pVgroup);
|
||||
void mgmtUpdateVgroup(SVgObj *pVgroup);
|
||||
void mgmtUpdateVgroupStatus(SVgObj *pVgroup, int32_t dnodeId, SVnodeLoad *pVload);
|
||||
void mgmtUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *dnodeId, SVnodeLoad *pVload);
|
||||
|
||||
void mgmtCreateVgroup(SQueuedMsg *pMsg, SDbObj *pDb);
|
||||
void mgmtDropVgroup(SVgObj *pVgroup, void *ahandle);
|
||||
|
@ -46,6 +47,7 @@ void mgmtAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable);
|
|||
void mgmtRemoveTableFromVgroup(SVgObj *pVgroup, SChildTableObj *pTable);
|
||||
void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle);
|
||||
void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle);
|
||||
void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle);
|
||||
|
||||
SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup);
|
||||
SRpcIpSet mgmtGetIpSetFromIp(uint32_t ip);
|
||||
|
|
|
@ -58,6 +58,7 @@ static int32_t mgmtActionAcctUpdate(SSdbOper *pOper) {
|
|||
memcpy(pSaved, pAcct, tsAcctUpdateSize);
|
||||
free(pAcct);
|
||||
}
|
||||
mgmtDecAcctRef(pSaved);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -106,11 +107,11 @@ int32_t mgmtInitAccts() {
|
|||
|
||||
tsAcctSdb = sdbOpenTable(&tableDesc);
|
||||
if (tsAcctSdb == NULL) {
|
||||
mError("failed to init acct data");
|
||||
mError("table:%s, failed to create hash", tableDesc.tableName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
mTrace("table:accounts table is created");
|
||||
mTrace("table:%s, hash is created", tableDesc.tableName);
|
||||
return acctInit();
|
||||
}
|
||||
|
||||
|
@ -123,6 +124,10 @@ void *mgmtGetAcct(char *name) {
|
|||
return sdbGetRow(tsAcctSdb, name);
|
||||
}
|
||||
|
||||
void *mgmtGetNextAcct(void *pNode, SAcctObj **pAcct) {
|
||||
return sdbFetchRow(tsAcctSdb, pNode, (void **)pAcct);
|
||||
}
|
||||
|
||||
void mgmtIncAcctRef(SAcctObj *pAcct) {
|
||||
sdbIncRef(tsAcctSdb, pAcct);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
|
|||
vnodeUsage = usage;
|
||||
}
|
||||
}
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
if (pSelDnode == NULL) {
|
||||
|
@ -56,8 +56,7 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
|
|||
}
|
||||
|
||||
pVgroup->vnodeGid[0].dnodeId = pSelDnode->dnodeId;
|
||||
pVgroup->vnodeGid[0].privateIp = pSelDnode->privateIp;
|
||||
pVgroup->vnodeGid[0].publicIp = pSelDnode->publicIp;
|
||||
pVgroup->vnodeGid[0].pDnode = pSelDnode;
|
||||
|
||||
mTrace("dnode:%d, alloc one vnode to vgroup, openVnodes:%d", pSelDnode->dnodeId, pSelDnode->openVnodes);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
#include "mgmtLog.h"
|
||||
#include "mgmtDb.h"
|
||||
#include "mgmtDServer.h"
|
||||
#include "mgmtMnode.h"
|
||||
#include "mgmtProfile.h"
|
||||
#include "mgmtShell.h"
|
||||
#include "mgmtSdb.h"
|
||||
#include "mgmtTable.h"
|
||||
#include "mgmtVgroup.h"
|
||||
|
||||
|
@ -99,6 +101,18 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
|
|||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sdbIsMaster()) {
|
||||
SRpcConnInfo connInfo;
|
||||
rpcGetConnInfo(rpcMsg->handle, &connInfo);
|
||||
bool usePublicIp = false;
|
||||
|
||||
SRpcIpSet ipSet = {0};
|
||||
mgmtGetMnodeIpSet(&ipSet, usePublicIp);
|
||||
mTrace("conn from dnode ip:%s redirect msg", taosIpStr(connInfo.clientIp));
|
||||
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) {
|
||||
SRpcMsg *pMsg = malloc(sizeof(SRpcMsg));
|
||||
|
|
|
@ -63,6 +63,7 @@ static int32_t mgmtDbActionInsert(SSdbOper *pOper) {
|
|||
|
||||
if (pAcct != NULL) {
|
||||
mgmtAddDbToAcct(pAcct, pDb);
|
||||
mgmtDecAcctRef(pAcct);
|
||||
}
|
||||
else {
|
||||
mError("db:%s, acct:%s info not exist in sdb", pDb->name, pDb->cfg.acct);
|
||||
|
@ -80,6 +81,7 @@ static int32_t mgmtDbActionDelete(SSdbOper *pOper) {
|
|||
mgmtDropAllChildTables(pDb);
|
||||
mgmtDropAllSuperTables(pDb);
|
||||
mgmtDropAllVgroups(pDb);
|
||||
mgmtDecAcctRef(pAcct);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -527,7 +529,7 @@ static int32_t mgmtGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn)
|
|||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
pShow->numOfRows = pUser->pAcct->acctInfo.numOfDbs;
|
||||
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -647,7 +649,7 @@ static int32_t mgmtRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void *
|
|||
}
|
||||
|
||||
pShow->numOfReads += numOfRows;
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return numOfRows;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "ttime.h"
|
||||
#include "tutil.h"
|
||||
#include "tsocket.h"
|
||||
#include "tbalance.h"
|
||||
#include "tsync.h"
|
||||
#include "dnode.h"
|
||||
#include "mgmtDef.h"
|
||||
#include "mgmtLog.h"
|
||||
|
@ -36,6 +38,8 @@
|
|||
|
||||
void *tsDnodeSdb = NULL;
|
||||
int32_t tsDnodeUpdateSize = 0;
|
||||
int32_t tsAccessSquence = 0;
|
||||
extern void * tsMnodeSdb;
|
||||
extern void * tsVgroupSdb;
|
||||
|
||||
static int32_t mgmtCreateDnode(uint32_t ip);
|
||||
|
@ -68,7 +72,7 @@ static int32_t mgmtDnodeActionInsert(SSdbOper *pOper) {
|
|||
pDnode->mnodeDnodePort = tsMnodeDnodePort;
|
||||
pDnode->dnodeShellPort = tsDnodeShellPort;
|
||||
pDnode->dnodeMnodePort = tsDnodeMnodePort;
|
||||
pDnode->syncPort = 0;
|
||||
pDnode->syncPort = tsSyncPort;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -98,6 +102,15 @@ static int32_t mgmtDnodeActionDelete(SSdbOper *pOper) {
|
|||
}
|
||||
}
|
||||
|
||||
SMnodeObj *pMnode = mgmtGetMnode(pDnode->dnodeId);
|
||||
if (pMnode != NULL) {
|
||||
SSdbOper oper = {.type = SDB_OPER_LOCAL, .table = tsMnodeSdb, .pObj = pMnode};
|
||||
sdbDeleteRow(&oper);
|
||||
mgmtReleaseMnode(pMnode);
|
||||
}
|
||||
|
||||
balanceNotify();
|
||||
|
||||
mTrace("dnode:%d, all vgroups:%d is dropped from sdb", pDnode->dnodeId, numOfVgroups);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -135,7 +148,7 @@ static int32_t mgmtDnodeActionRestored() {
|
|||
mgmtCreateDnode(ip);
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByIp(ip);
|
||||
mgmtAddMnode(pDnode->dnodeId);
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -211,13 +224,17 @@ void *mgmtGetDnodeByIp(uint32_t ip) {
|
|||
if (ip == pDnode->privateIp) {
|
||||
return pDnode;
|
||||
}
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void mgmtReleaseDnode(SDnodeObj *pDnode) {
|
||||
void mgmtIncDnodeRef(SDnodeObj *pDnode) {
|
||||
sdbIncRef(tsDnodeSdb, pDnode);
|
||||
}
|
||||
|
||||
void mgmtDecDnodeRef(SDnodeObj *pDnode) {
|
||||
sdbDecRef(tsDnodeSdb, pDnode);
|
||||
}
|
||||
|
||||
|
@ -274,12 +291,12 @@ static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
|
|||
|
||||
void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
||||
SDMStatusMsg *pStatus = rpcMsg->pCont;
|
||||
pStatus->dnodeId = htonl(pStatus->dnodeId);
|
||||
pStatus->privateIp = htonl(pStatus->privateIp);
|
||||
pStatus->publicIp = htonl(pStatus->publicIp);
|
||||
pStatus->dnodeId = htonl(pStatus->dnodeId);
|
||||
pStatus->privateIp = htonl(pStatus->privateIp);
|
||||
pStatus->publicIp = htonl(pStatus->publicIp);
|
||||
pStatus->moduleStatus = htonl(pStatus->moduleStatus);
|
||||
pStatus->lastReboot = htonl(pStatus->lastReboot);
|
||||
pStatus->numOfCores = htons(pStatus->numOfCores);
|
||||
pStatus->lastReboot = htonl(pStatus->lastReboot);
|
||||
pStatus->numOfCores = htons(pStatus->numOfCores);
|
||||
pStatus->numOfTotalVnodes = htons(pStatus->numOfTotalVnodes);
|
||||
|
||||
uint32_t version = htonl(pStatus->version);
|
||||
|
@ -314,27 +331,27 @@ void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
|||
pDnode->alternativeRole = pStatus->alternativeRole;
|
||||
pDnode->totalVnodes = pStatus->numOfTotalVnodes;
|
||||
pDnode->moduleStatus = pStatus->moduleStatus;
|
||||
pDnode->lastAccess = tsAccessSquence;
|
||||
|
||||
if (pStatus->dnodeId == 0) {
|
||||
mTrace("dnode:%d, first access, privateIp:%s, name:%s", pDnode->dnodeId, taosIpStr(pDnode->privateIp), pDnode->dnodeName);
|
||||
} else {
|
||||
//mTrace("dnode:%d, status received, access times %d", pDnode->dnodeId, pDnode->lastAccess);
|
||||
}
|
||||
|
||||
int32_t openVnodes = htons(pStatus->openVnodes);
|
||||
for (int32_t j = 0; j < openVnodes; ++j) {
|
||||
SVnodeLoad *pVload = &pStatus->load[j];
|
||||
pDnode->vload[j].vgId = htonl(pVload->vgId);
|
||||
pDnode->vload[j].totalStorage = htobe64(pVload->totalStorage);
|
||||
pDnode->vload[j].compStorage = htobe64(pVload->compStorage);
|
||||
pDnode->vload[j].pointsWritten = htobe64(pVload->pointsWritten);
|
||||
|
||||
SVgObj *pVgroup = mgmtGetVgroup(pDnode->vload[j].vgId);
|
||||
pVload->vgId = htonl(pVload->vgId);
|
||||
|
||||
SVgObj *pVgroup = mgmtGetVgroup(pVload->vgId);
|
||||
if (pVgroup == NULL) {
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pDnode->privateIp);
|
||||
mPrint("dnode:%d, vgroup:%d not exist in mnode, drop it", pDnode->dnodeId, pDnode->vload[j].vgId);
|
||||
mgmtSendDropVnodeMsg(pDnode->vload[j].vgId, &ipSet, NULL);
|
||||
mPrint("dnode:%d, vgroup:%d not exist in mnode, drop it", pDnode->dnodeId, pVload->vgId);
|
||||
mgmtSendDropVnodeMsg(pVload->vgId, &ipSet, NULL);
|
||||
} else {
|
||||
mgmtUpdateVgroupStatus(pVgroup, pDnode->dnodeId, pVload);
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtUpdateVgroupStatus(pVgroup, pDnode, pVload);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,21 +361,20 @@ void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
|||
balanceNotify();
|
||||
}
|
||||
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
|
||||
int32_t contLen = sizeof(SDMStatusRsp) + TSDB_MAX_VNODES * sizeof(SVnodeAccess);
|
||||
int32_t contLen = sizeof(SDMStatusRsp) + TSDB_MAX_VNODES * sizeof(SDMVgroupAccess);
|
||||
SDMStatusRsp *pRsp = rpcMallocCont(contLen);
|
||||
if (pRsp == NULL) {
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_SERV_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
|
||||
mgmtGetMnodeList(&pRsp->mnodes);
|
||||
mgmtGetMnodeInfos(&pRsp->mnodes);
|
||||
|
||||
pRsp->dnodeState.dnodeId = htonl(pDnode->dnodeId);
|
||||
pRsp->dnodeState.moduleStatus = htonl((int32_t)pDnode->isMgmt);
|
||||
pRsp->dnodeState.createdTime = htonl(pDnode->createdTime / 1000);
|
||||
pRsp->dnodeState.numOfVnodes = 0;
|
||||
pRsp->dnodeCfg.dnodeId = htonl(pDnode->dnodeId);
|
||||
pRsp->dnodeCfg.moduleStatus = htonl((int32_t)pDnode->isMgmt);
|
||||
pRsp->dnodeCfg.numOfVnodes = 0;
|
||||
|
||||
contLen = sizeof(SDMStatusRsp);
|
||||
|
||||
|
@ -433,7 +449,7 @@ static int32_t mgmtDropDnodeByIp(uint32_t ip) {
|
|||
SDnodeObj *pDnode = mgmtGetDnodeByIp(ip);
|
||||
if (pDnode == NULL) {
|
||||
mError("dnode:%s, is not exist", taosIpStr(ip));
|
||||
return TSDB_CODE_INVALID_VALUE;
|
||||
return TSDB_CODE_DNODE_NOT_EXIST;
|
||||
}
|
||||
|
||||
if (pDnode->privateIp == dnodeGetMnodeMasteIp()) {
|
||||
|
@ -441,7 +457,7 @@ static int32_t mgmtDropDnodeByIp(uint32_t ip) {
|
|||
return TSDB_CODE_NO_REMOVE_MASTER;
|
||||
}
|
||||
|
||||
#ifndef _VPEER
|
||||
#ifndef _SYNC
|
||||
return mgmtDropDnode(pDnode);
|
||||
#else
|
||||
return balanceDropDnode(pDnode);
|
||||
|
@ -492,7 +508,10 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) return 0;
|
||||
|
||||
if (strcmp(pUser->pAcct->user, "root") != 0) return TSDB_CODE_NO_RIGHTS;
|
||||
if (strcmp(pUser->pAcct->user, "root") != 0) {
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
int32_t cols = 0;
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
@ -515,18 +534,6 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 8;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||
strcpy(pSchema[cols].name, "create time");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 10;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
|
||||
strcpy(pSchema[cols].name, "status");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 2;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_SMALLINT;
|
||||
strcpy(pSchema[cols].name, "open vnodes");
|
||||
|
@ -539,13 +546,17 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
#ifdef _VPEER
|
||||
pShow->bytes[cols] = 18;
|
||||
pShow->bytes[cols] = 10;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
|
||||
strcpy(pSchema[cols].name, "balance");
|
||||
strcpy(pSchema[cols].name, "status");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 8;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||
strcpy(pSchema[cols].name, "create time");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
#endif
|
||||
|
||||
pMeta->numOfColumns = htons(cols);
|
||||
pShow->numOfColumns = cols;
|
||||
|
@ -559,7 +570,7 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
pShow->pNode = NULL;
|
||||
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -591,14 +602,6 @@ static int32_t mgmtRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, voi
|
|||
strcpy(pWrite, ipstr);
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int64_t *)pWrite = pDnode->createdTime;
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, mgmtGetDnodeStatusStr(pDnode->status));
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int16_t *)pWrite = pDnode->openVnodes;
|
||||
cols++;
|
||||
|
@ -606,15 +609,18 @@ static int32_t mgmtRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, voi
|
|||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int16_t *)pWrite = pDnode->totalVnodes;
|
||||
cols++;
|
||||
|
||||
#ifdef _VPEER
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, mgmtGetDnodeStatusStr(pDnode->status));
|
||||
cols++;
|
||||
#endif
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int64_t *)pWrite = pDnode->createdTime;
|
||||
cols++;
|
||||
|
||||
|
||||
numOfRows++;
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
pShow->numOfReads += numOfRows;
|
||||
|
@ -632,7 +638,10 @@ static int32_t mgmtGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
|||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) return 0;
|
||||
|
||||
if (strcmp(pUser->user, "root") != 0) return TSDB_CODE_NO_RIGHTS;
|
||||
if (strcmp(pUser->user, "root") != 0) {
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
||||
|
@ -671,7 +680,7 @@ static int32_t mgmtGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
|||
pShow->numOfRows = mgmtGetDnodesNum() * TSDB_MOD_MAX;
|
||||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
pShow->pNode = NULL;
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -722,7 +731,7 @@ int32_t mgmtRetrieveModules(SShowObj *pShow, char *data, int32_t rows, void *pCo
|
|||
numOfRows++;
|
||||
}
|
||||
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
pShow->numOfReads += numOfRows;
|
||||
|
@ -741,7 +750,10 @@ static int32_t mgmtGetConfigMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
|||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) return 0;
|
||||
|
||||
if (strcmp(pUser->user, "root") != 0) return TSDB_CODE_NO_RIGHTS;
|
||||
if (strcmp(pUser->user, "root") != 0) {
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
||||
|
@ -772,7 +784,7 @@ static int32_t mgmtGetConfigMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
|||
|
||||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
pShow->pNode = NULL;
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -824,7 +836,11 @@ static int32_t mgmtGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
int32_t cols = 0;
|
||||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) return 0;
|
||||
if (strcmp(pUser->user, "root") != 0) return TSDB_CODE_NO_RIGHTS;
|
||||
|
||||
if (strcmp(pUser->user, "root") != 0) {
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
||||
|
@ -850,35 +866,18 @@ static int32_t mgmtGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
if (pShow->payloadLen > 0 ) {
|
||||
uint32_t ip = ip2uint(pShow->payload);
|
||||
pDnode = mgmtGetDnodeByIp(ip);
|
||||
if (NULL == pDnode) {
|
||||
return TSDB_CODE_NODE_OFFLINE;
|
||||
}
|
||||
|
||||
SVnodeLoad* pVnode;
|
||||
pShow->numOfRows = 0;
|
||||
for (int32_t i = 0 ; i < TSDB_MAX_VNODES; i++) {
|
||||
pVnode = &pDnode->vload[i];
|
||||
if (0 != pVnode->vgId) {
|
||||
pShow->numOfRows++;
|
||||
}
|
||||
}
|
||||
|
||||
pShow->pNode = pDnode;
|
||||
} else {
|
||||
while (true) {
|
||||
pShow->pNode = mgmtGetNextDnode(pShow->pNode, (SDnodeObj **)&pDnode);
|
||||
if (pDnode == NULL) break;
|
||||
pShow->numOfRows += pDnode->openVnodes;
|
||||
mgmtGetNextDnode(NULL, (SDnodeObj **)&pDnode);
|
||||
}
|
||||
|
||||
if (0 == pShow->numOfRows) return TSDB_CODE_NODE_OFFLINE;
|
||||
}
|
||||
|
||||
pShow->pNode = NULL;
|
||||
}
|
||||
if (pDnode != NULL) {
|
||||
pShow->numOfRows += pDnode->openVnodes;
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtReleaseUser(pUser);
|
||||
pShow->pNode = pDnode;
|
||||
mgmtDecUserRef(pUser);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -891,35 +890,35 @@ static int32_t mgmtRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, voi
|
|||
|
||||
if (0 == rows) return 0;
|
||||
|
||||
if (pShow->payloadLen) {
|
||||
// output the vnodes info of the designated dnode. And output all vnodes of this dnode, instead of rows (max 100)
|
||||
pDnode = (SDnodeObj *)(pShow->pNode);
|
||||
if (pDnode != NULL) {
|
||||
SVnodeLoad* pVnode;
|
||||
for (int32_t i = 0 ; i < TSDB_MAX_VNODES; i++) {
|
||||
pVnode = &pDnode->vload[i];
|
||||
if (0 == pVnode->vgId) {
|
||||
continue;
|
||||
pDnode = (SDnodeObj *)(pShow->pNode);
|
||||
if (pDnode != NULL) {
|
||||
void *pNode = NULL;
|
||||
SVgObj *pVgroup;
|
||||
while (1) {
|
||||
pNode = mgmtGetNextVgroup(pNode, &pVgroup);
|
||||
if (pVgroup == NULL) break;
|
||||
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SVnodeGid *pVgid = &pVgroup->vnodeGid[i];
|
||||
if (pVgid->pDnode == pDnode) {
|
||||
cols = 0;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(uint32_t *)pWrite = pVgroup->vgId;
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, mgmtGetMnodeRoleStr(pVgid->role));
|
||||
cols++;
|
||||
}
|
||||
|
||||
cols = 0;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(uint32_t *)pWrite = pVnode->vgId;
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, pVnode->status ? "ready" : "offline");
|
||||
cols++;
|
||||
|
||||
numOfRows++;
|
||||
}
|
||||
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
}
|
||||
} else {
|
||||
// TODO: output all vnodes of all dnodes
|
||||
numOfRows = 0;
|
||||
}
|
||||
|
||||
|
||||
pShow->numOfReads += numOfRows;
|
||||
return numOfRows;
|
||||
}
|
||||
|
|
|
@ -149,12 +149,12 @@ void mgmtCleanUpSystem() {
|
|||
mgmtCleanUpShell();
|
||||
mgmtCleanupDClient();
|
||||
mgmtCleanupDServer();
|
||||
mgmtCleanUpAccts();
|
||||
mgmtCleanUpTables();
|
||||
mgmtCleanUpVgroups();
|
||||
mgmtCleanUpDbs();
|
||||
mgmtCleanupDnodes();
|
||||
mgmtCleanUpUsers();
|
||||
mgmtCleanUpAccts();
|
||||
sdbCleanUp();
|
||||
taosTmrCleanUp(tsMgmtTmr);
|
||||
tsMgmtIsRunning = false;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "mgmtShell.h"
|
||||
#include "mgmtUser.h"
|
||||
|
||||
static void * tsMnodeSdb = NULL;
|
||||
void * tsMnodeSdb = NULL;
|
||||
static int32_t tsMnodeUpdateSize = 0;
|
||||
static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||
static int32_t mgmtRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||
|
@ -47,7 +47,7 @@ static int32_t mgmtMnodeActionInsert(SSdbOper *pOper) {
|
|||
|
||||
pMnode->pDnode = pDnode;
|
||||
pDnode->isMgmt = true;
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ static int32_t mgmtMnodeActionDelete(SSdbOper *pOper) {
|
|||
SDnodeObj *pDnode = mgmtGetDnode(pMnode->mnodeId);
|
||||
if (pDnode == NULL) return TSDB_CODE_DNODE_NOT_EXIST;
|
||||
pDnode->isMgmt = false;
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
|
||||
mTrace("mnode:%d, is dropped from sdb", pMnode->mnodeId);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -171,7 +171,7 @@ char *mgmtGetMnodeRoleStr(int32_t role) {
|
|||
}
|
||||
}
|
||||
|
||||
void mgmtGetMnodeIpList(SRpcIpSet *ipSet, bool usePublicIp) {
|
||||
void mgmtGetMnodeIpSet(SRpcIpSet *ipSet, bool usePublicIp) {
|
||||
void *pNode = NULL;
|
||||
while (1) {
|
||||
SMnodeObj *pMnode = NULL;
|
||||
|
@ -195,8 +195,8 @@ void mgmtGetMnodeIpList(SRpcIpSet *ipSet, bool usePublicIp) {
|
|||
}
|
||||
}
|
||||
|
||||
void mgmtGetMnodeList(void *param) {
|
||||
SDMNodeInfos *mnodes = param;
|
||||
void mgmtGetMnodeInfos(void *param) {
|
||||
SDMMnodeInfos *mnodes = param;
|
||||
mnodes->inUse = 0;
|
||||
|
||||
int32_t index = 0;
|
||||
|
@ -209,6 +209,7 @@ void mgmtGetMnodeList(void *param) {
|
|||
mnodes->nodeInfos[index].nodeId = htonl(pMnode->mnodeId);
|
||||
mnodes->nodeInfos[index].nodeIp = htonl(pMnode->pDnode->privateIp);
|
||||
mnodes->nodeInfos[index].nodePort = htons(pMnode->pDnode->mnodeDnodePort);
|
||||
mnodes->nodeInfos[index].syncPort = htons(pMnode->pDnode->syncPort);
|
||||
strcpy(mnodes->nodeInfos[index].nodeName, pMnode->pDnode->dnodeName);
|
||||
if (pMnode->role == TAOS_SYNC_ROLE_MASTER) {
|
||||
mnodes->inUse = index;
|
||||
|
@ -267,7 +268,10 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) return 0;
|
||||
|
||||
if (strcmp(pUser->pAcct->user, "root") != 0) return TSDB_CODE_NO_RIGHTS;
|
||||
if (strcmp(pUser->pAcct->user, "root") != 0) {
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
int32_t cols = 0;
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
@ -290,17 +294,17 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 8;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||
strcpy(pSchema[cols].name, "create time");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 10;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
|
||||
strcpy(pSchema[cols].name, "role");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pShow->bytes[cols] = 8;
|
||||
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||
strcpy(pSchema[cols].name, "create time");
|
||||
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||
cols++;
|
||||
|
||||
pMeta->numOfColumns = htons(cols);
|
||||
pShow->numOfColumns = cols;
|
||||
|
@ -313,7 +317,7 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
pShow->numOfRows = mgmtGetMnodesNum();
|
||||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
pShow->pNode = NULL;
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -345,14 +349,14 @@ static int32_t mgmtRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, voi
|
|||
strcpy(pWrite, ipstr);
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int64_t *)pWrite = pMnode->createdTime;
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, mgmtGetMnodeRoleStr(pMnode->role));
|
||||
cols++;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
*(int64_t *)pWrite = pMnode->createdTime;
|
||||
cols++;
|
||||
|
||||
numOfRows++;
|
||||
|
||||
mgmtReleaseMnode(pMnode);
|
||||
|
|
|
@ -704,6 +704,7 @@ void mgmtProcessKillQueryMsg(SQueuedMsg *pMsg) {
|
|||
|
||||
rpcRsp.code = code;
|
||||
rpcSendResponse(&rpcRsp);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
void mgmtProcessKillStreamMsg(SQueuedMsg *pMsg) {
|
||||
|
@ -727,6 +728,7 @@ void mgmtProcessKillStreamMsg(SQueuedMsg *pMsg) {
|
|||
|
||||
rpcRsp.code = code;
|
||||
rpcSendResponse(&rpcRsp);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
void mgmtProcessKillConnectionMsg(SQueuedMsg *pMsg) {
|
||||
|
@ -750,6 +752,7 @@ void mgmtProcessKillConnectionMsg(SQueuedMsg *pMsg) {
|
|||
|
||||
rpcRsp.code = code;
|
||||
rpcSendResponse(&rpcRsp);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
int32_t mgmtInitProfile() {
|
||||
|
@ -790,12 +793,12 @@ void *mgmtMallocQueuedMsg(SRpcMsg *rpcMsg) {
|
|||
void mgmtFreeQueuedMsg(SQueuedMsg *pMsg) {
|
||||
if (pMsg != NULL) {
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
if (pMsg->pUser) mgmtReleaseUser(pMsg->pUser);
|
||||
if (pMsg->pUser) mgmtDecUserRef(pMsg->pUser);
|
||||
if (pMsg->pDb) mgmtDecDbRef(pMsg->pDb);
|
||||
if (pMsg->pVgroup) mgmtReleaseVgroup(pMsg->pVgroup);
|
||||
if (pMsg->pVgroup) mgmtDecVgroupRef(pMsg->pVgroup);
|
||||
if (pMsg->pTable) mgmtDecTableRef(pMsg->pTable);
|
||||
if (pMsg->pAcct) mgmtDecAcctRef(pMsg->pAcct);
|
||||
if (pMsg->pDnode) mgmtReleaseDnode(pMsg->pDnode);
|
||||
if (pMsg->pDnode) mgmtDecDnodeRef(pMsg->pDnode);
|
||||
free(pMsg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ static int32_t sdbInitWal() {
|
|||
}
|
||||
|
||||
sdbTrace("open sdb wal for restore");
|
||||
walRestore(tsSdbObj.wal, &tsSdbObj, sdbWrite);
|
||||
walRestore(tsSdbObj.wal, NULL, sdbWrite);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -174,12 +174,12 @@ void sdbUpdateMnodeRoles() {
|
|||
SNodesRole roles = {0};
|
||||
syncGetNodesRole(tsSdbObj.sync, &roles);
|
||||
|
||||
mPrint("update mnodes:%d sync roles", tsSdbObj.cfg.replica);
|
||||
sdbPrint("update mnodes:%d sync roles", tsSdbObj.cfg.replica);
|
||||
for (int32_t i = 0; i < tsSdbObj.cfg.replica; ++i) {
|
||||
SMnodeObj *pMnode = mgmtGetMnode(roles.nodeId[i]);
|
||||
if (pMnode != NULL) {
|
||||
pMnode->role = roles.role[i];
|
||||
mPrint("mnode:%d, role:%s", pMnode->mnodeId, mgmtGetMnodeRoleStr(pMnode->role));
|
||||
sdbPrint("mnode:%d, role:%s", pMnode->mnodeId, mgmtGetMnodeRoleStr(pMnode->role));
|
||||
mgmtReleaseMnode(pMnode);
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ static int sdbGetWalInfo(void *ahandle, char *name, uint32_t *index) {
|
|||
}
|
||||
|
||||
static void sdbNotifyRole(void *ahandle, int8_t role) {
|
||||
mPrint("mnode role changed from %s to %s", mgmtGetMnodeRoleStr(tsSdbObj.role), mgmtGetMnodeRoleStr(role));
|
||||
sdbPrint("mnode role changed from %s to %s", mgmtGetMnodeRoleStr(tsSdbObj.role), mgmtGetMnodeRoleStr(role));
|
||||
|
||||
if (role == TAOS_SYNC_ROLE_MASTER && tsSdbObj.role != TAOS_SYNC_ROLE_MASTER) {
|
||||
balanceReset();
|
||||
|
@ -208,8 +208,8 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
|
|||
|
||||
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
||||
tsSdbObj.code = code;
|
||||
sdbTrace("sdb forward request confirmed, result:%s", tstrerror(code));
|
||||
sem_post(&tsSdbObj.sem);
|
||||
mPrint("sdb forward request confirmed, result:%s", tstrerror(code));
|
||||
}
|
||||
|
||||
static int32_t sdbForwardToPeer(void *pHead) {
|
||||
|
@ -227,9 +227,9 @@ void sdbUpdateSync() {
|
|||
SSyncCfg syncCfg = {0};
|
||||
int32_t index = 0;
|
||||
|
||||
SDMNodeInfos *mnodes = dnodeGetMnodeList();
|
||||
SDMMnodeInfos *mnodes = dnodeGetMnodeInfos();
|
||||
for (int32_t i = 0; i < mnodes->nodeNum; ++i) {
|
||||
SDMNodeInfo *node = &mnodes->nodeInfos[i];
|
||||
SDMMnodeInfo *node = &mnodes->nodeInfos[i];
|
||||
syncCfg.nodeInfo[i].nodeId = node->nodeId;
|
||||
syncCfg.nodeInfo[i].nodeIp = node->nodeIp;
|
||||
strcpy(syncCfg.nodeInfo[i].name, node->nodeName);
|
||||
|
@ -271,9 +271,9 @@ void sdbUpdateSync() {
|
|||
if (!hasThisDnode) return;
|
||||
if (memcmp(&syncCfg, &tsSdbObj.cfg, sizeof(SSyncCfg)) == 0) return;
|
||||
|
||||
mPrint("work as mnode, replica:%d arbitratorIp:%s", syncCfg.replica, taosIpStr(syncCfg.arbitratorIp));
|
||||
sdbPrint("work as mnode, replica:%d arbitratorIp:%s", syncCfg.replica, taosIpStr(syncCfg.arbitratorIp));
|
||||
for (int32_t i = 0; i < syncCfg.replica; ++i) {
|
||||
mPrint("mnode:%d, ip:%s name:%s", syncCfg.nodeInfo[i].nodeId, taosIpStr(syncCfg.nodeInfo[i].nodeIp),
|
||||
sdbPrint("mnode:%d, ip:%s name:%s", syncCfg.nodeInfo[i].nodeId, taosIpStr(syncCfg.nodeInfo[i].nodeIp),
|
||||
syncCfg.nodeInfo[i].name);
|
||||
}
|
||||
|
||||
|
@ -476,9 +476,13 @@ static int sdbWrite(void *param, void *data, int type) {
|
|||
pthread_mutex_unlock(&tsSdbObj.mutex);
|
||||
|
||||
// from app, oper is created
|
||||
if (param == NULL) return code;
|
||||
if (param != NULL) return code;
|
||||
|
||||
// from wal or forward msg, should create oper
|
||||
if (tsSdbObj.sync != NULL) {
|
||||
syncConfirmForward(tsSdbObj.sync, pHead->version, code);
|
||||
}
|
||||
|
||||
// from wal, should create oper
|
||||
if (action == SDB_ACTION_INSERT) {
|
||||
SSdbOper oper = {.rowSize = pHead->len, .rowData = pHead->cont, .table = pTable};
|
||||
code = (*pTable->decodeFp)(&oper);
|
||||
|
@ -529,7 +533,7 @@ int32_t sdbInsertRow(SSdbOper *pOper) {
|
|||
(*pTable->encodeFp)(pOper);
|
||||
pHead->len = pOper->rowSize;
|
||||
|
||||
int32_t code = sdbWrite(NULL, pHead, pHead->msgType);
|
||||
int32_t code = sdbWrite(pOper, pHead, pHead->msgType);
|
||||
taosFreeQitem(pHead);
|
||||
if (code < 0) return code;
|
||||
}
|
||||
|
@ -571,7 +575,7 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
|
|||
pHead->msgType = pTable->tableId * 10 + SDB_ACTION_DELETE;
|
||||
memcpy(pHead->cont, pOper->pObj, rowSize);
|
||||
|
||||
int32_t code = sdbWrite(NULL, pHead, pHead->msgType);
|
||||
int32_t code = sdbWrite(pOper, pHead, pHead->msgType);
|
||||
taosFreeQitem(pHead);
|
||||
if (code < 0) return code;
|
||||
}
|
||||
|
@ -602,7 +606,7 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
|
|||
(*pTable->encodeFp)(pOper);
|
||||
pHead->len = pOper->rowSize;
|
||||
|
||||
int32_t code = sdbWrite(NULL, pHead, pHead->msgType);
|
||||
int32_t code = sdbWrite(pOper, pHead, pHead->msgType);
|
||||
taosFreeQitem(pHead);
|
||||
if (code < 0) return code;
|
||||
}
|
||||
|
|
|
@ -141,13 +141,19 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) {
|
|||
|
||||
static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
|
||||
if (rpcMsg == NULL || rpcMsg->pCont == NULL) {
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sdbIsMaster()) {
|
||||
// rpcSendRedirectRsp(rpcMsg->handle, mgmtGetMnodeIpListForRedirect());
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_NO_MASTER);
|
||||
rpcFreeCont(rpcMsg->pCont);
|
||||
SRpcConnInfo connInfo;
|
||||
rpcGetConnInfo(rpcMsg->handle, &connInfo);
|
||||
bool usePublicIp = (connInfo.serverIp == tsPublicIpInt);
|
||||
|
||||
SRpcIpSet ipSet = {0};
|
||||
mgmtGetMnodeIpSet(&ipSet, usePublicIp);
|
||||
mTrace("conn from ip:%s user:%s redirect msg", taosIpStr(connInfo.clientIp), connInfo.user);
|
||||
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -332,7 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) {
|
|||
return;
|
||||
}
|
||||
|
||||
mgmtGetMnodeIpList(&pHBRsp->ipList, pMsg->usePublicIp);
|
||||
mgmtGetMnodeIpSet(&pHBRsp->ipList, pMsg->usePublicIp);
|
||||
|
||||
/*
|
||||
* TODO
|
||||
|
@ -357,14 +363,18 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr
|
|||
*encrypt = 0;
|
||||
*ckey = 0;
|
||||
|
||||
if (!sdbIsMaster()) {
|
||||
*secret = 0;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
SUserObj *pUser = mgmtGetUser(user);
|
||||
if (pUser == NULL) {
|
||||
*secret = 0;
|
||||
mgmtReleaseUser(pUser);
|
||||
return TSDB_CODE_INVALID_USER;
|
||||
} else {
|
||||
memcpy(secret, pUser->pass, TSDB_KEY_LEN);
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -414,7 +424,7 @@ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) {
|
|||
pConnectRsp->writeAuth = pUser->writeAuth;
|
||||
pConnectRsp->superAuth = pUser->superAuth;
|
||||
|
||||
mgmtGetMnodeIpList(&pConnectRsp->ipList, pMsg->usePublicIp);
|
||||
mgmtGetMnodeIpSet(&pConnectRsp->ipList, pMsg->usePublicIp);
|
||||
|
||||
connect_over:
|
||||
rpcRsp.code = code;
|
||||
|
|
|
@ -97,7 +97,7 @@ static int32_t mgmtChildTableActionInsert(SSdbOper *pOper) {
|
|||
mError("ctable:%s, not in vgroup:%d", pTable->info.tableId, pTable->vgId);
|
||||
return TSDB_CODE_INVALID_VGROUP_ID;
|
||||
}
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
|
||||
SDbObj *pDb = mgmtGetDb(pVgroup->dbName);
|
||||
if (pDb == NULL) {
|
||||
|
@ -108,7 +108,7 @@ static int32_t mgmtChildTableActionInsert(SSdbOper *pOper) {
|
|||
|
||||
SAcctObj *pAcct = mgmtGetAcct(pDb->cfg.acct);
|
||||
if (pAcct == NULL) {
|
||||
mError("ctable:%s, account:%s not exists", pTable->info.tableId, pDb->cfg.acct);
|
||||
mError("ctable:%s, acct:%s not exists", pTable->info.tableId, pDb->cfg.acct);
|
||||
return TSDB_CODE_INVALID_ACCT;
|
||||
}
|
||||
mgmtDecAcctRef(pAcct);
|
||||
|
@ -139,7 +139,7 @@ static int32_t mgmtChildTableActionDelete(SSdbOper *pOper) {
|
|||
if (pVgroup == NULL) {
|
||||
return TSDB_CODE_INVALID_VGROUP_ID;
|
||||
}
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
|
||||
SDbObj *pDb = mgmtGetDb(pVgroup->dbName);
|
||||
if (pDb == NULL) {
|
||||
|
@ -150,7 +150,7 @@ static int32_t mgmtChildTableActionDelete(SSdbOper *pOper) {
|
|||
|
||||
SAcctObj *pAcct = mgmtGetAcct(pDb->cfg.acct);
|
||||
if (pAcct == NULL) {
|
||||
mError("ctable:%s, account:%s not exists", pTable->info.tableId, pDb->cfg.acct);
|
||||
mError("ctable:%s, acct:%s not exists", pTable->info.tableId, pDb->cfg.acct);
|
||||
return TSDB_CODE_INVALID_ACCT;
|
||||
}
|
||||
mgmtDecAcctRef(pAcct);
|
||||
|
@ -275,7 +275,7 @@ static int32_t mgmtChildTableActionRestored() {
|
|||
pNode = pLastNode;
|
||||
continue;
|
||||
}
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
|
||||
if (strcmp(pVgroup->dbName, pDb->name) != 0) {
|
||||
mError("ctable:%s, db:%s not match with vgroup:%d db:%s sid:%d, discard it",
|
||||
|
@ -1194,17 +1194,15 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
|
|||
|
||||
pRsp->vgroups[vg].vgId = htonl(vgId);
|
||||
for (int32_t vn = 0; vn < pVgroup->numOfVnodes; ++vn) {
|
||||
SDnodeObj *pDnode = mgmtGetDnode(pVgroup->vnodeGid[vn].dnodeId);
|
||||
SDnodeObj *pDnode = pVgroup->vnodeGid[vn].pDnode;
|
||||
if (pDnode == NULL) break;
|
||||
|
||||
pRsp->vgroups[vg].ipAddr[vn].ip = htonl(pDnode->privateIp);
|
||||
pRsp->vgroups[vg].ipAddr[vn].port = htons(tsDnodeShellPort);
|
||||
pRsp->vgroups[vg].numOfIps++;
|
||||
|
||||
mgmtReleaseDnode(pDnode);
|
||||
}
|
||||
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
}
|
||||
pRsp->numOfVgroups = htonl(vg);
|
||||
|
||||
|
@ -1613,7 +1611,7 @@ static int32_t mgmtDoGetChildTableMeta(SQueuedMsg *pMsg, STableMetaMsg *pMeta) {
|
|||
pMeta->vgroup.ipAddr[i].port = htonl(tsDnodeShellPort);
|
||||
}
|
||||
pMeta->vgroup.numOfIps++;
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
pMeta->vgroup.vgId = htonl(pVgroup->vgId);
|
||||
|
||||
|
@ -1742,7 +1740,7 @@ static SChildTableObj* mgmtGetTableByPos(uint32_t dnodeId, int32_t vnode, int32_
|
|||
|
||||
SChildTableObj *pTable = pVgroup->tableList[sid];
|
||||
mgmtIncTableRef((STableObj *)pTable);
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
return pTable;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,23 +19,23 @@
|
|||
#include "ttime.h"
|
||||
#include "tutil.h"
|
||||
#include "tglobal.h"
|
||||
#include "tgrant.h"
|
||||
#include "dnode.h"
|
||||
#include "mgmtDef.h"
|
||||
#include "mgmtLog.h"
|
||||
#include "mgmtAcct.h"
|
||||
#include "tgrant.h"
|
||||
#include "mgmtMnode.h"
|
||||
#include "mgmtSdb.h"
|
||||
#include "mgmtShell.h"
|
||||
#include "mgmtUser.h"
|
||||
|
||||
void * tsUserSdb = NULL;
|
||||
static void * tsUserSdb = NULL;
|
||||
static int32_t tsUserUpdateSize = 0;
|
||||
static int32_t mgmtGetUserMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||
static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||
static void mgmtProcessCreateUserMsg(SQueuedMsg *pMsg);
|
||||
static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg);
|
||||
static void mgmtProcessDropUserMsg(SQueuedMsg *pMsg);
|
||||
static void mgmtProcessCreateUserMsg(SQueuedMsg *pMsg);
|
||||
static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg);
|
||||
static void mgmtProcessDropUserMsg(SQueuedMsg *pMsg);
|
||||
|
||||
static int32_t mgmtUserActionDestroy(SSdbOper *pOper) {
|
||||
tfree(pOper->pObj);
|
||||
|
@ -48,8 +48,8 @@ static int32_t mgmtUserActionInsert(SSdbOper *pOper) {
|
|||
|
||||
if (pAcct != NULL) {
|
||||
mgmtAddUserToAcct(pAcct, pUser);
|
||||
}
|
||||
else {
|
||||
mgmtDecAcctRef(pAcct);
|
||||
} else {
|
||||
mError("user:%s, acct:%s info not exist in sdb", pUser->user, pUser->acct);
|
||||
return TSDB_CODE_INVALID_ACCT;
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ static int32_t mgmtUserActionDelete(SSdbOper *pOper) {
|
|||
|
||||
if (pAcct != NULL) {
|
||||
mgmtDropUserFromAcct(pAcct, pUser);
|
||||
mgmtDecAcctRef(pAcct);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -72,9 +73,10 @@ static int32_t mgmtUserActionUpdate(SSdbOper *pOper) {
|
|||
SUserObj *pUser = pOper->pObj;
|
||||
SUserObj *pSaved = mgmtGetUser(pUser->user);
|
||||
if (pUser != pSaved) {
|
||||
memcpy(pSaved, pUser, pOper->rowSize);
|
||||
memcpy(pSaved, pUser, tsUserUpdateSize);
|
||||
free(pUser);
|
||||
}
|
||||
mgmtDecUserRef(pSaved);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -86,7 +88,7 @@ static int32_t mgmtUserActionEncode(SSdbOper *pOper) {
|
|||
}
|
||||
|
||||
static int32_t mgmtUserActionDecode(SSdbOper *pOper) {
|
||||
SUserObj *pUser = (SUserObj *) calloc(1, sizeof(SUserObj));
|
||||
SUserObj *pUser = (SUserObj *)calloc(1, sizeof(SUserObj));
|
||||
if (pUser == NULL) return TSDB_CODE_SERV_OUT_OF_MEMORY;
|
||||
|
||||
memcpy(pUser, pOper->rowData, tsUserUpdateSize);
|
||||
|
@ -103,7 +105,7 @@ static int32_t mgmtUserActionRestored() {
|
|||
mgmtDecAcctRef(pAcct);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t mgmtInitUsers() {
|
||||
|
@ -128,7 +130,7 @@ int32_t mgmtInitUsers() {
|
|||
|
||||
tsUserSdb = sdbOpenTable(&tableDesc);
|
||||
if (tsUserSdb == NULL) {
|
||||
mError("failed to init user data");
|
||||
mError("table:%s, failed to create hash", tableDesc.tableName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -138,7 +140,7 @@ int32_t mgmtInitUsers() {
|
|||
mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_USER, mgmtGetUserMeta);
|
||||
mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mgmtRetrieveUsers);
|
||||
|
||||
mTrace("table:users table is created");
|
||||
mTrace("table:%s, hash is created", tableDesc.tableName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -150,7 +152,15 @@ SUserObj *mgmtGetUser(char *name) {
|
|||
return (SUserObj *)sdbGetRow(tsUserSdb, name);
|
||||
}
|
||||
|
||||
void mgmtReleaseUser(SUserObj *pUser) {
|
||||
void *mgmtGetNextUser(void *pNode, SUserObj **pUser) {
|
||||
return sdbFetchRow(tsUserSdb, pNode, (void **)pUser);
|
||||
}
|
||||
|
||||
void mgmtIncUserRef(SUserObj *pUser) {
|
||||
return sdbIncRef(tsUserSdb, pUser);
|
||||
}
|
||||
|
||||
void mgmtDecUserRef(SUserObj *pUser) {
|
||||
return sdbDecRef(tsUserSdb, pUser);
|
||||
}
|
||||
|
||||
|
@ -172,18 +182,22 @@ static int32_t mgmtUpdateUser(SUserObj *pUser) {
|
|||
|
||||
int32_t mgmtCreateUser(SAcctObj *pAcct, char *name, char *pass) {
|
||||
int32_t code = acctCheck(pAcct, ACCT_GRANT_USER);
|
||||
if (code != 0) {
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
||||
if (name[0] == 0 || pass[0] == 0) {
|
||||
return TSDB_CODE_INVALID_MSG_CONTENT;
|
||||
if (name[0] == 0) {
|
||||
return TSDB_CODE_INVALID_USER_FORMAT;
|
||||
}
|
||||
|
||||
if (pass[0] == 0) {
|
||||
return TSDB_CODE_INVALID_PASS_FORMAT;
|
||||
}
|
||||
|
||||
SUserObj *pUser = mgmtGetUser(name);
|
||||
if (pUser != NULL) {
|
||||
mTrace("user:%s is already there", name);
|
||||
mgmtReleaseUser(pUser);
|
||||
mTrace("user:%s, is already there", name);
|
||||
mgmtDecUserRef(pUser);
|
||||
return TSDB_CODE_USER_ALREADY_EXIST;
|
||||
}
|
||||
|
||||
|
@ -237,10 +251,10 @@ static int32_t mgmtDropUser(SUserObj *pUser) {
|
|||
static int32_t mgmtGetUserMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
||||
SUserObj *pUser = mgmtGetUserFromConn(pConn, NULL);
|
||||
if (pUser == NULL) {
|
||||
return TSDB_CODE_INVALID_USER;
|
||||
return TSDB_CODE_NO_USER_FROM_CONN;
|
||||
}
|
||||
|
||||
int32_t cols = 0;
|
||||
int32_t cols = 0;
|
||||
SSchema *pSchema = pMeta->schema;
|
||||
|
||||
pShow->bytes[cols] = TSDB_USER_LEN;
|
||||
|
@ -273,7 +287,7 @@ static int32_t mgmtGetUserMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCon
|
|||
pShow->numOfRows = pUser->pAcct->acctInfo.numOfUsers;
|
||||
pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
|
||||
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -308,8 +322,9 @@ static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void
|
|||
cols++;
|
||||
|
||||
numOfRows++;
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
pShow->numOfReads += numOfRows;
|
||||
return numOfRows;
|
||||
}
|
||||
|
@ -321,20 +336,21 @@ SUserObj *mgmtGetUserFromConn(void *pConn, bool *usePublicIp) {
|
|||
*usePublicIp = (connInfo.serverIp == tsPublicIpInt);
|
||||
}
|
||||
return mgmtGetUser(connInfo.user);
|
||||
} else {
|
||||
mError("can not get user from conn:%p", pConn);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void mgmtProcessCreateUserMsg(SQueuedMsg *pMsg) {
|
||||
int32_t code;
|
||||
SUserObj *pUser = pMsg->pUser;
|
||||
SUserObj *pOperUser = pMsg->pUser;
|
||||
|
||||
if (pUser->superAuth) {
|
||||
if (pOperUser->superAuth) {
|
||||
SCMCreateUserMsg *pCreate = pMsg->pCont;
|
||||
code = mgmtCreateUser(pUser->pAcct, pCreate->user, pCreate->pass);
|
||||
code = mgmtCreateUser(pOperUser->pAcct, pCreate->user, pCreate->pass);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
mLPrint("user:%s is created by %s", pCreate->user, pUser->user);
|
||||
mLPrint("user:%s, is created by %s", pCreate->user, pOperUser->user);
|
||||
}
|
||||
} else {
|
||||
code = TSDB_CODE_NO_RIGHTS;
|
||||
|
@ -356,7 +372,7 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
|
|||
|
||||
if (strcmp(pUser->user, "monitor") == 0 || (strcmp(pUser->user + 1, pUser->acct) == 0 && pUser->user[0] == '_')) {
|
||||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_NO_RIGHTS);
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -380,7 +396,7 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
|
|||
memset(pUser->pass, 0, sizeof(pUser->pass));
|
||||
taosEncryptPass((uint8_t*)pAlter->pass, strlen(pAlter->pass), pUser->pass);
|
||||
code = mgmtUpdateUser(pUser);
|
||||
mLPrint("user:%s password is altered by %s, result:%d", pUser->user, pOperUser->user, tstrerror(code));
|
||||
mLPrint("user:%s, password is altered by %s, result:%s", pUser->user, pOperUser->user, tstrerror(code));
|
||||
} else {
|
||||
code = TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
@ -422,7 +438,7 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
|
|||
}
|
||||
|
||||
code = mgmtUpdateUser(pUser);
|
||||
mLPrint("user:%s privilege is altered by %s, result:%d", pUser->user, pOperUser->user, tstrerror(code));
|
||||
mLPrint("user:%s, privilege is altered by %s, result:%s", pUser->user, pOperUser->user, tstrerror(code));
|
||||
} else {
|
||||
code = TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
@ -432,7 +448,7 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
|
|||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_NO_RIGHTS);
|
||||
}
|
||||
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
static void mgmtProcessDropUserMsg(SQueuedMsg *pMsg) {
|
||||
|
@ -443,13 +459,13 @@ static void mgmtProcessDropUserMsg(SQueuedMsg *pMsg) {
|
|||
SUserObj *pUser = mgmtGetUser(pDrop->user);
|
||||
if (pUser == NULL) {
|
||||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_INVALID_USER);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(pUser->user, "monitor") == 0 || strcmp(pUser->user, pUser->acct) == 0 ||
|
||||
(strcmp(pUser->user + 1, pUser->acct) == 0 && pUser->user[0] == '_')) {
|
||||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_NO_RIGHTS);
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
@ -471,14 +487,14 @@ static void mgmtProcessDropUserMsg(SQueuedMsg *pMsg) {
|
|||
if (hasRight) {
|
||||
code = mgmtDropUser(pUser);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
mLPrint("user:%s is dropped by %s, result:%s", pUser->user, pOperUser->user, tstrerror(code));
|
||||
mLPrint("user:%s, is dropped by %s, result:%s", pUser->user, pOperUser->user, tstrerror(code));
|
||||
}
|
||||
} else {
|
||||
code = TSDB_CODE_NO_RIGHTS;
|
||||
}
|
||||
|
||||
mgmtSendSimpleResp(pMsg->thandle, code);
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
void mgmtDropAllUsers(SAcctObj *pAcct) {
|
||||
|
@ -504,7 +520,7 @@ void mgmtDropAllUsers(SAcctObj *pAcct) {
|
|||
numOfUsers++;
|
||||
}
|
||||
|
||||
mgmtReleaseUser(pUser);
|
||||
mgmtDecUserRef(pUser);
|
||||
}
|
||||
|
||||
mTrace("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers);
|
||||
|
|
|
@ -44,9 +44,7 @@ static int32_t mgmtRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, vo
|
|||
static void mgmtProcessCreateVnodeRsp(SRpcMsg *rpcMsg);
|
||||
static void mgmtProcessDropVnodeRsp(SRpcMsg *rpcMsg);
|
||||
static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) ;
|
||||
|
||||
static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle);
|
||||
static void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle);
|
||||
static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle);
|
||||
|
||||
static int32_t mgmtVgroupActionDestroy(SSdbOper *pOper) {
|
||||
SVgObj *pVgroup = pOper->pObj;
|
||||
|
@ -68,7 +66,6 @@ static int32_t mgmtVgroupActionInsert(SSdbOper *pOper) {
|
|||
if (pDb == NULL) {
|
||||
return TSDB_CODE_INVALID_DB;
|
||||
}
|
||||
mgmtDecDbRef(pDb);
|
||||
|
||||
pVgroup->pDb = pDb;
|
||||
pVgroup->prev = NULL;
|
||||
|
@ -91,15 +88,13 @@ static int32_t mgmtVgroupActionInsert(SSdbOper *pOper) {
|
|||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SDnodeObj *pDnode = mgmtGetDnode(pVgroup->vnodeGid[i].dnodeId);
|
||||
if (pDnode != NULL) {
|
||||
pVgroup->vnodeGid[i].privateIp = pDnode->privateIp;
|
||||
pVgroup->vnodeGid[i].publicIp = pDnode->publicIp;
|
||||
atomic_add_fetch_32(&pDnode->openVnodes, 1);
|
||||
mgmtReleaseDnode(pDnode);
|
||||
}
|
||||
pVgroup->vnodeGid[i].pDnode = pDnode;
|
||||
atomic_add_fetch_32(&pDnode->openVnodes, 1);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
}
|
||||
|
||||
mgmtAddVgroupIntoDb(pVgroup);
|
||||
mgmtIncDbRef(pVgroup->pDb);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -115,10 +110,10 @@ static int32_t mgmtVgroupActionDelete(SSdbOper *pOper) {
|
|||
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SDnodeObj *pDnode = mgmtGetDnode(pVgroup->vnodeGid[i].dnodeId);
|
||||
if (pDnode) {
|
||||
if (pDnode != NULL) {
|
||||
atomic_sub_fetch_32(&pDnode->openVnodes, 1);
|
||||
}
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -127,9 +122,25 @@ static int32_t mgmtVgroupActionDelete(SSdbOper *pOper) {
|
|||
static int32_t mgmtVgroupActionUpdate(SSdbOper *pOper) {
|
||||
SVgObj *pNew = pOper->pObj;
|
||||
SVgObj *pVgroup = mgmtGetVgroup(pNew->vgId);
|
||||
|
||||
if (pVgroup != pNew) {
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SDnodeObj *pDnode = pVgroup->vnodeGid[i].pDnode;
|
||||
if (pDnode != NULL) {
|
||||
atomic_sub_fetch_32(&pDnode->openVnodes, 1);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(pVgroup, pNew, pOper->rowSize);
|
||||
free(pNew);
|
||||
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SDnodeObj *pDnode = mgmtGetDnode(pVgroup->vnodeGid[i].dnodeId);
|
||||
pVgroup->vnodeGid[i].pDnode = pDnode;
|
||||
if (pDnode != NULL) {
|
||||
atomic_add_fetch_32(&pDnode->openVnodes, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32_t oldTables = taosIdPoolMaxSize(pVgroup->idPool);
|
||||
|
@ -150,6 +161,12 @@ static int32_t mgmtVgroupActionUpdate(SSdbOper *pOper) {
|
|||
static int32_t mgmtVgroupActionEncode(SSdbOper *pOper) {
|
||||
SVgObj *pVgroup = pOper->pObj;
|
||||
memcpy(pOper->rowData, pVgroup, tsVgUpdateSize);
|
||||
SVgObj *pTmpVgroup = pOper->rowData;
|
||||
for (int32_t i = 0; i < TSDB_VNODES_SUPPORT; ++i) {
|
||||
pTmpVgroup->vnodeGid[i].pDnode = NULL;
|
||||
pTmpVgroup->vnodeGid[i].role = 0;
|
||||
}
|
||||
|
||||
pOper->rowSize = tsVgUpdateSize;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -204,7 +221,11 @@ int32_t mgmtInitVgroups() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void mgmtReleaseVgroup(SVgObj *pVgroup) {
|
||||
void mgmtIncVgroupRef(SVgObj *pVgroup) {
|
||||
return sdbIncRef(tsVgroupSdb, pVgroup);
|
||||
}
|
||||
|
||||
void mgmtDecVgroupRef(SVgObj *pVgroup) {
|
||||
return sdbDecRef(tsVgroupSdb, pVgroup);
|
||||
}
|
||||
|
||||
|
@ -224,16 +245,38 @@ void mgmtUpdateVgroup(SVgObj *pVgroup) {
|
|||
mgmtSendCreateVgroupMsg(pVgroup, NULL);
|
||||
}
|
||||
|
||||
void mgmtUpdateVgroupStatus(SVgObj *pVgroup, int32_t dnodeId, SVnodeLoad *pVload) {
|
||||
if (pVload->role == TAOS_SYNC_ROLE_MASTER) {
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SVnodeGid *pVgid = &pVgroup->vnodeGid[i];
|
||||
if (pVgid->dnodeId == dnodeId) {
|
||||
void mgmtUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload) {
|
||||
bool dnodeExist = false;
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SVnodeGid *pVgid = &pVgroup->vnodeGid[i];
|
||||
if (pVgid->pDnode == pDnode) {
|
||||
pVgid->role = pVload->role;
|
||||
if (pVload->role == TAOS_SYNC_ROLE_MASTER) {
|
||||
pVgroup->inUse = i;
|
||||
break;
|
||||
}
|
||||
dnodeExist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dnodeExist) {
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pDnode->privateIp);
|
||||
mError("vgroup:%d, dnode:%d not exist in mnode, drop it", pVload->vgId, pDnode->dnodeId);
|
||||
mgmtSendDropVnodeMsg(pVload->vgId, &ipSet, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pVload->role == TAOS_SYNC_ROLE_MASTER) {
|
||||
pVgroup->totalStorage = htobe64(pVload->totalStorage);
|
||||
pVgroup->compStorage = htobe64(pVload->compStorage);
|
||||
pVgroup->pointsWritten = htobe64(pVload->pointsWritten);
|
||||
}
|
||||
|
||||
if (pVload->replica != pVgroup->numOfVnodes) {
|
||||
mError("dnode:%d, vgroup:%d replica:%d not match with mgmt:%d", pDnode->dnodeId, pVload->vgId, pVload->replica,
|
||||
pVgroup->numOfVnodes);
|
||||
mgmtSendCreateVgroupMsg(pVgroup, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
SVgObj *mgmtGetAvailableVgroup(SDbObj *pDb) {
|
||||
|
@ -340,7 +383,7 @@ int32_t mgmtGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
|||
mgmtDecTableRef(pTable);
|
||||
pVgroup = mgmtGetVgroup(((SChildTableObj*)pTable)->vgId);
|
||||
if (NULL == pVgroup) return TSDB_CODE_INVALID_TABLE_ID;
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
maxReplica = pVgroup->numOfVnodes > maxReplica ? pVgroup->numOfVnodes : maxReplica;
|
||||
} else {
|
||||
SVgObj *pVgroup = pDb->pHead;
|
||||
|
@ -391,27 +434,6 @@ int32_t mgmtGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *mgmtGetVnodeStatus(SVgObj *pVgroup, SVnodeGid *pVnode) {
|
||||
SDnodeObj *pDnode = mgmtGetDnode(pVnode->dnodeId);
|
||||
if (pDnode == NULL) {
|
||||
mError("vgroup:%d, not exist in dnode:%d", pVgroup->vgId, pDnode->dnodeId);
|
||||
return "null";
|
||||
}
|
||||
mgmtReleaseDnode(pDnode);
|
||||
|
||||
if (pDnode->status == TAOS_DN_STATUS_OFFLINE) {
|
||||
return "offline";
|
||||
}
|
||||
|
||||
for (int i = 0; i < pDnode->openVnodes; ++i) {
|
||||
if (pDnode->vload[i].vgId == pVgroup->vgId) {
|
||||
return pDnode->vload[i].status ? "ready" : "offline";
|
||||
}
|
||||
}
|
||||
|
||||
return "null";
|
||||
}
|
||||
|
||||
int32_t mgmtRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pConn) {
|
||||
int32_t numOfRows = 0;
|
||||
SVgObj *pVgroup = NULL;
|
||||
|
@ -453,19 +475,24 @@ int32_t mgmtRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pCo
|
|||
*(int16_t *) pWrite = pVgroup->vnodeGid[i].dnodeId;
|
||||
cols++;
|
||||
|
||||
tinet_ntoa(ipstr, pVgroup->vnodeGid[i].privateIp);
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, ipstr);
|
||||
cols++;
|
||||
SDnodeObj *pDnode = pVgroup->vnodeGid[i].pDnode;
|
||||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
if (pVgroup->vnodeGid[i].dnodeId != 0) {
|
||||
char *vnodeStatus = mgmtGetVnodeStatus(pVgroup, pVgroup->vnodeGid + i);
|
||||
strcpy(pWrite, vnodeStatus);
|
||||
if (pDnode != NULL) {
|
||||
tinet_ntoa(ipstr, pDnode->privateIp);
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, ipstr);
|
||||
cols++;
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, mgmtGetMnodeRoleStr(pVgroup->vnodeGid[i].role));
|
||||
cols++;
|
||||
} else {
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, "null");
|
||||
cols++;
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
strcpy(pWrite, "null");
|
||||
cols++;
|
||||
}
|
||||
cols++;
|
||||
}
|
||||
|
||||
numOfRows++;
|
||||
|
@ -506,27 +533,38 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) {
|
|||
SMDCreateVnodeMsg *pVnode = rpcMallocCont(sizeof(SMDCreateVnodeMsg));
|
||||
if (pVnode == NULL) return NULL;
|
||||
|
||||
pVnode->cfg = pDb->cfg;
|
||||
|
||||
SVnodeCfg *pCfg = &pVnode->cfg;
|
||||
pCfg->vgId = htonl(pVgroup->vgId);
|
||||
pCfg->maxSessions = htonl(pCfg->maxSessions);
|
||||
pCfg->cacheBlockSize = htonl(pCfg->cacheBlockSize);
|
||||
pCfg->cacheNumOfBlocks.totalBlocks = htonl(pCfg->cacheNumOfBlocks.totalBlocks);
|
||||
pCfg->daysPerFile = htonl(pCfg->daysPerFile);
|
||||
pCfg->daysToKeep1 = htonl(pCfg->daysToKeep1);
|
||||
pCfg->daysToKeep2 = htonl(pCfg->daysToKeep2);
|
||||
pCfg->daysToKeep = htonl(pCfg->daysToKeep);
|
||||
pCfg->commitTime = htonl(pCfg->commitTime);
|
||||
pCfg->rowsInFileBlock = htonl(pCfg->rowsInFileBlock);
|
||||
pCfg->blocksPerTable = htons(pCfg->blocksPerTable);
|
||||
pCfg->replications = (int8_t) pVgroup->numOfVnodes;
|
||||
SMDVnodeCfg *pCfg = &pVnode->cfg;
|
||||
pCfg->vgId = htonl(pVgroup->vgId);
|
||||
pCfg->maxTables = htonl(pDb->cfg.maxSessions);
|
||||
pCfg->maxCacheSize = htobe64((int64_t)pDb->cfg.cacheBlockSize * pDb->cfg.cacheNumOfBlocks.totalBlocks);
|
||||
pCfg->maxCacheSize = htobe64(-1);
|
||||
pCfg->minRowsPerFileBlock = htonl(-1);
|
||||
pCfg->maxRowsPerFileBlock = htonl(-1);
|
||||
pCfg->daysPerFile = htonl(pDb->cfg.daysPerFile);
|
||||
pCfg->daysToKeep1 = htonl(pDb->cfg.daysToKeep1);
|
||||
pCfg->daysToKeep2 = htonl(pDb->cfg.daysToKeep2);
|
||||
pCfg->daysToKeep = htonl(pDb->cfg.daysToKeep);
|
||||
pCfg->daysToKeep = htonl(-1);
|
||||
pCfg->commitTime = htonl(pDb->cfg.commitTime);
|
||||
pCfg->precision = pDb->cfg.precision;
|
||||
pCfg->compression = pDb->cfg.compression;
|
||||
pCfg->compression = -1;
|
||||
pCfg->wals = 3;
|
||||
pCfg->commitLog = pDb->cfg.commitLog;
|
||||
pCfg->replications = (int8_t) pVgroup->numOfVnodes;
|
||||
pCfg->quorum = 1;
|
||||
|
||||
SVnodeDesc *vpeerDesc = pVnode->vpeerDesc;
|
||||
SMDVnodeDesc *pNodes = pVnode->nodes;
|
||||
for (int32_t j = 0; j < pVgroup->numOfVnodes; ++j) {
|
||||
vpeerDesc[j].vgId = htonl(pVgroup->vgId);
|
||||
vpeerDesc[j].dnodeId = htonl(pVgroup->vnodeGid[j].dnodeId);
|
||||
vpeerDesc[j].ip = htonl(pVgroup->vnodeGid[j].privateIp);
|
||||
SDnodeObj *pDnode = pVgroup->vnodeGid[j].pDnode;
|
||||
if (pDnode != NULL) {
|
||||
pNodes[j].nodeId = htonl(pDnode->dnodeId);
|
||||
pNodes[j].nodeIp = htonl(pDnode->privateIp);
|
||||
strcpy(pNodes[j].nodeName, pDnode->dnodeName);
|
||||
if (j == 0) {
|
||||
pCfg->arbitratorIp = htonl(pDnode->privateIp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pVnode;
|
||||
|
@ -539,7 +577,7 @@ SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup) {
|
|||
.port = tsDnodeMnodePort
|
||||
};
|
||||
for (int i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
ipSet.ip[i] = pVgroup->vnodeGid[i].privateIp;
|
||||
ipSet.ip[i] = pVgroup->vnodeGid[i].pDnode->privateIp;
|
||||
}
|
||||
return ipSet;
|
||||
}
|
||||
|
@ -570,7 +608,7 @@ void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
|
|||
void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) {
|
||||
mTrace("vgroup:%d, send create all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].privateIp);
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->privateIp);
|
||||
mgmtSendCreateVnodeMsg(pVgroup, &ipSet, ahandle);
|
||||
}
|
||||
}
|
||||
|
@ -636,7 +674,7 @@ void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
|
|||
static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) {
|
||||
mTrace("vgroup:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
|
||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].privateIp);
|
||||
SRpcIpSet ipSet = mgmtGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->privateIp);
|
||||
mgmtSendDropVnodeMsg(pVgroup->vgId, &ipSet, ahandle);
|
||||
}
|
||||
}
|
||||
|
@ -687,7 +725,7 @@ static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) {
|
|||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_NOT_ACTIVE_VNODE);
|
||||
return;
|
||||
}
|
||||
mgmtReleaseDnode(pDnode);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
|
||||
SVgObj *pVgroup = mgmtGetVgroup(pCfg->vgId);
|
||||
if (pVgroup == NULL) {
|
||||
|
@ -695,7 +733,7 @@ static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) {
|
|||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_NOT_ACTIVE_VNODE);
|
||||
return;
|
||||
}
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_SUCCESS);
|
||||
|
||||
|
@ -711,7 +749,7 @@ void mgmtDropAllVgroups(SDbObj *pDropDb) {
|
|||
SVgObj *pVgroup = NULL;
|
||||
|
||||
while (1) {
|
||||
mgmtReleaseVgroup(pVgroup);
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
pNode = sdbFetchRow(tsVgroupSdb, pNode, (void **)&pVgroup);
|
||||
if (pVgroup == NULL) break;
|
||||
|
||||
|
|
|
@ -397,6 +397,7 @@ void monitorSaveAcctLog(char *acctId, int64_t currentPointsPerSecond, int64_t ma
|
|||
int64_t totalOutbound, int64_t maxOutbound, int64_t totalDbs, int64_t maxDbs,
|
||||
int64_t totalUsers, int64_t maxUsers, int64_t totalStreams, int64_t maxStreams,
|
||||
int64_t totalConns, int64_t maxConns, int8_t accessState) {
|
||||
if (monitor == NULL) return;
|
||||
if (monitor->state != MONITOR_STATE_INITIALIZED) return;
|
||||
|
||||
char sql[1024] = {0};
|
||||
|
|
|
@ -21,21 +21,21 @@ static void initSchema(SSchema *pSchema, int32_t numOfCols);
|
|||
|
||||
static void initSchema_binary(SSchema *schema, int32_t numOfCols);
|
||||
|
||||
static tSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags);
|
||||
static tSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags);
|
||||
static SSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags);
|
||||
static SSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags);
|
||||
|
||||
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, tSkipList *pSkipList, ResultObj *expectedVal);
|
||||
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, SSkipList *pSkipList, ResultObj *expectedVal);
|
||||
|
||||
static void dropMeter(tSkipList *pSkipList);
|
||||
static void dropMeter(SSkipList *pSkipList);
|
||||
|
||||
static void Right2LeftTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList);
|
||||
static void Right2LeftTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
|
||||
|
||||
static void Left2RightTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList);
|
||||
static void Left2RightTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
|
||||
|
||||
static void IllegalExprTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList);
|
||||
static void IllegalExprTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
|
||||
|
||||
static void Left2RightTest_binary(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList);
|
||||
static void Right2LeftTest_binary(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList);
|
||||
static void Left2RightTest_binary(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
|
||||
static void Right2LeftTest_binary(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
|
||||
|
||||
void setValue(ResultObj *pResult, int32_t num, char **val) {
|
||||
pResult->numOfResult = num;
|
||||
|
@ -112,7 +112,7 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
strcpy(schema[7].name, "h");
|
||||
}
|
||||
|
||||
// static void addOneNode(SSchema *pSchema, int32_t tagsLen, tSkipList *pSkipList,
|
||||
// static void addOneNode(SSchema *pSchema, int32_t tagsLen, SSkipList *pSkipList,
|
||||
// char *meterId, int32_t a, double b, char *c, int64_t d, int16_t e, int8_t f, float g,
|
||||
// bool h, int32_t numOfTags) {
|
||||
// STabObj *pMeter = calloc(1, sizeof(STabObj));
|
||||
|
@ -146,11 +146,11 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
// offset += pSchema[6].bytes;
|
||||
// *(int8_t *) (tags + offset) = h ? 1 : 0;
|
||||
//
|
||||
// tSkipListKey pKey = tSkipListCreateKey(pSchema[0].type, tags, pSchema[0].bytes);
|
||||
// tSkipListPut(pSkipList, pMeter, &pKey, 1);
|
||||
// SSkipListKey pKey = SSkipListCreateKey(pSchema[0].type, tags, pSchema[0].bytes);
|
||||
// SSkipListPut(pSkipList, pMeter, &pKey, 1);
|
||||
//}
|
||||
//
|
||||
// static void addOneNode_binary(SSchema *pSchema, int32_t tagsLen, tSkipList *pSkipList,
|
||||
// static void addOneNode_binary(SSchema *pSchema, int32_t tagsLen, SSkipList *pSkipList,
|
||||
// char *meterId, int32_t a, double b, char *c, int64_t d, int16_t e, int8_t f, float g,
|
||||
// bool h, int32_t numOfTags) {
|
||||
// STabObj *pMeter = calloc(1, sizeof(STabObj));
|
||||
|
@ -183,16 +183,16 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
// offset += pSchema[6].bytes;
|
||||
// *(int8_t *) (tags + offset) = h ? 1 : 0;
|
||||
//
|
||||
// tSkipListKey pKey = tSkipListCreateKey(pSchema[0].type, tags, pSchema[0].bytes);
|
||||
// tSkipListPut(pSkipList, pMeter, &pKey, 1);
|
||||
// tSkipListDestroyKey(&pKey);
|
||||
// SSkipListKey pKey = SSkipListCreateKey(pSchema[0].type, tags, pSchema[0].bytes);
|
||||
// SSkipListPut(pSkipList, pMeter, &pKey, 1);
|
||||
// SSkipListDestroyKey(&pKey);
|
||||
//}
|
||||
|
||||
// static void dropMeter(tSkipList *pSkipList) {
|
||||
// tSkipListNode **pRes = NULL;
|
||||
// int32_t num = tSkipListIterateList(pSkipList, &pRes, NULL, NULL);
|
||||
// static void dropMeter(SSkipList *pSkipList) {
|
||||
// SSkipListNode **pRes = NULL;
|
||||
// int32_t num = SSkipListIterateList(pSkipList, &pRes, NULL, NULL);
|
||||
// for (int32_t i = 0; i < num; ++i) {
|
||||
// tSkipListNode *pNode = pRes[i];
|
||||
// SSkipListNode *pNode = pRes[i];
|
||||
// STabObj *pMeter = (STabObj *) pNode->pData;
|
||||
// free(pMeter->pTagData);
|
||||
// free(pMeter);
|
||||
|
@ -201,13 +201,13 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
// free(pRes);
|
||||
//}
|
||||
|
||||
// static tSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags) {
|
||||
// static SSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags) {
|
||||
// int32_t tagsLen = 0;
|
||||
// for (int32_t i = 0; i < numOfTags; ++i) {
|
||||
// tagsLen += pSchema[i].bytes;
|
||||
// }
|
||||
//
|
||||
// tSkipList *pSkipList = tSkipListCreate(10, pSchema[0].type, 4);
|
||||
// SSkipList *pSkipList = SSkipListCreate(10, pSchema[0].type, 4);
|
||||
//
|
||||
// addOneNode(pSchema, tagsLen, pSkipList, "tm0\0", 0, 10.5, "abc", 1000, -10000, -20, 1.0, true, 8);
|
||||
// addOneNode(pSchema, tagsLen, pSkipList, "tm1\0", 1, 20.5, "def", 1100, -10500, -30, 2.0, false, 8);
|
||||
|
@ -220,13 +220,13 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
// return pSkipList;
|
||||
//}
|
||||
//
|
||||
// static tSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags) {
|
||||
// static SSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags) {
|
||||
// int32_t tagsLen = 0;
|
||||
// for (int32_t i = 0; i < numOfTags; ++i) {
|
||||
// tagsLen += pSchema[i].bytes;
|
||||
// }
|
||||
//
|
||||
// tSkipList *pSkipList = tSkipListCreate(10, pSchema[0].type, 4);
|
||||
// SSkipList *pSkipList = SSkipListCreate(10, pSchema[0].type, 4);
|
||||
//
|
||||
// addOneNode_binary(pSchema, tagsLen, pSkipList, "tm0\0", 0, 10.5, "abc", 1000, -10000, -20, 1.0, true, 8);
|
||||
// addOneNode_binary(pSchema, tagsLen, pSkipList, "tm1\0", 1, 20.5, "def", 1100, -10500, -30, 2.0, false, 8);
|
||||
|
@ -239,7 +239,7 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
|
|||
// return pSkipList;
|
||||
//}
|
||||
|
||||
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, tSkipList *pSkipList, ResultObj *pResult) {
|
||||
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, SSkipList *pSkipList, ResultObj *pResult) {
|
||||
tExprNode *pExpr = NULL;
|
||||
tSQLBinaryExprFromString(&pExpr, schema, numOfCols, sql, strlen(sql));
|
||||
|
||||
|
@ -255,7 +255,7 @@ static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, tSkipLis
|
|||
printf("expr is: %s\n", str);
|
||||
|
||||
SArray *result = NULL;
|
||||
// tExprTreeTraverse(pExpr, pSkipList, result, tSkipListNodeFilterCallback, &result);
|
||||
// tExprTreeTraverse(pExpr, pSkipList, result, SSkipListNodeFilterCallback, &result);
|
||||
// printf("the result is:%lld\n", result.num);
|
||||
//
|
||||
// bool findResult = false;
|
||||
|
@ -277,7 +277,7 @@ static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, tSkipLis
|
|||
tExprTreeDestroy(&pExpr, NULL);
|
||||
}
|
||||
|
||||
static void Left2RightTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
||||
static void Left2RightTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
|
||||
char str[256] = {0};
|
||||
|
||||
char *t0[1] = {"tm0"};
|
||||
|
@ -342,7 +342,7 @@ static void Left2RightTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipL
|
|||
testQueryStr(schema, numOfCols, "f > -65", pSkipList, &res);
|
||||
}
|
||||
|
||||
void Right2LeftTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
||||
void Right2LeftTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
|
||||
ResultObj res = {1, {"tm1"}};
|
||||
testQueryStr(schema, numOfCols, "((1=a))", pSkipList, &res);
|
||||
|
||||
|
@ -359,7 +359,7 @@ void Right2LeftTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
|||
testQueryStr(schema, numOfCols, "0=h", pSkipList, &res);
|
||||
}
|
||||
|
||||
static void IllegalExprTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
||||
static void IllegalExprTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
|
||||
testQueryStr(schema, numOfCols, "h=", pSkipList, NULL);
|
||||
testQueryStr(schema, numOfCols, "h<", pSkipList, NULL);
|
||||
testQueryStr(schema, numOfCols, "a=1 and ", pSkipList, NULL);
|
||||
|
@ -374,7 +374,7 @@ static void IllegalExprTest(SSchema *schema, int32_t numOfCols, tSkipList *pSkip
|
|||
testQueryStr(schema, numOfCols, "a=1 and ", pSkipList, NULL);
|
||||
}
|
||||
|
||||
static void Left2RightTest_binary(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
||||
static void Left2RightTest_binary(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
|
||||
char str[256] = {0};
|
||||
char *sql = NULL;
|
||||
|
||||
|
@ -432,7 +432,7 @@ static void Left2RightTest_binary(SSchema *schema, int32_t numOfCols, tSkipList
|
|||
testQueryStr(schema, numOfCols, sql, pSkipList, &res);
|
||||
}
|
||||
|
||||
static void Right2LeftTest_binary(SSchema *schema, int32_t numOfCols, tSkipList *pSkipList) {
|
||||
static void Right2LeftTest_binary(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
|
||||
char str[256] = {0};
|
||||
char *sql = NULL;
|
||||
|
||||
|
|
|
@ -466,8 +466,8 @@ static void taosFreeFdObj(SFdObj *pFdObj) {
|
|||
}
|
||||
|
||||
pFdObj->signature = NULL;
|
||||
close(pFdObj->fd);
|
||||
epoll_ctl(pThreadObj->pollFd, EPOLL_CTL_DEL, pFdObj->fd, NULL);
|
||||
close(pFdObj->fd);
|
||||
|
||||
pThreadObj->numOfFds--;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#define IS_VALID_COMPRESSION(compression) (((compression) >= NO_COMPRESSION) && ((compression) <= TWO_STAGE_COMP))
|
||||
#define TSDB_MIN_ID 0
|
||||
#define TSDB_MAX_ID INT_MAX
|
||||
#define TSDB_MIN_TABLES 10
|
||||
#define TSDB_MIN_TABLES 4
|
||||
#define TSDB_MAX_TABLES 100000
|
||||
#define TSDB_DEFAULT_TABLES 1000
|
||||
#define TSDB_DEFAULT_DAYS_PER_FILE 10
|
||||
|
@ -282,6 +282,8 @@ int32_t tsdbConfigRepo(TsdbRepoT *repo, STsdbCfg *pCfg) {
|
|||
|
||||
int32_t tsdbTriggerCommit(TsdbRepoT *repo) {
|
||||
STsdbRepo *pRepo = (STsdbRepo *)repo;
|
||||
|
||||
if (pRepo->appH.walCallBack) pRepo->appH.walCallBack(pRepo->appH.appH);
|
||||
|
||||
tsdbLockRepo(repo);
|
||||
if (pRepo->commit) {
|
||||
|
@ -387,7 +389,7 @@ int tsdbInitTableCfg(STableCfg *config, ETableType type, int64_t uid, int32_t ti
|
|||
config->superUid = TSDB_INVALID_SUPER_TABLE_ID;
|
||||
config->tableId.uid = uid;
|
||||
config->tableId.tid = tid;
|
||||
config->name = strdup("test1");
|
||||
config->name = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -854,8 +856,6 @@ static void *tsdbCommitData(void *arg) {
|
|||
SRWHelper whelper = {0};
|
||||
if (pCache->imem == NULL) return NULL;
|
||||
|
||||
if (pRepo->appH.walCallBack) pRepo->appH.walCallBack(pRepo->appH.appH);
|
||||
|
||||
// Create the iterator to read from cache
|
||||
SSkipListIterator **iters = tsdbCreateTableIters(pMeta, pCfg->maxTables);
|
||||
if (iters == NULL) {
|
||||
|
@ -880,6 +880,7 @@ static void *tsdbCommitData(void *arg) {
|
|||
_exit:
|
||||
tdFreeDataCols(pDataCols);
|
||||
tsdbDestroyTableIters(iters, pCfg->maxTables);
|
||||
tsdbDestroyHelper(&whelper);
|
||||
|
||||
tsdbLockRepo(arg);
|
||||
tdListMove(pCache->imem->list, pCache->pool.memPool);
|
||||
|
|
|
@ -403,6 +403,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) {
|
|||
} else {
|
||||
pHelper->pCompInfo->delimiter = TSDB_FILE_DELIMITER;
|
||||
pHelper->pCompInfo->uid = pHelper->tableInfo.uid;
|
||||
pHelper->pCompInfo->checksum = 0;
|
||||
ASSERT((pIdx->len - sizeof(SCompInfo) - sizeof(TSCKSUM)) % sizeof(SCompBlock) == 0);
|
||||
taosCalcChecksumAppend(0, (uint8_t *)pHelper->pCompInfo, pIdx->len);
|
||||
pIdx->offset = lseek(pHelper->files.nHeadF.fd, 0, SEEK_END);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "tdataformat.h"
|
||||
#include "tsdbMain.h"
|
||||
#include "tskiplist.h"
|
||||
|
||||
static double getCurTime() {
|
||||
struct timeval tv;
|
||||
|
@ -141,6 +142,7 @@ TEST(TsdbTest, createRepo) {
|
|||
STableCfg tCfg;
|
||||
ASSERT_EQ(tsdbInitTableCfg(&tCfg, TSDB_SUPER_TABLE, 987607499877672L, 0), -1);
|
||||
ASSERT_EQ(tsdbInitTableCfg(&tCfg, TSDB_NORMAL_TABLE, 987607499877672L, 0), 0);
|
||||
tsdbTableSetName(&tCfg, "test", false);
|
||||
|
||||
int nCols = 5;
|
||||
STSchema *schema = tdNewSchema(nCols);
|
||||
|
@ -167,7 +169,7 @@ TEST(TsdbTest, createRepo) {
|
|||
.sversion = tCfg.sversion,
|
||||
.startTime = 1584081000000,
|
||||
.interval = 1000,
|
||||
.totalRows = 5000000,
|
||||
.totalRows = 10000000,
|
||||
.rowsPerSubmit = 1,
|
||||
.pSchema = schema
|
||||
};
|
||||
|
@ -262,4 +264,47 @@ TEST(TsdbTest, DISABLED_createFileGroup) {
|
|||
// ASSERT_EQ(tsdbCreateFileGroup("/home/ubuntu/work/ttest/vnode0/data", 1820, &fGroup, 1000), 0);
|
||||
|
||||
int k = 0;
|
||||
}
|
||||
|
||||
static char *getTKey(const void *data) {
|
||||
return (char *)data;
|
||||
}
|
||||
|
||||
static void insertSkipList(bool isAscend) {
|
||||
TSKEY start_time = 1587393453000;
|
||||
TSKEY interval = 1000;
|
||||
|
||||
SSkipList *pList = tSkipListCreate(5, TSDB_DATA_TYPE_TIMESTAMP, sizeof(TSKEY), 0, 0, 1, getTKey);
|
||||
ASSERT_NE(pList, nullptr);
|
||||
|
||||
for (size_t i = 0; i < 20000000; i++)
|
||||
{
|
||||
TSKEY time = isAscend ? (start_time + i * interval) : (start_time - i * interval);
|
||||
int32_t level = 0;
|
||||
int32_t headSize = 0;
|
||||
|
||||
tSkipListNewNodeInfo(pList, &level, &headSize);
|
||||
SSkipListNode *pNode = (SSkipListNode *)malloc(headSize + sizeof(TSKEY));
|
||||
ASSERT_NE(pNode, nullptr);
|
||||
pNode->level = level;
|
||||
*(TSKEY *)((char *)pNode + headSize) = time;
|
||||
tSkipListPut(pList, pNode);
|
||||
}
|
||||
|
||||
tSkipListDestroy(pList);
|
||||
}
|
||||
|
||||
TEST(TsdbTest, DISABLED_testSkipList) {
|
||||
// TEST(TsdbTest, testSkipList) {
|
||||
double stime = getCurTime();
|
||||
insertSkipList(true);
|
||||
double etime = getCurTime();
|
||||
|
||||
printf("Time used to insert 100000000 records takes %f seconds\n", etime-stime);
|
||||
|
||||
stime = getCurTime();
|
||||
insertSkipList(false);
|
||||
etime = getCurTime();
|
||||
|
||||
printf("Time used to insert 100000000 records takes %f seconds\n", etime-stime);
|
||||
}
|
|
@ -170,6 +170,8 @@ char *taosIpStr(uint32_t ipInt);
|
|||
|
||||
uint32_t ip2uint(const char *const ip_addr);
|
||||
|
||||
void taosRemoveDir(char *rootDir);
|
||||
|
||||
#define TAOS_ALLOC_MODE_DEFAULT 0
|
||||
#define TAOS_ALLOC_MODE_RANDOM_FAIL 1
|
||||
#define TAOS_ALLOC_MODE_DETECT_LEAK 2
|
||||
|
|
|
@ -184,6 +184,7 @@ static void taosReadLogOption(char *option, char *value) {
|
|||
}
|
||||
|
||||
SGlobalCfg *taosGetConfigOption(const char *option) {
|
||||
taosInitGlobalCfg();
|
||||
for (int i = 0; i < tsGlobalConfigNum; ++i) {
|
||||
SGlobalCfg *cfg = tsGlobalConfig + i;
|
||||
if (strcasecmp(cfg->option, option) != 0) continue;
|
||||
|
|
|
@ -662,4 +662,28 @@ void tzfree(void *ptr) {
|
|||
if (ptr) {
|
||||
free((void *)((char *)ptr - sizeof(size_t)));
|
||||
}
|
||||
}
|
||||
|
||||
void taosRemoveDir(char *rootDir) {
|
||||
DIR *dir = opendir(rootDir);
|
||||
if (dir == NULL) return;
|
||||
|
||||
struct dirent *de = NULL;
|
||||
while ((de = readdir(dir)) != NULL) {
|
||||
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue;
|
||||
|
||||
char filename[1024];
|
||||
snprintf(filename, 1023, "%s/%s", rootDir, de->d_name);
|
||||
if (de->d_type & DT_DIR) {
|
||||
taosRemoveDir(filename);
|
||||
} else {
|
||||
remove(filename);
|
||||
uPrint("file:%s is removed", filename);
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
rmdir(rootDir);
|
||||
|
||||
uPrint("dir:%s is removed", rootDir);
|
||||
}
|
|
@ -11,5 +11,5 @@ IF (HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR)
|
|||
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
|
||||
|
||||
ADD_EXECUTABLE(utilTest ${SOURCE_LIST})
|
||||
TARGET_LINK_LIBRARIES(utilTest tutil gtest pthread)
|
||||
TARGET_LINK_LIBRARIES(utilTest tutil common gtest pthread)
|
||||
ENDIF()
|
|
@ -9,6 +9,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
|
|||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
|
||||
INCLUDE_DIRECTORIES(inc)
|
||||
AUX_SOURCE_DIRECTORY(src SRC)
|
||||
|
|
|
@ -18,10 +18,12 @@
|
|||
#include "ihash.h"
|
||||
#include "taoserror.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tutil.h"
|
||||
#include "trpc.h"
|
||||
#include "tsdb.h"
|
||||
#include "ttime.h"
|
||||
#include "ttimer.h"
|
||||
#include "cJSON.h"
|
||||
#include "twal.h"
|
||||
#include "tglobal.h"
|
||||
#include "dnode.h"
|
||||
|
@ -36,6 +38,8 @@ static void vnodeBuildVloadMsg(char *pNode, void * param);
|
|||
static int vnodeWalCallback(void *arg);
|
||||
static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg);
|
||||
static int32_t vnodeReadCfg(SVnodeObj *pVnode);
|
||||
static int32_t vnodeSaveVersion(SVnodeObj *pVnode);
|
||||
static int32_t vnodeReadVersion(SVnodeObj *pVnode);
|
||||
static int vnodeWalCallback(void *arg);
|
||||
static uint32_t vnodeGetFileInfo(void *ahandle, char *name, uint32_t *index, int32_t *size);
|
||||
static int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index);
|
||||
|
@ -49,6 +53,7 @@ int syncForwardToPeer(tsync_h shandle, void *pHead, void *mhandle) { return
|
|||
void syncStop(tsync_h shandle) {}
|
||||
int syncReconfig(tsync_h shandle, const SSyncCfg * cfg) { return 0; }
|
||||
int syncGetNodesRole(tsync_h shandle, SNodesRole * cfg) { return 0; }
|
||||
void syncConfirmForward(tsync_h shandle, uint64_t version, int32_t code) {}
|
||||
#endif
|
||||
|
||||
static void vnodeInit() {
|
||||
|
@ -92,21 +97,21 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
|
|||
|
||||
STsdbCfg tsdbCfg = {0};
|
||||
tsdbCfg.precision = pVnodeCfg->cfg.precision;
|
||||
tsdbCfg.compression = -1;
|
||||
tsdbCfg.compression = pVnodeCfg->cfg.compression;;
|
||||
tsdbCfg.tsdbId = pVnodeCfg->cfg.vgId;
|
||||
tsdbCfg.maxTables = pVnodeCfg->cfg.maxSessions;
|
||||
tsdbCfg.maxTables = pVnodeCfg->cfg.maxTables;
|
||||
tsdbCfg.daysPerFile = pVnodeCfg->cfg.daysPerFile;
|
||||
tsdbCfg.minRowsPerFileBlock = -1;
|
||||
tsdbCfg.maxRowsPerFileBlock = -1;
|
||||
tsdbCfg.keep = -1;
|
||||
tsdbCfg.maxCacheSize = -1;
|
||||
tsdbCfg.minRowsPerFileBlock = pVnodeCfg->cfg.minRowsPerFileBlock;
|
||||
tsdbCfg.maxRowsPerFileBlock = pVnodeCfg->cfg.maxRowsPerFileBlock;
|
||||
tsdbCfg.keep = pVnodeCfg->cfg.daysToKeep;
|
||||
tsdbCfg.maxCacheSize = pVnodeCfg->cfg.maxCacheSize;
|
||||
|
||||
char tsdbDir[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId);
|
||||
code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
dError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(terrno));
|
||||
return terrno;
|
||||
dError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code));
|
||||
return TSDB_CODE_VG_INIT_FAILED;
|
||||
}
|
||||
|
||||
dPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.commitLog);
|
||||
|
@ -130,6 +135,39 @@ int32_t vnodeDrop(int32_t vgId) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) {
|
||||
SVnodeObj *pVnode = param;
|
||||
int32_t code = vnodeSaveCfg(pVnodeCfg);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
dError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = vnodeReadCfg(pVnode);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
dError("pVnode:%p vgId:%d, failed to read cfg file", pVnode, pVnode->vgId);
|
||||
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
|
||||
return code;
|
||||
}
|
||||
|
||||
code = syncReconfig(pVnode->sync, &pVnode->syncCfg);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig sync, result:%s", pVnode, pVnode->vgId,
|
||||
tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = tsdbConfigRepo(pVnode->tsdb, &pVnode->tsdbCfg);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig tsdb, result:%s", pVnode, pVnode->vgId,
|
||||
tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
dTrace("pVnode:%p vgId:%d, vnode is altered", pVnode, pVnode->vgId);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
||||
char temp[TSDB_FILENAME_LEN];
|
||||
pthread_once(&vnodeModuleInit, vnodeInit);
|
||||
|
@ -148,11 +186,13 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
return code;
|
||||
}
|
||||
|
||||
vnodeReadVersion(pVnode);
|
||||
|
||||
pVnode->wqueue = dnodeAllocateWqueue(pVnode);
|
||||
pVnode->rqueue = dnodeAllocateRqueue(pVnode);
|
||||
|
||||
sprintf(temp, "%s/wal", rootDir);
|
||||
pVnode->wal = walOpen(temp, &pVnode->walCfg);
|
||||
pVnode->wal = walOpen(temp, &pVnode->walCfg);
|
||||
|
||||
SSyncInfo syncInfo;
|
||||
syncInfo.vgId = pVnode->vgId;
|
||||
|
@ -165,10 +205,10 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
syncInfo.writeToCache = vnodeWriteToQueue;
|
||||
syncInfo.confirmForward = dnodeSendRpcWriteRsp;
|
||||
syncInfo.notifyRole = vnodeNotifyRole;
|
||||
pVnode->sync = syncStart(&syncInfo);
|
||||
pVnode->sync = syncStart(&syncInfo);
|
||||
|
||||
pVnode->events = NULL;
|
||||
pVnode->cq = NULL;
|
||||
pVnode->events = NULL;
|
||||
pVnode->cq = NULL;
|
||||
|
||||
STsdbAppH appH = {0};
|
||||
appH.appH = (void *)pVnode;
|
||||
|
@ -226,7 +266,9 @@ void vnodeRelease(void *pVnodeRaw) {
|
|||
pVnode->wqueue = NULL;
|
||||
|
||||
if (pVnode->status == TAOS_VN_STATUS_DELETING) {
|
||||
// remove the whole directory
|
||||
char rootDir[TSDB_FILENAME_LEN] = {0};
|
||||
sprintf(rootDir, "%s/vnode%d", tsVnodeDir, vgId);
|
||||
taosRemoveDir(rootDir);
|
||||
}
|
||||
|
||||
free(pVnode);
|
||||
|
@ -245,7 +287,8 @@ void *vnodeGetVnode(int32_t vgId) {
|
|||
SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
|
||||
if (ppVnode == NULL || *ppVnode == NULL) {
|
||||
terrno = TSDB_CODE_INVALID_VGROUP_ID;
|
||||
assert(false);
|
||||
dError("vgId:%d not exist");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return *ppVnode;
|
||||
|
@ -291,6 +334,7 @@ static void vnodeBuildVloadMsg(char *pNode, void * param) {
|
|||
pLoad->vgId = htonl(pVnode->vgId);
|
||||
pLoad->status = pVnode->status;
|
||||
pLoad->role = pVnode->role;
|
||||
pLoad->replica = pVnode->syncCfg.replica;
|
||||
}
|
||||
|
||||
static void vnodeCleanUp(SVnodeObj *pVnode) {
|
||||
|
@ -300,6 +344,7 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
|
|||
//syncStop(pVnode->sync);
|
||||
tsdbCloseRepo(pVnode->tsdb);
|
||||
walClose(pVnode->wal);
|
||||
vnodeSaveVersion(pVnode);
|
||||
|
||||
vnodeRelease(pVnode);
|
||||
}
|
||||
|
@ -327,88 +372,306 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
|
|||
}
|
||||
|
||||
static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) {
|
||||
char cfgFile[TSDB_FILENAME_LEN * 2] = {0};
|
||||
sprintf(cfgFile, "%s/vnode%d/config", tsVnodeDir, pVnodeCfg->cfg.vgId);
|
||||
|
||||
char cfgFile[TSDB_FILENAME_LEN + 30] = {0};
|
||||
sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnodeCfg->cfg.vgId);
|
||||
FILE *fp = fopen(cfgFile, "w");
|
||||
if (!fp) return errno;
|
||||
|
||||
fprintf(fp, "commitLog %d\n", pVnodeCfg->cfg.commitLog);
|
||||
fprintf(fp, "wals %d\n", 3);
|
||||
fprintf(fp, "arbitratorIp %d\n", pVnodeCfg->vpeerDesc[0].ip);
|
||||
fprintf(fp, "quorum %d\n", 1);
|
||||
fprintf(fp, "replica %d\n", pVnodeCfg->cfg.replications);
|
||||
for (int32_t i = 0; i < pVnodeCfg->cfg.replications; i++) {
|
||||
fprintf(fp, "index%d nodeId %d nodeIp %u name n%d\n", i, pVnodeCfg->vpeerDesc[i].dnodeId, pVnodeCfg->vpeerDesc[i].ip, pVnodeCfg->vpeerDesc[i].dnodeId);
|
||||
if (!fp) {
|
||||
dError("vgId:%d, failed to open vnode cfg file for write, error:%s", pVnodeCfg->cfg.vgId, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
dTrace("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId);
|
||||
char ipStr[20];
|
||||
int32_t len = 0;
|
||||
int32_t maxLen = 1000;
|
||||
char * content = calloc(1, maxLen + 1);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
len += snprintf(content + len, maxLen - len, "{\n");
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"precision\": %d,\n", pVnodeCfg->cfg.precision);
|
||||
len += snprintf(content + len, maxLen - len, " \"compression\": %d,\n", pVnodeCfg->cfg.compression);
|
||||
len += snprintf(content + len, maxLen - len, " \"maxTables\": %d,\n", pVnodeCfg->cfg.maxTables);
|
||||
len += snprintf(content + len, maxLen - len, " \"daysPerFile\": %d,\n", pVnodeCfg->cfg.daysPerFile);
|
||||
len += snprintf(content + len, maxLen - len, " \"minRowsPerFileBlock\": %d,\n", pVnodeCfg->cfg.minRowsPerFileBlock);
|
||||
len += snprintf(content + len, maxLen - len, " \"maxRowsPerFileBlock\": %d,\n", pVnodeCfg->cfg.maxRowsPerFileBlock);
|
||||
len += snprintf(content + len, maxLen - len, " \"daysToKeep\": %d,\n", pVnodeCfg->cfg.daysToKeep);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"maxCacheSize\": %" PRId64 ",\n", pVnodeCfg->cfg.maxCacheSize);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"commitLog\": %d,\n", pVnodeCfg->cfg.commitLog);
|
||||
len += snprintf(content + len, maxLen - len, " \"wals\": %d,\n", pVnodeCfg->cfg.wals);
|
||||
|
||||
uint32_t ipInt = pVnodeCfg->cfg.arbitratorIp;
|
||||
sprintf(ipStr, "%u.%u.%u.%u", ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, (uint8_t)(ipInt >> 24));
|
||||
len += snprintf(content + len, maxLen - len, " \"arbitratorIp\": \"%s\",\n", ipStr);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"quorum\": %d,\n", pVnodeCfg->cfg.quorum);
|
||||
len += snprintf(content + len, maxLen - len, " \"replica\": %d,\n", pVnodeCfg->cfg.replications);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n");
|
||||
for (int32_t i = 0; i < pVnodeCfg->cfg.replications; i++) {
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", pVnodeCfg->nodes[i].nodeId);
|
||||
|
||||
uint32_t ipInt = pVnodeCfg->nodes[i].nodeIp;
|
||||
sprintf(ipStr, "%u.%u.%u.%u", ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, (uint8_t)(ipInt >> 24));
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeIp\": \"%s\",\n", ipStr);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, " \"nodeName\": \"%s\"\n", pVnodeCfg->nodes[i].nodeName);
|
||||
|
||||
if (i < pVnodeCfg->cfg.replications - 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("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO: this is a simple implement
|
||||
static int32_t vnodeReadCfg(SVnodeObj *pVnode) {
|
||||
char option[5][16] = {0};
|
||||
char cfgFile[TSDB_FILENAME_LEN * 2] = {0};
|
||||
sprintf(cfgFile, "%s/vnode%d/config", tsVnodeDir, pVnode->vgId);
|
||||
|
||||
char cfgFile[TSDB_FILENAME_LEN + 30] = {0};
|
||||
sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId);
|
||||
FILE *fp = fopen(cfgFile, "r");
|
||||
if (!fp) return errno;
|
||||
if (!fp) {
|
||||
dError("pVnode:%p vgId:%d, failed to open vnode cfg file for read, error:%s", pVnode, pVnode->vgId, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
|
||||
int32_t commitLog = -1;
|
||||
int32_t num = fscanf(fp, "%s %d", option[0], &commitLog);
|
||||
if (num != 2) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[0], "commitLog") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (commitLog == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->walCfg.commitLog = (int8_t)commitLog;
|
||||
int ret = TSDB_CODE_OTHERS;
|
||||
int maxLen = 1000;
|
||||
char *content = calloc(1, maxLen + 1);
|
||||
int len = fread(content, 1, maxLen, fp);
|
||||
if (len <= 0) {
|
||||
free(content);
|
||||
fclose(fp);
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, content is null", pVnode, pVnode->vgId);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t wals = -1;
|
||||
num = fscanf(fp, "%s %d", option[0], &wals);
|
||||
if (num != 2) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[0], "wals") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (wals == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->walCfg.wals = (int8_t)wals;
|
||||
cJSON *root = cJSON_Parse(content);
|
||||
if (root == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, invalid json format", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
||||
cJSON *precision = cJSON_GetObjectItem(root, "precision");
|
||||
if (!precision || precision->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, precision not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.precision = (int8_t)precision->valueint;
|
||||
|
||||
cJSON *compression = cJSON_GetObjectItem(root, "compression");
|
||||
if (!compression || compression->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, compression not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.compression = (int8_t)compression->valueint;
|
||||
|
||||
cJSON *maxTables = cJSON_GetObjectItem(root, "maxTables");
|
||||
if (!maxTables || maxTables->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxTables not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.maxTables = maxTables->valueint;
|
||||
|
||||
cJSON *daysPerFile = cJSON_GetObjectItem(root, "daysPerFile");
|
||||
if (!daysPerFile || daysPerFile->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysPerFile not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.daysPerFile = daysPerFile->valueint;
|
||||
|
||||
cJSON *minRowsPerFileBlock = cJSON_GetObjectItem(root, "minRowsPerFileBlock");
|
||||
if (!minRowsPerFileBlock || minRowsPerFileBlock->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, minRowsPerFileBlock not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.minRowsPerFileBlock = minRowsPerFileBlock->valueint;
|
||||
|
||||
cJSON *maxRowsPerFileBlock = cJSON_GetObjectItem(root, "maxRowsPerFileBlock");
|
||||
if (!maxRowsPerFileBlock || maxRowsPerFileBlock->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxRowsPerFileBlock not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.maxRowsPerFileBlock = maxRowsPerFileBlock->valueint;
|
||||
|
||||
cJSON *daysToKeep = cJSON_GetObjectItem(root, "daysToKeep");
|
||||
if (!daysToKeep || daysToKeep->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.keep = daysToKeep->valueint;
|
||||
|
||||
cJSON *maxCacheSize = cJSON_GetObjectItem(root, "maxCacheSize");
|
||||
if (!maxCacheSize || maxCacheSize->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxCacheSize not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->tsdbCfg.maxCacheSize = maxCacheSize->valueint;
|
||||
|
||||
cJSON *commitLog = cJSON_GetObjectItem(root, "commitLog");
|
||||
if (!commitLog || commitLog->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, commitLog not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->walCfg.commitLog = (int8_t)commitLog->valueint;
|
||||
|
||||
cJSON *wals = cJSON_GetObjectItem(root, "wals");
|
||||
if (!wals || wals->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, wals not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->walCfg.wals = (int8_t)wals->valueint;
|
||||
pVnode->walCfg.keep = 0;
|
||||
|
||||
int32_t arbitratorIp = -1;
|
||||
num = fscanf(fp, "%s %u", option[0], &arbitratorIp);
|
||||
if (num != 2) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[0], "arbitratorIp") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (arbitratorIp == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->syncCfg.arbitratorIp = arbitratorIp;
|
||||
cJSON *arbitratorIp = cJSON_GetObjectItem(root, "arbitratorIp");
|
||||
if (!arbitratorIp || arbitratorIp->type != cJSON_String || arbitratorIp->valuestring == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, arbitratorIp not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->syncCfg.arbitratorIp = inet_addr(arbitratorIp->valuestring);
|
||||
|
||||
int32_t quorum = -1;
|
||||
num = fscanf(fp, "%s %d", option[0], &quorum);
|
||||
if (num != 2) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[0], "quorum") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (quorum == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->syncCfg.quorum = (int8_t)quorum;
|
||||
cJSON *quorum = cJSON_GetObjectItem(root, "quorum");
|
||||
if (!quorum || quorum->type != cJSON_Number) {
|
||||
dError("failed to read vnode cfg, quorum not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->syncCfg.quorum = (int8_t)quorum->valueint;
|
||||
|
||||
int32_t replica = -1;
|
||||
num = fscanf(fp, "%s %d", option[0], &replica);
|
||||
if (num != 2) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[0], "replica") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (replica == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->syncCfg.replica = (int8_t)replica;
|
||||
cJSON *replica = cJSON_GetObjectItem(root, "replica");
|
||||
if (!replica || replica->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, replica not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->syncCfg.replica = (int8_t)replica->valueint;
|
||||
|
||||
for (int32_t i = 0; i < replica; ++i) {
|
||||
int32_t dnodeId = -1;
|
||||
uint32_t dnodeIp = -1;
|
||||
num = fscanf(fp, "%s %s %d %s %u %s %s", option[0], option[1], &dnodeId, option[2], &dnodeIp, option[3], pVnode->syncCfg.nodeInfo[i].name);
|
||||
if (num != 7) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[1], "nodeId") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[2], "nodeIp") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (strcmp(option[3], "name") != 0) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (dnodeId == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
if (dnodeIp == -1) return TSDB_CODE_INVALID_FILE_FORMAT;
|
||||
pVnode->syncCfg.nodeInfo[i].nodeId = dnodeId;
|
||||
pVnode->syncCfg.nodeInfo[i].nodeIp = dnodeIp;
|
||||
cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos");
|
||||
if (!nodeInfos || nodeInfos->type != cJSON_Array) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
dTrace("pVnode:%p vgId:%d, read vnode cfg successed", pVnode, pVnode->vgId);
|
||||
int size = cJSON_GetArraySize(nodeInfos);
|
||||
if (size != pVnode->syncCfg.replica) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos size not matched", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
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("pVnode:%p vgId:%d, failed to read vnode cfg, nodeId not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->syncCfg.nodeInfo[i].nodeId = nodeId->valueint;
|
||||
|
||||
cJSON *nodeIp = cJSON_GetObjectItem(nodeInfo, "nodeIp");
|
||||
if (!nodeIp || nodeIp->type != cJSON_String || nodeIp->valuestring == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeIp not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->syncCfg.nodeInfo[i].nodeIp = inet_addr(nodeIp->valuestring);
|
||||
|
||||
cJSON *nodeName = cJSON_GetObjectItem(nodeInfo, "nodeName");
|
||||
if (!nodeName || nodeName->type != cJSON_String || nodeName->valuestring == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeName not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
strncpy(pVnode->syncCfg.nodeInfo[i].name, nodeName->valuestring, TSDB_NODE_NAME_LEN);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
dPrint("pVnode:%p vgId:%d, read vnode cfg successed, replcia:%d", pVnode, pVnode->vgId, pVnode->syncCfg.replica);
|
||||
for (int32_t i = 0; i < pVnode->syncCfg.replica; i++) {
|
||||
dPrint("pVnode:%p vgId:%d, dnode:%d, ip:%s name:%s", pVnode, pVnode->vgId, pVnode->syncCfg.nodeInfo[i].nodeId,
|
||||
taosIpStr(pVnode->syncCfg.nodeInfo[i].nodeIp), pVnode->syncCfg.nodeInfo[i].name);
|
||||
}
|
||||
|
||||
PARSE_OVER:
|
||||
free(content);
|
||||
cJSON_Delete(root);
|
||||
fclose(fp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int32_t vnodeSaveVersion(SVnodeObj *pVnode) {
|
||||
char versionFile[TSDB_FILENAME_LEN + 30] = {0};
|
||||
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
|
||||
FILE *fp = fopen(versionFile, "w");
|
||||
if (!fp) {
|
||||
dError("pVnode:%p vgId:%d, failed to open vnode version file for write, error:%s", pVnode, pVnode->vgId);
|
||||
return errno;
|
||||
}
|
||||
|
||||
int32_t len = 0;
|
||||
int32_t maxLen = 30;
|
||||
char * content = calloc(1, maxLen + 1);
|
||||
|
||||
len += snprintf(content + len, maxLen - len, "{\n");
|
||||
len += snprintf(content + len, maxLen - len, " \"version\": %" PRId64 "\n", pVnode->version);
|
||||
len += snprintf(content + len, maxLen - len, "}\n");
|
||||
|
||||
fwrite(content, 1, len, fp);
|
||||
fclose(fp);
|
||||
free(content);
|
||||
|
||||
dPrint("pVnode:%p vgId:%d, save vnode version successed", pVnode, pVnode->vgId);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t vnodeReadVersion(SVnodeObj *pVnode) {
|
||||
char versionFile[TSDB_FILENAME_LEN + 30] = {0};
|
||||
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
|
||||
FILE *fp = fopen(versionFile, "w");
|
||||
if (!fp) {
|
||||
dError("pVnode:%p vgId:%d, failed to open vnode version file for write, error:%s", pVnode, pVnode->vgId);
|
||||
return errno;
|
||||
}
|
||||
|
||||
int ret = TSDB_CODE_OTHERS;
|
||||
int maxLen = 100;
|
||||
char *content = calloc(1, maxLen + 1);
|
||||
int len = fread(content, 1, maxLen, fp);
|
||||
if (len <= 0) {
|
||||
free(content);
|
||||
fclose(fp);
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode version, content is null", pVnode, pVnode->vgId);
|
||||
return false;
|
||||
}
|
||||
|
||||
cJSON *root = cJSON_Parse(content);
|
||||
if (root == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode version, invalid json format", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
|
||||
cJSON *version = cJSON_GetObjectItem(root, "version");
|
||||
if (!version || version->type != cJSON_Number) {
|
||||
dError("pVnode:%p vgId:%d, failed to read vnode version, version not found", pVnode, pVnode->vgId);
|
||||
goto PARSE_OVER;
|
||||
}
|
||||
pVnode->version = version->valueint;
|
||||
|
||||
ret = 0;
|
||||
|
||||
dPrint("pVnode:%p vgId:%d, read vnode version successed, version:%%" PRId64, pVnode, pVnode->vgId, pVnode->version);
|
||||
|
||||
PARSE_OVER:
|
||||
free(content);
|
||||
cJSON_Delete(root);
|
||||
fclose(fp);
|
||||
return ret;
|
||||
}
|
|
@ -17,6 +17,7 @@ from util.log import *
|
|||
from util.cases import *
|
||||
from util.sql import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
|
@ -24,25 +25,24 @@ class TDTestCase:
|
|||
|
||||
def run(self):
|
||||
tdSql.prepare()
|
||||
tdSql.execute('show databases')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdSql.execute('create table tb (ts timestamp, speed int)')
|
||||
|
||||
ret = tdSql.execute('create table tb (ts timestamp, speed int)')
|
||||
|
||||
insertRows = 10
|
||||
tdLog.info("insert %d rows" % (insertRows))
|
||||
for i in range(0, insertRows):
|
||||
tdSql.execute('insert into tb values (now + %dm, %d)' % (i, i))
|
||||
ret = tdSql.execute(
|
||||
'insert into tb values (now + %dm, %d)' %
|
||||
(i, i))
|
||||
|
||||
# tdLog.info("insert earlier data")
|
||||
# tdSql.execute('insert into tb values (now - 5m , 10)')
|
||||
# tdSql.execute('insert into tb values (now - 6m , 10)')
|
||||
# tdSql.execute('insert into tb values (now - 7m , 10)')
|
||||
# tdSql.execute('insert into tb values (now - 8m , 10)')
|
||||
tdLog.info("insert earlier data")
|
||||
tdSql.execute('insert into tb values (now - 5m , 10)')
|
||||
tdSql.execute('insert into tb values (now - 6m , 10)')
|
||||
tdSql.execute('insert into tb values (now - 7m , 10)')
|
||||
tdSql.execute('insert into tb values (now - 8m , 10)')
|
||||
|
||||
tdSql.query("select * from tb")
|
||||
tdSql.checkRows(insertRows)
|
||||
tdSql.checkRows(insertRows + 4)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
sudo python ./test.py -f insert/basic.py
|
||||
#!/bin/bash
|
||||
python3 ./test.py -f insert/basic.py $1
|
||||
python3 ./test.py -s $1
|
||||
|
|
|
@ -15,22 +15,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import getopt
|
||||
import subprocess
|
||||
from distutils.log import warn as printf
|
||||
|
||||
from util.log import *
|
||||
from util.dnodes import *
|
||||
from util.cases import *
|
||||
|
||||
import taos
|
||||
|
||||
# add testcase here:
|
||||
from insert.basic import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
fileName = "all"
|
||||
deployPath = ""
|
||||
masterIp = ""
|
||||
testCluster = False
|
||||
opts, args = getopt.getopt(sys.argv[1:], 'f:p:m:sch', [
|
||||
'file=', 'path=', 'master', 'stop', 'cluster', 'help'])
|
||||
valgrind = 0
|
||||
stop = 0
|
||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:scgh', [
|
||||
'file=', 'path=', 'master', 'stop', 'cluster', 'valgrind', 'help'])
|
||||
for key, value in opts:
|
||||
if key in ['-h', '--help']:
|
||||
tdLog.printNoPrefix(
|
||||
|
@ -41,21 +44,50 @@ if __name__ == "__main__":
|
|||
tdLog.printNoPrefix('-c Test Cluster Flag')
|
||||
tdLog.printNoPrefix('-s stop All dnodes')
|
||||
sys.exit(0)
|
||||
|
||||
if key in ['-f', '--file']:
|
||||
fileName = value
|
||||
|
||||
if key in ['-p', '--path']:
|
||||
deployPath = value
|
||||
|
||||
if key in ['-m', '--master']:
|
||||
masterIp = value
|
||||
|
||||
if key in ['-c', '--cluster']:
|
||||
testCluster = True
|
||||
|
||||
if key in ['-g', '--valgrind']:
|
||||
valgrind = 1
|
||||
|
||||
if key in ['-s', '--stop']:
|
||||
cmd = "ps -ef|grep -w taosd | grep 'taosd' | grep -v grep | awk '{print $2}' && pkill -9 taosd"
|
||||
os.system(cmd)
|
||||
tdLog.exit('stop All dnodes')
|
||||
stop = 1
|
||||
|
||||
if (stop != 0):
|
||||
if (valgrind == 0):
|
||||
toBeKilled = "taosd"
|
||||
else:
|
||||
toBeKilled = "valgrind.bin"
|
||||
|
||||
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -HUP " % toBeKilled
|
||||
# os.system(killCmd)
|
||||
# time.sleep(1)
|
||||
|
||||
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
|
||||
processID = subprocess.check_output(psCmd, shell=True)
|
||||
|
||||
while(processID):
|
||||
os.system(killCmd)
|
||||
time.sleep(1)
|
||||
processID = subprocess.check_output(psCmd, shell=True)
|
||||
|
||||
tdLog.exit('stop All dnodes')
|
||||
|
||||
if masterIp == "":
|
||||
tdDnodes.init(deployPath)
|
||||
tdDnodes.setTestCluster(testCluster)
|
||||
tdDnodes.setValgrind(valgrind)
|
||||
|
||||
if testCluster:
|
||||
tdLog.notice("Procedures for testing cluster")
|
||||
if fileName == "all":
|
||||
|
|
|
@ -15,6 +15,8 @@ import sys
|
|||
import os
|
||||
import time
|
||||
import datetime
|
||||
import inspect
|
||||
import importlib
|
||||
from util.log import *
|
||||
|
||||
|
||||
|
@ -30,6 +32,10 @@ class TDCases:
|
|||
self.windowsCases = []
|
||||
self.clusterCases = []
|
||||
|
||||
def __dynamicLoadModule(self, fileName):
|
||||
moduleName = fileName.replace(".py", "").replace("/", ".")
|
||||
return importlib.import_module(moduleName, package='..')
|
||||
|
||||
def addWindows(self, name, case):
|
||||
self.windowsCases.append(TDCase(name, case))
|
||||
|
||||
|
@ -40,64 +46,93 @@ class TDCases:
|
|||
self.clusterCases.append(TDCase(name, case))
|
||||
|
||||
def runAllLinux(self, conn):
|
||||
tdLog.notice("run total %d cases" % (len(self.linuxCases)))
|
||||
for case in self.linuxCases:
|
||||
case.case.init(conn)
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
tdLog.notice("total %d cases executed" % (len(self.linuxCases)))
|
||||
# TODO: load all Linux cases here
|
||||
runNum = 0
|
||||
for tmp in self.linuxCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
case = testModule.TDTestCase()
|
||||
case.init(conn)
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
continue
|
||||
|
||||
tdLog.notice("total %d Linux test case(s) executed" % (runNum))
|
||||
|
||||
def runOneLinux(self, conn, fileName):
|
||||
tdLog.notice("run cases like %s" % (fileName))
|
||||
testModule = self.__dynamicLoadModule(fileName)
|
||||
|
||||
runNum = 0
|
||||
for case in self.linuxCases:
|
||||
if case.name.find(fileName) != -1:
|
||||
case.case.init(conn)
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
time.sleep(5)
|
||||
for tmp in self.linuxCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
case = testModule.TDTestCase()
|
||||
case.init(conn)
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
tdLog.notice("total %d cases executed" % (runNum))
|
||||
continue
|
||||
|
||||
tdLog.notice("total %d Linux test case(s) executed" % (runNum))
|
||||
|
||||
def runAllWindows(self, conn):
|
||||
tdLog.notice("run total %d cases" % (len(self.windowsCases)))
|
||||
for case in self.windowsCases:
|
||||
case.case.init(conn)
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
tdLog.notice("total %d cases executed" % (len(self.windowsCases)))
|
||||
# TODO: load all Windows cases here
|
||||
runNum = 0
|
||||
for tmp in self.windowsCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
case = testModule.TDTestCase()
|
||||
case.init(conn)
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
continue
|
||||
|
||||
tdLog.notice("total %d Windows test case(s) executed" % (runNum))
|
||||
|
||||
def runOneWindows(self, conn, fileName):
|
||||
tdLog.notice("run cases like %s" % (fileName))
|
||||
testModule = self.__dynamicLoadModule(fileName)
|
||||
|
||||
runNum = 0
|
||||
for case in self.windowsCases:
|
||||
if case.name.find(fileName) != -1:
|
||||
case.case.init(conn)
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
time.sleep(2)
|
||||
for tmp in self.windowsCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
case = testModule.TDTestCase()
|
||||
case.init(conn)
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
tdLog.notice("total %d cases executed" % (runNum))
|
||||
continue
|
||||
tdLog.notice("total %d Windows case(s) executed" % (runNum))
|
||||
|
||||
def runAllCluster(self):
|
||||
tdLog.notice("run total %d cases" % (len(self.clusterCases)))
|
||||
for case in self.clusterCases:
|
||||
case.case.init()
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
tdLog.notice("total %d cases executed" % (len(self.clusterCases)))
|
||||
# TODO: load all cluster case module here
|
||||
|
||||
runNum = 0
|
||||
for tmp in self.clusterCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
tdLog.notice("run cases like %s" % (fileName))
|
||||
case = testModule.TDTestCase()
|
||||
case.init()
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
continue
|
||||
|
||||
tdLog.notice("total %d Cluster test case(s) executed" % (runNum))
|
||||
|
||||
def runOneCluster(self, fileName):
|
||||
tdLog.notice("run cases like %s" % (fileName))
|
||||
testModule = self.__dynamicLoadModule(fileName)
|
||||
|
||||
runNum = 0
|
||||
for case in self.clusterCases:
|
||||
if case.name.find(fileName) != -1:
|
||||
case.case.init()
|
||||
case.case.run()
|
||||
case.case.stop()
|
||||
time.sleep(2)
|
||||
for tmp in self.clusterCases:
|
||||
if tmp.name.find(fileName) != -1:
|
||||
tdLog.notice("run cases like %s" % (fileName))
|
||||
case = testModule.TDTestCase()
|
||||
case.init()
|
||||
case.run()
|
||||
case.stop()
|
||||
runNum += 1
|
||||
tdLog.notice("total %d cases executed" % (runNum))
|
||||
continue
|
||||
|
||||
tdLog.notice("total %d Cluster test case(s) executed" % (runNum))
|
||||
|
||||
|
||||
tdCases = TDCases()
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
from util.log import *
|
||||
|
||||
|
||||
|
@ -78,10 +79,18 @@ class TDDnode:
|
|||
self.index = index
|
||||
self.running = 0
|
||||
self.deployed = 0
|
||||
self.testCluster = False
|
||||
self.valgrind = 0
|
||||
|
||||
def init(self, path):
|
||||
self.path = path
|
||||
|
||||
def setTestCluster(self, value):
|
||||
self.testCluster = value
|
||||
|
||||
def setValgrind(self, value):
|
||||
self.valgrind = value
|
||||
|
||||
def deploy(self):
|
||||
self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
|
||||
self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
|
||||
|
@ -116,7 +125,9 @@ class TDDnode:
|
|||
if os.system(cmd) != 0:
|
||||
tdLog.exit(cmd)
|
||||
|
||||
self.startIP()
|
||||
if self.testCluster:
|
||||
self.startIP()
|
||||
|
||||
self.cfg("masterIp", "192.168.0.1")
|
||||
self.cfg("secondIp", "192.168.0.2")
|
||||
self.cfg("publicIp", "192.168.0.%d" % (self.index))
|
||||
|
@ -164,9 +175,18 @@ class TDDnode:
|
|||
|
||||
if self.deployed == 0:
|
||||
tdLog.exit("dnode:%d is not deployed" % (self.index))
|
||||
cmd = "nohup %staosd -c %s > /dev/null 2>&1 & " % (
|
||||
binPath, self.cfgDir)
|
||||
print(cmd)
|
||||
|
||||
if self.valgrind == 0:
|
||||
cmd = "nohup %staosd -c %s > /dev/null 2>&1 & " % (
|
||||
binPath, self.cfgDir)
|
||||
else:
|
||||
valgrindCmdline = "valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"
|
||||
|
||||
cmd = "nohup %s %staosd -c %s 2>&1 & " % (
|
||||
valgrindCmdline, binPath, self.cfgDir)
|
||||
|
||||
print(cmd)
|
||||
|
||||
if os.system(cmd) != 0:
|
||||
tdLog.exit(cmd)
|
||||
self.running = 1
|
||||
|
@ -275,8 +295,16 @@ class TDDnodes:
|
|||
self.sim.init(self.path)
|
||||
self.sim.deploy()
|
||||
|
||||
def setTestCluster(self, value):
|
||||
self.testCluster = value
|
||||
|
||||
def setValgrind(self, value):
|
||||
self.valgrind = value
|
||||
|
||||
def deploy(self, index):
|
||||
self.check(index)
|
||||
self.dnodes[index - 1].setTestCluster(self.testCluster)
|
||||
self.dnodes[index - 1].setValgrind(self.valgrind)
|
||||
self.dnodes[index - 1].deploy()
|
||||
|
||||
def cfg(self, index, option, value):
|
||||
|
@ -297,11 +325,15 @@ class TDDnodes:
|
|||
|
||||
def startIP(self, index):
|
||||
self.check(index)
|
||||
self.dnodes[index - 1].startIP()
|
||||
|
||||
if self.testCluster:
|
||||
self.dnodes[index - 1].startIP()
|
||||
|
||||
def stopIP(self, index):
|
||||
self.check(index)
|
||||
self.dnodes[index - 1].stopIP()
|
||||
|
||||
if self.dnodes[index - 1].testCluster:
|
||||
self.dnodes[index - 1].stopIP()
|
||||
|
||||
def check(self, index):
|
||||
if index < 1 or index > 10:
|
||||
|
@ -312,11 +344,14 @@ class TDDnodes:
|
|||
for i in range(len(self.dnodes)):
|
||||
self.dnodes[i].stop()
|
||||
|
||||
cmd = "sudo systemctl stop taosd"
|
||||
os.system(cmd)
|
||||
psCmd = "ps -ef | grep -w taosd | grep 'root' | grep -v grep | awk '{print $2}'"
|
||||
processID = subprocess.check_output(psCmd, shell=True)
|
||||
if processID:
|
||||
cmd = "sudo systemctl stop taosd"
|
||||
os.system(cmd)
|
||||
# if os.system(cmd) != 0 :
|
||||
# tdLog.exit(cmd)
|
||||
cmd = "ps -ef | grep -w taosd | grep 'dnode' | grep -v grep | awk '{print $2}' && sudo pkill -sigkill taosd"
|
||||
cmd = "ps -ef | grep -w taosd | grep 'dnode' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd"
|
||||
os.system(cmd)
|
||||
# if os.system(cmd) != 0 :
|
||||
# tdLog.exit(cmd)
|
||||
|
|
|
@ -42,7 +42,7 @@ class TDLog:
|
|||
printf("\033[1;31m%s %s\033[0m" % (datetime.datetime.now(), err))
|
||||
sys.exit(1)
|
||||
|
||||
def printfNoPrefix(self, info):
|
||||
def printNoPrefix(self, info):
|
||||
printf("\033[1;36m%s\033[0m" % (info))
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
#################################
|
||||
|
||||
run general/table/basic1.sim
|
||||
run general/table/basic2.sim
|
||||
run general/table/basic3.sim
|
||||
|
||||
run general/db/basic1.sim
|
||||
run general/db/basic2.sim
|
||||
run general/db/basic3.sim
|
||||
run general/db/basic4.sim
|
||||
run general/db/basic5.sim
|
||||
|
||||
run general/user/basic1.sim
|
||||
run general/db/testSuite.sim
|
||||
run general/insert/testSuite.sim
|
||||
run general/table/testSuite.sim
|
||||
run general/user/basicSuite.sim
|
||||
|
||||
##################################
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
run general/account/pass_alter.sim
|
||||
run general/account/pass_len.sim
|
||||
run general/account/user_create.sim
|
||||
run general/account/user_len.sim
|
||||
run general/account/monitor.sim
|
|
@ -0,0 +1,63 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =================== step1
|
||||
sql create database db
|
||||
sql use db
|
||||
sql create table mt (ts timestamp, k int, h binary(20), t bigint, s float, f double, x smallint, y tinyint, z bool) tags (a int, b binary(20), c bigint)
|
||||
sql create table tb using mt tags (0, '1', 2)
|
||||
|
||||
sql insert into tb values(now -200d, 200, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -100d, 100, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -30d, 30, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -20d, 20, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -10d, 10, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -5d, 5, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now -1d, 1, '1', 2, 3, 4, 5, 6, true);
|
||||
sql insert into tb values(now, 0, '1', 2, 3, 4, 5, 6, true);
|
||||
|
||||
sql select * from db.mt
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.tb
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from db.mt
|
||||
if $data00 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)
|
||||
sql select count(*), last(ts), min(k), max(k), avg(k) from db.mt where a=0 and ts>="2016-4-29 8:0:0" and ts < "2018-7-18 8:9:0" interval(1d) fill(value, 1)
|
||||
|
||||
print =================== step2
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 10000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
|
||||
print =================== step3
|
||||
sql select * from db.mt
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.tb
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from db.mt
|
||||
if $data00 != 8 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,316 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
|
||||
print ========== step1
|
||||
system sh/cfg.sh -n dnode1 -c monitor -v 1
|
||||
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =============== step2
|
||||
sql create database d4 precision 'us'
|
||||
sql use d4
|
||||
sql create table t1 (ts timestamp, i int)
|
||||
sql insert into d4.t1 values(now, 1)
|
||||
|
||||
sql create table d4.s001 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s002 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s003 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s004 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s005 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s006 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s007 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s008 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s009 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s000 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s011 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s012 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s013 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s014 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s015 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s016 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s017 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s018 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s019 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s010 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s021 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s022 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s023 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s024 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s025 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s026 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s027 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s028 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s029 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s020 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s031 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s032 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s033 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s034 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s035 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s036 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s037 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s038 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s039 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s030 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s041 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s042 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s043 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s044 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s045 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s046 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s047 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s048 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s049 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s040 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s051 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s052 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s053 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s054 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s055 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s056 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s057 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s058 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s059 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s050 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s061 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s062 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s063 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s064 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s065 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s066 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s067 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s068 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s069 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s060 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s071 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s072 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s073 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s074 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s075 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s076 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s077 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s078 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s079 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s070 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s081 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s082 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s083 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s084 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s085 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s086 as select count(req_http), count(req_insert), avg(req_select), sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s087 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s088 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s089 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s080 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s091 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s092 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s093 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s094 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s095 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s096 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s097 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s098 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s099 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s090 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
print =============== step21
|
||||
|
||||
sql create table d4.s101 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s102 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s103 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s104 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s105 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s106 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s107 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s108 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s109 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s100 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s111 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s112 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s113 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s114 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s115 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s116 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s117 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s118 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s119 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s110 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s121 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s122 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s123 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s124 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s125 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s126 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s127 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s128 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s129 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s120 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s131 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s132 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s133 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s134 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s135 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s136 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s137 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s138 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s139 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s130 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s141 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s142 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s143 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s144 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s145 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s146 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s147 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s148 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s149 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s140 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s151 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s152 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s153 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s154 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s155 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s156 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s157 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s158 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s159 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s150 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s161 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s162 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s163 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s164 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s165 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s166 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s167 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s168 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s169 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s160 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s171 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s172 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s173 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s174 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s175 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s176 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s177 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s178 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s179 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s170 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s181 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s182 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s183 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s184 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s185 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s186 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s187 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s188 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s189 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s180 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s191 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s192 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s193 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s194 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s195 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s196 as select count(req_http), count(req_insert) , sum(req_insert), max(req_select), min(req_insert) from log.dn_192_168_0_1 interval(5s)
|
||||
sql create table d4.s197 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s198 as select count(mem_taosd), count(mem_system), avg(mem_taosd), avg(mem_system), sum(mem_taosd), max(mem_taosd), min(mem_taosd) from log.dn interval(5s)
|
||||
sql create table d4.s199 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used) from log.dn interval(5s)
|
||||
sql create table d4.s190 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read) from log.dn interval(5s)
|
||||
|
||||
|
||||
print =============== step3
|
||||
print sleep 22 seconds
|
||||
sleep 50000
|
||||
|
||||
sql select * from d4.s001
|
||||
$s1 = $rows
|
||||
print select * from d4.s001 ==> $s1
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s002
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s003
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s004
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s005
|
||||
$s5 = $rows
|
||||
print select * from d4.s005 ==> $s5
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s006
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s007
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s008
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s009
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s010
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s101
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s102
|
||||
$s12 = $rows
|
||||
print select * from d4.s102 ==> $s12
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,2 @@
|
|||
run general/agg/fill.sim
|
||||
run general/agg/stream.sim
|
|
@ -0,0 +1,119 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$db = csaa_db
|
||||
$stb = csaastb
|
||||
$tb1 = csaatb1
|
||||
$tb2 = csaatb2
|
||||
|
||||
$ts0 = 1537146000000
|
||||
$delta = 600000
|
||||
print ========== cached_schema_after_alter.sim
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
sql create table $tb1 using $stb tags( 1 )
|
||||
sql create table $tb2 using $stb tags( 2 )
|
||||
|
||||
sql_error alter table $tb1 add column c0 int
|
||||
sql alter table $stb add column c2 int
|
||||
|
||||
sql insert into $tb2 values ( $ts0 , 1, 1)
|
||||
sql select * from $stb
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $tb2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ================== restart server to commit data into disk
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 2000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
print ================== server restart completed
|
||||
sql connect
|
||||
sleep 3000
|
||||
|
||||
sql use $db
|
||||
sql select * from $stb
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $tb2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$ts = $ts0 + $delta
|
||||
sql insert into $tb2 values ( $ts , 2, 2)
|
||||
sql select * from $stb order by ts asc
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $tb2 order by ts asc
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 2 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,266 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
|
||||
|
||||
print ========= start dnode1 as master
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ======== step1
|
||||
sql create database d1 replica 1 days 7 keep 50
|
||||
sql use d1
|
||||
sql create table tb (ts timestamp, a int)
|
||||
sql insert into tb values(now-28d, -28)
|
||||
sql insert into tb values(now-27d, -27)
|
||||
sql insert into tb values(now-26d, -26)
|
||||
sql select count(a) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step2
|
||||
sql alter table tb add column b smallint
|
||||
sql insert into tb values(now-25d, -25, 0)
|
||||
sql insert into tb values(now-24d, -24, 1)
|
||||
sql insert into tb values(now-23d, -23, 2)
|
||||
sql select count(b) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step3
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint)
|
||||
sql alter table tb add column c tinyint
|
||||
sql insert into tb values(now-22d, -22, 3, 0)
|
||||
sql insert into tb values(now-21d, -21, 4, 1)
|
||||
sql insert into tb values(now-20d, -20, 5, 2)
|
||||
sql select count(c) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step4
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int)
|
||||
sql alter table tb add column d int
|
||||
sql insert into tb values(now-19d, -19, 6, 0, 0)
|
||||
sql insert into tb values(now-18d, -18, 7, 1, 1)
|
||||
sql insert into tb values(now-17d, -17, 8, 2, 2)
|
||||
sql select count(d) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step5
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint)
|
||||
sql alter table tb add column e bigint
|
||||
sql insert into tb values(now-16d, -16, 9, 0, 0, 0)
|
||||
sql insert into tb values(now-15d, -15, 10, 1, 1, 1)
|
||||
sql insert into tb values(now-14d, -14, 11, 2, 2, 2)
|
||||
sql select count(e) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step6
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float)
|
||||
sql alter table tb add column f float
|
||||
sql insert into tb values(now-13d, -13, 12, 0, 0, 0, 0)
|
||||
sql insert into tb values(now-12d, -12, 13, 1, 1, 1, 1)
|
||||
sql insert into tb values(now-11d, -11, 24, 2, 2, 2, 2)
|
||||
sql select count(f) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step7
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double)
|
||||
sql alter table tb add column g double
|
||||
sql insert into tb values(now-10d, -10, 15, 0, 0, 0, 0, 0)
|
||||
sql insert into tb values(now-9d, -9, 16, 1, 1, 1, 1, 1)
|
||||
sql insert into tb values(now-8d, -8, 17, 2, 2, 2, 2, 2)
|
||||
sql select count(g) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step8
|
||||
# sql alter table tb(ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(10) )
|
||||
sql alter table tb add column h binary(10)
|
||||
sql insert into tb values(now-7d, -7, 18, 0, 0, 0, 0, 0, '0')
|
||||
sql insert into tb values(now-6d, -6, 19, 1, 1, 1, 1, 1, '1')
|
||||
sql insert into tb values(now-5d, -5, 20, 2, 2, 2, 2, 2, '2')
|
||||
sql select count(h) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step9
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data00 != 24 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data01 != 21 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data02 != 18 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data03 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data04 != 12 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data06 != 6 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data07 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============= step10
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 5000
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data00 != 24 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data01 != 21 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data02 != 18 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data03 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data04 != 12 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data06 != 6 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
|
||||
if $data07 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step11
|
||||
#sql alter table tb(ts timestamp, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(20))
|
||||
sql alter table tb drop column a
|
||||
sql insert into tb values(now-4d, 1, 1, 1, 1, 1, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 7 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step12
|
||||
#sql alter table tb(ts timestamp, c tinyint, d int, e bigint, f float, g double, h binary(20))
|
||||
sql alter table tb drop column b
|
||||
sql insert into tb values(now-3d, 1, 1, 1, 1, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step13
|
||||
#sql alter table tb(ts timestamp, d int, e bigint, f float, g double, h binary(20))
|
||||
sql alter table tb drop column c
|
||||
sql insert into tb values(now-2d, 1, 1, 1, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 9 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step14
|
||||
#sql alter table tb(ts timestamp, e bigint, f float, g double, h binary(20))
|
||||
sql alter table tb drop column d
|
||||
sql insert into tb values(now-1d, 1, 1, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step15
|
||||
#sql alter table tb(ts timestamp, f float, g double, h binary(20))
|
||||
sql alter table tb drop column e
|
||||
sql insert into tb values(now, 1, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 11 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step16
|
||||
#sql alter table tb(ts timestamp, g double, h binary(20))
|
||||
sql alter table tb drop column f
|
||||
sql insert into tb values(now+1d, 1, '1')
|
||||
sql select count(g) from tb
|
||||
if $data00 != 12 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step17
|
||||
#sql alter table tb(ts timestamp, h binary(20))
|
||||
sql alter table tb drop column g
|
||||
sql insert into tb values(now+2d, '1')
|
||||
sql select count(h) from tb
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step18
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 5000
|
||||
|
||||
#sql select count(g) from tb
|
||||
#if $data00 != 12 then
|
||||
# return -1
|
||||
#endi
|
||||
sql select count(*) from tb
|
||||
if $data00 != 31 then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
|
||||
|
||||
print ========= start dnode1 as master
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ======== step1
|
||||
sql create database d1 replica 1 days 7 keep 50
|
||||
sql use d1
|
||||
sql create table tb (ts timestamp, a int)
|
||||
sql insert into tb values(now-30d, -28)
|
||||
sql insert into tb values(now-27d, -27)
|
||||
sql insert into tb values(now-26d, -26)
|
||||
sql select count(a) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step2
|
||||
#sql alter table tb(ts timestamp, a int, b smallint)
|
||||
sql alter table tb add column b smallint
|
||||
sql insert into tb values(now-25d, -25, 0)
|
||||
sql insert into tb values(now-22d, -24, 1)
|
||||
sql insert into tb values(now-20d, -23, 2)
|
||||
sql select count(b) from tb
|
||||
if $data00 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ========= step3
|
||||
sql import into tb values(now-23d, -23, 0)
|
||||
sql import into tb values(now-21d, -21, 0)
|
||||
sql select count(b) from tb
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql_error import into tb values(now-29d, -29, 0)
|
||||
sql select count(b) from tb
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,683 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ======== step1
|
||||
sql create database d4
|
||||
sql use d4
|
||||
sql create table tb (ts timestamp, a int, b smallint, c tinyint, d int, e bigint, f float, g double, h binary(10))
|
||||
sql insert into tb values(now-28d, 1, 2, 3, 4, 5, 6, 7, 8)
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step2
|
||||
sleep 2500
|
||||
sql_error alter table tb add column b smallint
|
||||
sql_error alter table tb add column b int
|
||||
sql alter table tb drop column b
|
||||
sql insert into tb values(now-25d, 2, 3, 4, 5, 6, 7, 8)
|
||||
sleep 3000
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data14 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data16 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data17 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step3
|
||||
sleep 2500
|
||||
sql alter table tb drop column c
|
||||
sql insert into tb values(now-22d, 3, 4, 5, 6, 7, 8)
|
||||
sleep 3000
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data14 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data16 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data17 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data28 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step4
|
||||
sleep 2500
|
||||
sql alter table tb drop column d
|
||||
sql alter table tb drop column e
|
||||
sql insert into tb values(now-19d, -19, 6, 3, 0)
|
||||
sleep 3000
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -19 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data14 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data16 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data17 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data28 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 7.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data34 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data36 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data37 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data38 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step5
|
||||
sleep 2500
|
||||
sql alter table tb drop column g
|
||||
sql insert into tb values(now-16d, -16, 9, 5)
|
||||
sleep 3000
|
||||
sql select count(f) from tb
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -16 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 9.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -19 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data14 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data16 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data17 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data28 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data34 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data36 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data37 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data38 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data43 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data44 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data45 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data46 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data47 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data48 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step6
|
||||
sleep 2500
|
||||
sql alter table tb drop column f
|
||||
sql insert into tb values(now-13d, -13, 7)
|
||||
sleep 3000
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -13 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -16 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != -19 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data28 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data34 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data36 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data37 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data38 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data43 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data44 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data45 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data46 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data47 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data48 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data53 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data54 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data55 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data57 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data58 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step7
|
||||
sleep 2500
|
||||
sql alter table tb drop column h
|
||||
sql insert into tb values(now-10d, -10)
|
||||
sleep 3000
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 7 then
|
||||
return -1
|
||||
endi
|
||||
print data01 = $data01
|
||||
if $data01 != -10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -13 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != -16 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != -19 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data53 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data62 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql_error alter table tb drop column a
|
||||
|
||||
print ======== step9
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 5000
|
||||
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 7 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -13 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != -16 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != -19 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data53 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data62 != null then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -0,0 +1,783 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ======== step1
|
||||
sql create database d2
|
||||
sql use d2
|
||||
sql create table mt (ts timestamp, a int) TAGS (t int)
|
||||
sql create table tb using mt tags (1)
|
||||
sql insert into tb values(now-28d, -28)
|
||||
sql insert into tb values(now-27d, -27)
|
||||
sql insert into tb values(now-26d, -26)
|
||||
sql select * from tb
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step2
|
||||
sql alter table mt add column b smallint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step3
|
||||
sql alter table mt add column c tinyint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step4
|
||||
sql alter table mt add column d int
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step5
|
||||
sql alter table mt add column e bigint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step6
|
||||
sql alter table mt add column f float
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step7
|
||||
sql alter table mt add column g double
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step8
|
||||
sql alter table mt add column h binary(10)
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data82 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data90 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data91 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step9
|
||||
print ======== step10
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
|
||||
sql use d2
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data82 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data90 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data91 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step11
|
||||
#sql alter table mt drop column a -x step111
|
||||
# return -1
|
||||
#step111:
|
||||
|
||||
#sql alter table mt drop column ts -x step112
|
||||
# return -1
|
||||
#step112:
|
||||
|
||||
#sql alter table mt drop column cdfg -x step113
|
||||
# return -1
|
||||
#step113:
|
||||
|
||||
#sql alter table mt add column a -x step114
|
||||
# return -1
|
||||
#step114:
|
||||
|
||||
#sql alter table mt add column b -x step115
|
||||
# return -1
|
||||
#step115:
|
||||
|
||||
print ======== step12
|
||||
sql alter table mt drop column b
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data72 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step13
|
||||
sql alter table mt drop column c
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data62 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step14
|
||||
sql alter table mt drop column d
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step15
|
||||
sql alter table mt drop column e
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step16
|
||||
sql alter table mt drop column f
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step17
|
||||
sql alter table mt drop column g
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============= step18
|
||||
sql alter table mt drop column h
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != t then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======= over
|
||||
sql drop database d2
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -0,0 +1,686 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ======== step1
|
||||
sql create database d1
|
||||
sql use d1
|
||||
sql create table tb (ts timestamp, a int)
|
||||
sql insert into tb values(now-28d, -28)
|
||||
sql insert into tb values(now-27d, -27)
|
||||
sql insert into tb values(now-26d, -26)
|
||||
sql select * from tb
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step2
|
||||
sql alter table tb add column b smallint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step3
|
||||
sql alter table tb add column c tinyint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step4
|
||||
sql alter table tb add column d int
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step5
|
||||
sql alter table tb add column e bigint
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step6
|
||||
sql alter table tb add column f float
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step7
|
||||
sql alter table tb add column g double
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step8
|
||||
sql alter table tb add column h binary(10)
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data82 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step9
|
||||
print ======== step10
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
|
||||
sql use d1
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != b then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != SMALLINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data80 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data82 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step11
|
||||
sql alter table drop column a -x step111
|
||||
return -1
|
||||
step111:
|
||||
|
||||
sql alter table drop column ts -x step112
|
||||
return -1
|
||||
step112:
|
||||
|
||||
sql alter table drop column cdfg -x step113
|
||||
return -1
|
||||
step113:
|
||||
|
||||
sql alter table add column a -x step114
|
||||
return -1
|
||||
step114:
|
||||
|
||||
sql alter table add column b -x step115
|
||||
return -1
|
||||
step115:
|
||||
|
||||
print ======== step12
|
||||
sql alter table tb drop column b
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != c then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != TINYINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data70 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data72 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step13
|
||||
sql alter table tb drop column c
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != d then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data60 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data62 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step14
|
||||
sql alter table tb drop column d
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != e then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != BIGINT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step15
|
||||
sql alter table tb drop column e
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != f then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != FLOAT then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step16
|
||||
sql alter table tb drop column f
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != g then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != DOUBLE then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======== step17
|
||||
sql alter table tb drop column g
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != h then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != BINARY then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============= step18
|
||||
sql alter table tb drop column h
|
||||
sleep 2500
|
||||
sql describe tb
|
||||
if $data00 != ts then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != TIMESTAMP then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != a then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != INT then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ======= over
|
||||
sql drop database d1
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
run general/alter/count.sim
|
||||
run general/alter/cached_schema_after_alter.sim
|
||||
run general/alter/import.sim
|
||||
run general/alter/insert1.sim
|
||||
run general/alter/insert2.sim
|
||||
run general/alter/metrics.sim
|
||||
run general/alter/table.sim
|
|
@ -0,0 +1,58 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/ip.sh -i 2 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode2 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c httpMaxThreads -v 2
|
||||
system sh/cfg.sh -n dnode2 -c httpMaxThreads -v 2
|
||||
system sh/cfg.sh -n dnode1 -c monitor -v 1
|
||||
system sh/cfg.sh -n dnode2 -c http -v 1
|
||||
system sh/cfg.sh -n dnode1 -c enableHttp -v 1
|
||||
system sh/cfg.sh -n dnode2 -c monitor -v 1
|
||||
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c monitorInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
|
||||
system sh/cfg.sh -n dnode2 -c maxVnodeConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
|
||||
system sh/cfg.sh -n dnode2 -c maxMgmtConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
|
||||
system sh/cfg.sh -n dnode2 -c maxMeterConnections -v 30000
|
||||
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
|
||||
system sh/cfg.sh -n dnode2 -c maxShellConns -v 30000
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
sql create database testdb
|
||||
sql use testdb
|
||||
sql create table meter1 (ts timestamp, val int)
|
||||
|
||||
$x = 0
|
||||
$v = -100
|
||||
while $x < 30
|
||||
$v = $v + 1
|
||||
$ms = $v . m
|
||||
sql insert into meter1 values (now $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
|
||||
sleep 20000
|
||||
sql select * from log.dn_192_168_0_1
|
||||
print ===>rows $rows
|
||||
print $data00 $data01 $data02
|
||||
print $data10 $data11 $data12
|
||||
print $data20 $data21 $data22
|
||||
if $rows < 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
#sql create table sys.st as select avg(taosd), avg(system) from sys.cpu interval(30s)
|
|
@ -0,0 +1,146 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = ca_nm_db
|
||||
$tbPrefix = ca_nm_tb
|
||||
$mtPrefix = ca_nm_mt
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
|
||||
print =============== step1
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool)
|
||||
$i = 0
|
||||
while $i < 5
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( 0 )
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$val = $x * 60000
|
||||
$ms = 1519833600000 + $val
|
||||
sql insert into $tb values ($ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print =============== step2
|
||||
|
||||
sql select * from $tb order by ts desc
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $mt
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 100 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $mt
|
||||
print ===>rows $rows, data $data00
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 100 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
|
||||
while $i < 10
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( 1 )
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$val = $x * 60000
|
||||
$ms = 1519833600000 + $val
|
||||
sql insert into $tb values ($ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print ==> sleep 8 seconds to renew cache
|
||||
sleep 8000
|
||||
|
||||
print =============== step5
|
||||
|
||||
sql select * from $tb order by ts desc
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $mt
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 200 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $mt
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 200 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ======================== dnode1 start
|
||||
|
||||
$dbPrefix = ns_db
|
||||
$tbPrefix = ns_tb
|
||||
$mtPrefix = ns_mt
|
||||
$stPrefix = ns_st
|
||||
$tbNum = 5
|
||||
$rowNum = 200
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
|
||||
$i = 0
|
||||
$db = $dbPrefix
|
||||
$mt = $mtPrefix
|
||||
$st = $stPrefix
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
$y = 0
|
||||
while $y < $rowNum
|
||||
$ms = $x . s
|
||||
sql insert into $tb values (now + $ms , $y , $y )
|
||||
$x = $x + 1
|
||||
$y = $y + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
|
||||
sql select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)
|
||||
print $data00 $data01 $data02 $data03
|
||||
|
||||
sql create table $st as select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)
|
||||
|
||||
print =============== step3
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
print =============== step4
|
||||
|
||||
sql select * from $st
|
||||
print $st ==> $rows1 $data00 $data01 $data02 $data03
|
||||
if $data13 >= 51 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
|
||||
$tbNum = 10
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
if $i == 0 then
|
||||
sleep 2000
|
||||
endi
|
||||
|
||||
$x = 0
|
||||
$y = 0
|
||||
while $y < $rowNum
|
||||
$ms = $x . s
|
||||
sql insert into $tb values (now + $ms , $y , $y )
|
||||
$x = $x + 1
|
||||
$y = $y + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print =============== step6
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
print =============== step7
|
||||
|
||||
sql select * from $st order by ts desc
|
||||
print $st ==> $rows1 $data00 $data01 $data02 $data03
|
||||
if $data03 <= 51 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ======================== dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = ca_rm_db
|
||||
$tbPrefix = ca_rm_tb
|
||||
$mtPrefix = ca_rm_mt
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
print =============== step1
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(100))
|
||||
sql create table $tb using $mt tags( "1" )
|
||||
sql insert into $tb values (now, 1)
|
||||
|
||||
sql select * from $tb
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $mt
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
print =============== step3
|
||||
print ==> sleep 8 seconds to renew cache
|
||||
sleep 8000
|
||||
|
||||
print =============== step4
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol int)
|
||||
sql create table $tb using $mt tags( 3 )
|
||||
sql insert into $tb values (now, 2)
|
||||
|
||||
sql select * from $tb
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $mt
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 1
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ======================== dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = rs_db
|
||||
$tbPrefix = rs_tb
|
||||
$mtPrefix = rs_mt
|
||||
$stPrefix = rs_st
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
$db = $dbPrefix
|
||||
$tb = $tbPrefix . $i
|
||||
$mt = $mtPrefix
|
||||
$stm = $stPrefix . m
|
||||
$stt = $stPrefix . t
|
||||
|
||||
print =============== step1
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $mt (ts timestamp, tbcol int, tbcol2 int ) TAGS(tgcol bool)
|
||||
$i = 0
|
||||
while $i < 10
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( 0 )
|
||||
|
||||
$x = -1440
|
||||
$y = 0
|
||||
while $y < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now $ms , $y , $y )
|
||||
$x = $x + 1
|
||||
$y = $y + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print =============== step2
|
||||
$i = 0
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select count(*) from $tb interval(1d)
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $mt interval(1d)
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 200 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql create table $stt as select count(*) from $tb interval(1d)
|
||||
sql create table $stm as select count(*) from $mt interval(1d)
|
||||
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
sql select * from $stt
|
||||
print select count(*) from $stt ===> $data00 $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $stm
|
||||
print select * from $stm ===> $data00 $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 200 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 1
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
print =============== step5
|
||||
print ==> sleep 8 seconds to renew cache
|
||||
sleep 8000
|
||||
|
||||
|
||||
print =============== step6
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol bigint, tbcol2 bigint ) TAGS(tgcol int)
|
||||
$i = 0
|
||||
while $i < 5
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( 0 )
|
||||
|
||||
$x = -1440
|
||||
$y = 0
|
||||
while $y < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now $ms , $y , $y )
|
||||
$x = $x + 1
|
||||
$y = $y + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
||||
print =============== step7
|
||||
|
||||
sql select count(*) from $tb interval(1d)
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $mt interval(1d)
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql create table $stt as select count(*) from $tb interval(1d)
|
||||
sql create table $stm as select count(*) from $mt interval(1d)
|
||||
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
sql select * from $stt
|
||||
sleep 1000
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $stm
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ======================== dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = ca_rt_db
|
||||
$tbPrefix = ca_rt_tb
|
||||
$mtPrefix = ca_rt_mt
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
print =============== step1
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, speed bool)
|
||||
sql insert into $tb values (now, 1)
|
||||
sql select * from $tb
|
||||
print ===>rows $rows, data $data01
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c meterMetaKeepTimer -v 10
|
||||
system sh/cfg.sh -n dnode1 -c metricMetaKeepTimer -v 10
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
print =============== step3
|
||||
print ==> sleep 8 seconds to renew cache
|
||||
sleep 3000
|
||||
sql reset query cache
|
||||
sleep 18000
|
||||
|
||||
print =============== step4
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $tb (ts timestamp, speed int)
|
||||
sql insert into $tb values (now, 1)
|
||||
sql select * from $tb
|
||||
print ===>rows $rows, data $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
run general/cache/restart_table.sim
|
||||
run general/cache/restart_metrics.sim
|
||||
run general/cache/restart_stream.sim
|
||||
run general/cache/new_metrics.sim
|
||||
run general/cache/new_stream.sim
|
|
@ -0,0 +1,154 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =============== step1
|
||||
sql create database d3
|
||||
sql use d3
|
||||
sql create table d3.mt (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int) tags(a int, b smallint, c binary(20), d float, e double, f bigint)
|
||||
sql create table d3.t1 using d3.mt tags(1, 2, '3', 4, 5, 6)
|
||||
|
||||
sql show tables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
|
||||
sql insert into d3.t1 values (now -300d,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,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 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
|
||||
|
||||
|
||||
print =============== step3
|
||||
|
||||
sql select * from d3.mt
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.mt where c001 = 1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.mt where c002 = 2 and c003 = 2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c235), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d3.mt
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 4000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
|
||||
print =============== step5
|
||||
|
||||
sql select * from d3.mt
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.mt where c001 = 1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.mt where c002 = 2 and c003 = 2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from d3.mt
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c128), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d3.mt
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 10 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,217 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =============== step1
|
||||
sql create database d2
|
||||
sql use d2
|
||||
sql create table d2.mt (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int) tags(a int, b smallint, c binary(20), d float, e double, f bigint)
|
||||
sql create table d2.t1 using d2.mt tags(1, 2, '3', 4, 5, 6)
|
||||
sql create table d2.t2 using d2.mt tags(6, 7, '8', 9, 10, 11)
|
||||
|
||||
sql show tables
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
|
||||
sql insert into d2.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 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 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
|
||||
|
||||
print =============== step3
|
||||
|
||||
sql select * from d2.mt
|
||||
if $rows != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where ts < now + 4m
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where c001 = 1
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where c002 = 2 and c003 = 2
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where c002 = 2 and c003 = 2 and ts < now + 4m
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from d2.mt
|
||||
if $data00 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c235), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
if $data00 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 90 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c238), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt where a = 1
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 1000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
|
||||
print =============== step5
|
||||
|
||||
sql select * from d2.mt
|
||||
if $rows != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where c001 = 1
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.mt where c002 = 2 and c003 = 2
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from d2.mt
|
||||
if $data00 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c248), avg(c001), avg(c248), sum(c001), max(c001), min(c248), avg(c128), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d2.mt
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
if $data00 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 90 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 20 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,200 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 0
|
||||
|
||||
print ========== step1
|
||||
system sh/cfg.sh -n dnode1 -c monitor -v 1
|
||||
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =============== step1
|
||||
sleep 2000
|
||||
sql select * from log.dn
|
||||
if $rows == 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
sql create database d4 precision 'us'
|
||||
sql use d4
|
||||
sql create table t1 (ts timestamp, i int)
|
||||
sql insert into d4.t1 values(now, 1)
|
||||
|
||||
sql create table d4.s1 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s2 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), stddev(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s3 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), stddev(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s4 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), stddev(io_write), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s5 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), stddev(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s6 as select count(req_http), count(req_insert), avg(req_http), avg(req_select), sum(req_insert), max(req_select), min(req_insert), stddev(req_select), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn_192_168_0_1 interval(5s)
|
||||
|
||||
sql create table d4.s7 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s8 as select count(cpu_taosd), count(cpu_system), avg(cpu_taosd), avg(cpu_system), sum(cpu_taosd), max(cpu_taosd), min(cpu_taosd), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s9 as select count(disk_used), count(disk_total), avg(disk_used), avg(disk_total), sum(disk_used), max(disk_used), min(disk_used), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s10 as select count(io_read), count(io_write), avg(io_read), avg(io_write), sum(io_read), max(io_write), min(io_read), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s11 as select count(band_speed), avg(band_speed), sum(band_speed), max(band_speed), min(band_speed), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
sql create table d4.s12 as select count(req_http), count(req_insert), avg(req_select), avg(req_insert), sum(req_insert), max(req_select), min(req_insert), count(*) as c1, count(*) as c2, count(*) as c3, count(*) as c4, count(*) as c5, count(*) as c6, count(*) as c7, count(*) as c8, count(*) as c9, count(*) as c10, count(*) as c11, count(*) as c12, count(*) as c13, count(*) as c14, count(*) as c15, count(*) as c16, count(*) as c17, count(*) as c18, count(*) as c19, count(*) as c20, count(*) as c21, count(*) as c22, count(*) as c23, count(*) as c24, count(*) as c25, count(*) as c26, count(*) as c27, count(*) as c28, count(*) as c29, count(*) as c30 from log.dn interval(5s)
|
||||
|
||||
print =============== step3
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
sql select * from d4.s1
|
||||
$s1 = $rows
|
||||
print select * from d4.s1 ==> $s1
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s2
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s3
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s4
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s5
|
||||
$s5 = $rows
|
||||
print select * from d4.s5 ==> $s5
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s6
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s7
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s8
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s9
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s10
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s11
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s12
|
||||
$s12 = $rows
|
||||
print select * from d4.s12 ==> $s12
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
print sleep 22 seconds
|
||||
sleep 22000
|
||||
|
||||
sql select * from d4.s1
|
||||
print select * from d4.s1 ==> $rows $s1
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows <= $s1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s2
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s3
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s4
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s5
|
||||
print select * from d4.s5 ==> $rows $s5
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows <= $s5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql select * from d4.s6
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s7
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s8
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s9
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s10
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s11
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.s12
|
||||
print select * from d4.s12 ==> $rows $s12
|
||||
if $rows <= 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows <= $s12 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,213 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print =============== step1
|
||||
sql create database d1
|
||||
sql use d1
|
||||
sql create table d1.t1 (ts timestamp, c000 int, c001 int, c002 int, c003 int, c004 int, c005 int, c006 int, c007 int, c008 int, c009 int, c010 int, c011 int, c012 int, c013 int, c014 int, c015 int, c016 int, c017 int, c018 int, c019 int, c020 int, c021 int, c022 int, c023 int, c024 int, c025 int, c026 int, c027 int, c028 int, c029 int, c030 int, c031 int, c032 int, c033 int, c034 int, c035 int, c036 int, c037 int, c038 int, c039 int, c040 int, c041 int, c042 int, c043 int, c044 int, c045 int, c046 int, c047 int, c048 int, c049 int, c050 int, c051 int, c052 int, c053 int, c054 int, c055 int, c056 int, c057 int, c058 int, c059 int, c060 int, c061 int, c062 int, c063 int, c064 int, c065 int, c066 int, c067 int, c068 int, c069 int, c070 int, c071 int, c072 int, c073 int, c074 int, c075 int, c076 int, c077 int, c078 int, c079 int, c080 int, c081 int, c082 int, c083 int, c084 int, c085 int, c086 int, c087 int, c088 int, c089 int, c090 int, c091 int, c092 int, c093 int, c094 int, c095 int, c096 int, c097 int, c098 int, c099 int, c100 int, c101 int, c102 int, c103 int, c104 int, c105 int, c106 int, c107 int, c108 int, c109 int, c110 int, c111 int, c112 int, c113 int, c114 int, c115 int, c116 int, c117 int, c118 int, c119 int, c120 int, c121 int, c122 int, c123 int, c124 int, c125 int, c126 int, c127 int, c128 int, c129 int, c130 int, c131 int, c132 int, c133 int, c134 int, c135 int, c136 int, c137 int, c138 int, c139 int, c140 int, c141 int, c142 int, c143 int, c144 int, c145 int, c146 int, c147 int, c148 int, c149 int, c150 int, c151 int, c152 int, c153 int, c154 int, c155 int, c156 int, c157 int, c158 int, c159 int, c160 int, c161 int, c162 int, c163 int, c164 int, c165 int, c166 int, c167 int, c168 int, c169 int, c170 int, c171 int, c172 int, c173 int, c174 int, c175 int, c176 int, c177 int, c178 int, c179 int, c180 int, c181 int, c182 int, c183 int, c184 int, c185 int, c186 int, c187 int, c188 int, c189 int, c190 int, c191 int, c192 int, c193 int, c194 int, c195 int, c196 int, c197 int, c198 int, c199 int, c200 int, c201 int, c202 int, c203 int, c204 int, c205 int, c206 int, c207 int, c208 int, c209 int, c210 int, c211 int, c212 int, c213 int, c214 int, c215 int, c216 int, c217 int, c218 int, c219 int, c220 int, c221 int, c222 int, c223 int, c224 int, c225 int, c226 int, c227 int, c228 int, c229 int, c230 int, c231 int, c232 int, c233 int, c234 int, c235 int, c236 int, c237 int, c238 int, c239 int, c240 int, c241 int, c242 int, c243 int, c244 int, c245 int, c246 int, c247 int, c248 int, c249 int, c250 int)
|
||||
|
||||
sql show tables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
|
||||
sql insert into d1.t1 values (now,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 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 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 )
|
||||
|
||||
print ======= step3
|
||||
|
||||
sql select * from d1.t1
|
||||
print select * from d1.t1 => rows $rows
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where ts < now + 4m
|
||||
print select * from d1.t1 where ts < now + 4m => rows $rows
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where c001 = 1
|
||||
print select * from d1.t1 where c001 = 1 => rows $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where c002 = 2 and c003 = 2
|
||||
print select * from d1.t1 where c002 = 2 and c003 = 2 => rows $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where c002 = 2 and c003 = 2 and ts < now + 4m
|
||||
print select * from d1.t1 where c002 = 2 and c003 = 2 and ts < now + 4m => rows $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from d1.t1
|
||||
print select count(*) from d1.t1 => $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250) from d1.t1
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 2.872281323 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d1.t1
|
||||
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 2.872281323 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 1000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
|
||||
print ============== step5
|
||||
|
||||
sql select * from d1.t1
|
||||
print select * from d1.t1 => rows $rows
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where c001 = 1
|
||||
print select * from d1.t1 where c001 = 1 => rows $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d1.t1 where c002 = 2 and c003 = 2
|
||||
print select * from d1.t1 where c002 = 2 and c003 = 2 => rows $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from d1.t1
|
||||
print select count(*) from d1.t1 => $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250) from d1.t1
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 2.872281323 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(c001), count(c250), avg(c001), avg(c250), sum(c001), max(c001), min(c250), stddev(c250), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*) from d1.t1
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 45 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 2.872281323 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,4 @@
|
|||
run lite/column/table.sim
|
||||
run lite/column/metrics.sim
|
||||
run lite/column/stream.sim
|
||||
run lite/column/commit.sim
|
|
@ -0,0 +1,128 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 1024
|
||||
system sh/cfg.sh -n dnode1 -c compression -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ============================ dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = db
|
||||
$tbPrefix = tb
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
$N = 2000
|
||||
|
||||
print =============== step1
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $tb (ts timestamp, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
$x = 0
|
||||
step3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 20000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 10000
|
||||
|
||||
print =============== step5
|
||||
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 1024
|
||||
system sh/cfg.sh -n dnode1 -c compression -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ============================ dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = db
|
||||
$tbPrefix = tb
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
$N = 2000
|
||||
|
||||
print =============== step1
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 10000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 10000
|
||||
|
||||
print =============== step5
|
||||
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 1024
|
||||
system sh/cfg.sh -n dnode1 -c compression -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
print ============================ dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = db
|
||||
$tbPrefix = tb
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
$N = 2000
|
||||
|
||||
print =============== step1
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 10000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 10000
|
||||
|
||||
print =============== step5
|
||||
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
run general/compress/compress.sim
|
||||
run general/compress/uncompress.sim
|
||||
run general/compress/commitlog.sim
|
||||
run general/compress/compress2.sim
|
|
@ -0,0 +1,123 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c cacheBlockSize -v 1024
|
||||
system sh/cfg.sh -n dnode1 -c compression -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
print ============================ dnode1 start
|
||||
|
||||
$i = 0
|
||||
$dbPrefix = cp_cp_db
|
||||
$tbPrefix = cp_cp_tb
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
$N = 2000
|
||||
|
||||
print =============== step1
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1, 0, $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql create database $db
|
||||
sql use $db
|
||||
|
||||
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
|
||||
|
||||
$count = 0
|
||||
while $count < $N
|
||||
$ms = $count . a
|
||||
sql insert into $tb values( now+ $ms , 1 , 0 , $count , $count , $count , $count , $count ,'it is a string')
|
||||
$count = $count + 1
|
||||
endw
|
||||
|
||||
sql select * from $tb
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
sleep 10000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 10000
|
||||
|
||||
print =============== step5
|
||||
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 1
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$i = 2
|
||||
$db = $dbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql use $db
|
||||
sql select * from $tb
|
||||
print select * from $tb ==> $rows points
|
||||
if $rows != $N then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_av_db
|
||||
$tbPrefix = m_av_tb
|
||||
$mtPrefix = m_av_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select avg(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select avg(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select avg(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select avg(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data11 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select avg(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data01
|
||||
if $data41 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select avg(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select avg(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select avg(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select avg(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select avg(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data11
|
||||
if $data11 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,97 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_bo_db
|
||||
$tbPrefix = m_bo_tb
|
||||
$mtPrefix = m_bo_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select bottom(tbcol, 1) from $tb
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select bottom(tbcol, 1) from $tb where ts > now + 4m
|
||||
print ===> $data01
|
||||
if $data01 != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select bottom(tbcol, 1) as b from $tb
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select bottom(tbcol, 2) as b from $tb
|
||||
print ===> $data01 $data11
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select bottom(tbcol, 2) as b from $tb where ts > now + 4m
|
||||
print ===> $data01 $data11
|
||||
if $data01 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select bottom(tbcol, 122) as b from $tb -x step6
|
||||
return -1
|
||||
step6:
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,172 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_co_db
|
||||
$tbPrefix = m_co_tb
|
||||
$mtPrefix = m_co_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
|
||||
sql select count(*) from $tb
|
||||
print ===> select count(*) from $tb => $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select count(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select count(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select count(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select count(*) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != $totalNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != $totalNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select count(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 100 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 25 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select count(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 200 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select count(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select count(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,89 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_di_db
|
||||
$tbPrefix = m_di_tb
|
||||
$mtPrefix = m_di_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select diff(tbcol) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select diff(tbcol) from $tb where ts > now + 4m
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select diff(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select diff(tbcol) as b from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select diff(tbcol) as b from $tb interval(1m) -x step5
|
||||
return -1
|
||||
step5:
|
||||
|
||||
print =============== step6
|
||||
sql select diff(tbcol) as b from $tb where ts < now + 4m interval(1m) -x step6
|
||||
return -1
|
||||
step6:
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,155 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_di_db
|
||||
$tbPrefix = m_di_tb
|
||||
$mtPrefix = m_di_mt
|
||||
$tbNum = 2
|
||||
$rowNum = 10000
|
||||
$totalNum = 20000
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 nchar(5), c9 binary(10)) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
$tinyint = $x / 128
|
||||
sql insert into $tb values (now + $ms , $x , $x , $x , $x , $tinyint , $x , $x , $x , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select diff(c1) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c2) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1.00000 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c3) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c4) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c5) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c6) from $tb
|
||||
print ===> $data11
|
||||
if $data11 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
sql_error select diff(c7) from $tb
|
||||
sql_error select diff(c8) from $tb
|
||||
sql_error select diff(c9) from $tb
|
||||
sql_error select diff(ts) from $tb
|
||||
sql_error select diff(c1), diff(c2) from $tb
|
||||
sql_error select 2+diff(c1) from $tb
|
||||
sql_error select diff(c1+2) from $tb
|
||||
sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m)
|
||||
sql_error select diff(c1) from $mt
|
||||
sql_error select diff(diff(c1)) from $tb
|
||||
sql_error select diff(c1) from m_di_tb1 where c2 like '2%'
|
||||
|
||||
|
||||
print =============== step3
|
||||
sql select diff(c1) from $tb where c1 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c2) from $tb where c2 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 1.00000 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c3) from $tb where c3 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c4) from $tb where c4 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c5) from $tb where c5 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select diff(c6) from $tb where c6 > 5
|
||||
print ===> $data11
|
||||
if $data11 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
print ===> $data11
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select diff(c1) as b from $tb interval(1m) -x step5
|
||||
return -1
|
||||
step5:
|
||||
|
||||
print =============== step6
|
||||
sql select diff(c1) as b from $tb where ts < now + 4m interval(1m) -x step6
|
||||
return -1
|
||||
step6:
|
||||
|
||||
print =============== clear
|
||||
#sql drop database $db
|
||||
#sql show databases
|
||||
#if $rows != 0 then
|
||||
# return -1
|
||||
#endi
|
|
@ -0,0 +1,158 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_fi_db
|
||||
$tbPrefix = m_fi_tb
|
||||
$mtPrefix = m_fi_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select first(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select first(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select first(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select first(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select first(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data01
|
||||
if $data41 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select first(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select first(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select first(tbcol) as b from $mt interval(1m)
|
||||
print select first(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select first(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select first(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
print ===> $rows
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,174 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_in_db
|
||||
$tbPrefix = m_in_tb
|
||||
$mtPrefix = m_in_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb interval(1m)
|
||||
print ===> $rows
|
||||
if $rows < $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $rows
|
||||
if $rows > 10 then
|
||||
return -1
|
||||
endi
|
||||
if $rows < 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now-1m interval(1m)
|
||||
print ===> $rows
|
||||
if $rows < 18 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now+1m interval(1m) fill(value,0)
|
||||
print ===> $rows
|
||||
if $rows < 30 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 50 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt interval(1m)
|
||||
print ===> $rows
|
||||
if $rows < 18 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 > 15 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 < 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now + 4m interval(1m)
|
||||
print ===> $rows
|
||||
if $rows < 3 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 7 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 > 15 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 < 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now-1m interval(1m)
|
||||
print ===> $rows
|
||||
if $rows < 18 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 > 15 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 < 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now+1m interval(1m) fill(value, 0)
|
||||
if $rows < 30 then
|
||||
return -1
|
||||
endi
|
||||
if $rows > 50 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 > 15 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 < 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,157 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_la_db
|
||||
$tbPrefix = m_la_tb
|
||||
$mtPrefix = m_la_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select last(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select last(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select last(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select last(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select last(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select last(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select last(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select last(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select last(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select last(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
print ===> $rows
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,98 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_le_db
|
||||
$tbPrefix = m_le_tb
|
||||
$mtPrefix = m_le_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db keep 36500
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 2
|
||||
$ms = 1000
|
||||
while $x < $rowNum
|
||||
$ms = $ms + 1000
|
||||
sql insert into $tb values ($ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select leastsquares(tbcol, 1, 1) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select leastsquares(tbcol, 1, 1) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != @(1.000000, 1.000000)@ then
|
||||
return -1
|
||||
endi
|
||||
print ===> $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,157 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_ma_db
|
||||
$tbPrefix = m_ma_tb
|
||||
$mtPrefix = m_ma_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select max(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select max(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select max(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select max(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select max(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select max(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select max(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select max(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select max(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select max(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select max(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select max(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select max(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select max(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
print ===> $rows
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,158 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_mi_db
|
||||
$tbPrefix = m_mi_tb
|
||||
$mtPrefix = m_mi_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select min(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select min(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select min(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select min(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select min(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select min(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select min(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select min(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select min(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select min(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select min(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select min(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select min(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select min(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
print ===> $rows
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,225 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = db
|
||||
$tbPrefix = tb
|
||||
$mtPrefix = mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int, tbcol2 int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
|
||||
$v1 = $x
|
||||
$v2 = $x
|
||||
if $x == 0 then
|
||||
$v1 = NULL
|
||||
endi
|
||||
sql insert into $tb values (now + $ms , $v1 , $v2 )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select * from $tb
|
||||
print $data00 $data01 $data02
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol), count(tbcol2), avg(tbcol), avg(tbcol2), sum(tbcol), sum(tbcol2) from $tb
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
if $data00 != 19 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 10.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 190 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 190 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select * from $tb where tbcol2 = 19
|
||||
print ===> $data01 $data02
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from $tb where tbcol = NULL -x step3
|
||||
return -1
|
||||
step3:
|
||||
|
||||
print =============== step5
|
||||
sql create table $tb using $mt tags( NULL )
|
||||
# return -1
|
||||
#step51:
|
||||
|
||||
#sql alter table $tb set tgcol=NULL -x step52
|
||||
# return -1
|
||||
#step52:
|
||||
|
||||
sql select * from $mt where tgcol = NULL -x step5
|
||||
return -1
|
||||
step5:
|
||||
|
||||
print =============== step6
|
||||
sql select count(tbcol), count(tbcol2), avg(tbcol), avg(tbcol2), sum(tbcol), sum(tbcol2) from $mt
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
if $data00 != 190 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 200 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 10.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 9.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1900 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1900 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql create table t1 (ts timestamp, i bool)
|
||||
sql create table t2 (ts timestamp, i smallint)
|
||||
sql create table t3 (ts timestamp, i tinyint)
|
||||
sql create table t4 (ts timestamp, i int)
|
||||
sql create table t5 (ts timestamp, i bigint)
|
||||
sql create table t6 (ts timestamp, i float)
|
||||
sql create table t7 (ts timestamp, i double)
|
||||
sql create table t8 (ts timestamp, i binary(10))
|
||||
sql insert into t1 values(now, NULL)
|
||||
sql insert into t2 values(now, NULL)
|
||||
sql insert into t3 values(now, NULL)
|
||||
sql insert into t4 values(now, NULL)
|
||||
sql insert into t5 values(now, NULL)
|
||||
sql insert into t6 values(now, NULL)
|
||||
sql insert into t7 values(now, NULL)
|
||||
#sql insert into t8 values(now, NULL)
|
||||
|
||||
#sql select * from t1
|
||||
#if $rows != 1 then
|
||||
# return -1
|
||||
#endi
|
||||
#if $data01 != NULL then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
sql select * from t2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from t3
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from t4
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from t5
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from t6
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from t7
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != null then
|
||||
return -1
|
||||
endi
|
||||
|
||||
#sql select * from t8
|
||||
#if $rows != 1 then
|
||||
# return -1
|
||||
#endi
|
||||
#if $data01 != null then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,114 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_pe_db
|
||||
$tbPrefix = m_pe_tb
|
||||
$mtPrefix = m_pe_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select percentile(tbcol, 10) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 1.900000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 20) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 3.800000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 100) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 19.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 110) from $tb -x step2
|
||||
return -1
|
||||
step2:
|
||||
|
||||
print =============== step3
|
||||
sql select percentile(tbcol, 1) from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.140000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 5) from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.700000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 0) from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select percentile(tbcol, 1) as c from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.140000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 5) as c from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.700000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select percentile(tbcol, 0) as c from $tb where ts > now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 5.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,96 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_st_db
|
||||
$tbPrefix = m_st_tb
|
||||
$mtPrefix = m_st_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select stddev(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 5.766281297 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select stddev(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 1.414213562 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select stddev(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 5.766281297 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select stddev(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select stddev(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 5.766281297 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select stddev(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,157 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_su_db
|
||||
$tbPrefix = m_su_tb
|
||||
$mtPrefix = m_su_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select sum(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 190 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select sum(tbcol) from $tb where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select sum(tbcol) as b from $tb
|
||||
print ===> $data00
|
||||
if $data00 != 190 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select sum(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select sum(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 190 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select sum(tbcol) as b from $tb where ts < now + 4m interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
sql select sum(tbcol) from $mt
|
||||
print ===> $data00
|
||||
if $data00 != 1900 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select sum(tbcol) as c from $mt where ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 100 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select sum(tbcol) as c from $mt where tgcol < 5
|
||||
print ===> $data00
|
||||
if $data00 != 950 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select sum(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
|
||||
print ===> $data00
|
||||
if $data00 != 50 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step9
|
||||
sql select sum(tbcol) as b from $mt interval(1m)
|
||||
print ===> $data11
|
||||
if $data11 < 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select sum(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != 1900 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step10
|
||||
sql select sum(tbcol) as b from $mt group by tgcol
|
||||
print ===> $data00
|
||||
if $data00 != 190 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step11
|
||||
sql select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
|
||||
print select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
|
||||
print ===> $data01
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
|
@ -0,0 +1,16 @@
|
|||
run general/compute/count.sim
|
||||
run general/compute/avg.sim
|
||||
run general/compute/sum.sim
|
||||
run general/compute/min.sim
|
||||
run general/compute/max.sim
|
||||
run general/compute/first.sim
|
||||
run general/compute/last.sim
|
||||
run general/compute/stddev.sim
|
||||
run general/compute/leastsquare.sim
|
||||
run general/compute/top.sim
|
||||
run general/compute/bottom.sim
|
||||
run general/compute/percentile.sim
|
||||
run general/compute/diff.sim
|
||||
run general/compute/interval.sim
|
||||
run general/compute/null.sim
|
||||
run general/compute/diff2.sim
|
|
@ -0,0 +1,97 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/ip.sh -i 1 -s up
|
||||
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_to_db
|
||||
$tbPrefix = m_to_tb
|
||||
$mtPrefix = m_to_mt
|
||||
$tbNum = 10
|
||||
$rowNum = 20
|
||||
$totalNum = 200
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix . $i
|
||||
$mt = $mtPrefix . $i
|
||||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
|
||||
$i = 0
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sleep 100
|
||||
|
||||
print =============== step2
|
||||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select top(tbcol, 1) from $tb
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select top(tbcol, 1) from $tb where ts < now + 4m
|
||||
print ===> $data01
|
||||
if $data01 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql select top(tbcol, 1) as b from $tb
|
||||
print ===> $data01
|
||||
if $data01 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step5
|
||||
sql select top(tbcol, 2) as b from $tb
|
||||
print ===> $data01 $data11
|
||||
if $data01 != 18 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 19 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select top(tbcol, 2) as b from $tb where ts < now + 4m
|
||||
print ===> $data01 $data11
|
||||
if $data01 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select top(tbcol, 122) as b from $tb -x step6
|
||||
return -1
|
||||
step6:
|
||||
|
||||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue