Merge branch '3.0' into feature/3_liaohj
This commit is contained in:
commit
63d5fd4ef2
|
@ -2,7 +2,7 @@
|
|||
# taos-tools
|
||||
ExternalProject_Add(taos-tools
|
||||
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
||||
GIT_TAG 7e9ce09
|
||||
GIT_TAG 2aac500
|
||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
||||
BINARY_DIR ""
|
||||
#BUILD_IN_SOURCE TRUE
|
||||
|
|
|
@ -1249,4 +1249,4 @@ SELECT SERVER_VERSION();
|
|||
SELECT SERVER_STATUS();
|
||||
```
|
||||
|
||||
**说明**:返回服务端当前的状态。
|
||||
**说明**:检测服务端是否所有 dnode 都在线,如果是则返回成功,否则返回无法建立连接的错误。
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.17.1</version>
|
||||
<version>2.17.2</version>
|
||||
</dependency>
|
||||
<!-- junit -->
|
||||
<dependency>
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
cd tests/examples/JDBC/taosdemo
|
||||
mvn clean package -Dmaven.test.skip=true
|
||||
# 先建表,再插入的
|
||||
java -jar target/taosdemo-2.0.1-jar-with-dependencies.jar -host [hostname] -database [database] -doCreateTable true -superTableSQL "create table weather(ts timestamp, f1 int) tags(t1 nchar(4))" -numOfTables 1000 -numOfRowsPerTable 100000000 -numOfThreadsForInsert 10 -numOfTablesPerSQL 10 -numOfValuesPerSQL 100
|
||||
java -jar target/taosdemo-2.0.1-jar-with-dependencies.jar -host <hostname> -database <db name> -doCreateTable true -superTableSQL "create table weather(ts timestamp, f1 int) tags(t1 nchar(4))" -numOfTables 1000 -numOfRowsPerTable 100000000 -numOfThreadsForInsert 10 -numOfTablesPerSQL 10 -numOfValuesPerSQL 100
|
||||
# 不建表,直接插入的
|
||||
java -jar target/taosdemo-2.0.1-jar-with-dependencies.jar -host [hostname] -database [database] -doCreateTable false -superTableSQL "create table weather(ts timestamp, f1 int) tags(t1 nchar(4))" -numOfTables 1000 -numOfRowsPerTable 100000000 -numOfThreadsForInsert 10 -numOfTablesPerSQL 10 -numOfValuesPerSQL 100
|
||||
java -jar target/taosdemo-2.0.1-jar-with-dependencies.jar -host <hostname> -database <db name> -doCreateTable false -superTableSQL "create table weather(ts timestamp, f1 int) tags(t1 nchar(4))" -numOfTables 1000 -numOfRowsPerTable 100000000 -numOfThreadsForInsert 10 -numOfTablesPerSQL 10 -numOfValuesPerSQL 100
|
||||
```
|
||||
|
||||
需求:
|
||||
1. 可以读lowa的配置文件
|
||||
2. 支持JDBC-JNI和JDBC-restful
|
||||
3. 读取配置文件,持续执行查询
|
||||
如果发生错误 Exception in thread "main" java.lang.UnsatisfiedLinkError: no taos in java.library.path
|
||||
请检查是否安装 TDengine 客户端安装包或编译 TDengine 安装。如果确定已经安装过还出现这个错误,可以在命令行 java 后加 -Djava.library.path=/usr/local/lib 来指定寻找共享库的路径。
|
||||
|
|
|
@ -29,7 +29,7 @@ struct SMetaData;
|
|||
typedef struct SStmtCallback {
|
||||
TAOS_STMT* pStmt;
|
||||
int32_t (*getTbNameFn)(TAOS_STMT*, char**);
|
||||
int32_t (*setInfoFn)(TAOS_STMT*, STableMeta*, void*, char*, bool, SHashObj*, SHashObj*, const char*);
|
||||
int32_t (*setInfoFn)(TAOS_STMT*, STableMeta*, void*, SName*, bool, SHashObj*, SHashObj*, const char*);
|
||||
int32_t (*getExecInfoFn)(TAOS_STMT*, SHashObj**, SHashObj**);
|
||||
} SStmtCallback;
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ typedef enum ELogicConditionType {
|
|||
#ifdef WINDOWS
|
||||
#define TSDB_MAX_RPC_THREADS 4 // windows pipe only support 4 connections.
|
||||
#else
|
||||
#define TSDB_MAX_RPC_THREADS 10
|
||||
#define TSDB_MAX_RPC_THREADS 20
|
||||
#endif
|
||||
|
||||
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
|
||||
|
|
|
@ -120,20 +120,20 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
done
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb
|
||||
bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
}
|
||||
|
@ -152,20 +152,20 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
done
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb
|
||||
bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb
|
||||
python3 checkPackageRuning.py
|
||||
dpkg -r tdengine
|
||||
'''
|
||||
|
@ -185,20 +185,20 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
done
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm
|
||||
bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
}
|
||||
|
@ -217,20 +217,20 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
done
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
'''
|
||||
|
||||
sh '''
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm
|
||||
bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t rpm
|
||||
python3 checkPackageRuning.py
|
||||
sudo rpm -e tdengine
|
||||
'''
|
||||
|
@ -250,7 +250,7 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f server -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
bash testpackage.sh -m ${verModeSin} -f server -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
done
|
||||
'''
|
||||
|
@ -273,10 +273,9 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
bash testpackage.sh -m ${verModeSin} -f client -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py 192.168.0.21
|
||||
done
|
||||
python3 checkPackageRuning.py 192.168.0.21
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
@ -286,10 +285,8 @@ pipeline {
|
|||
steps {
|
||||
timeout(time: 30, unit: 'MINUTES'){
|
||||
sh '''
|
||||
verModeList=community
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
bash testpackage.sh -m community -f client -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py 192.168.0.24
|
||||
'''
|
||||
}
|
||||
|
@ -309,10 +306,9 @@ pipeline {
|
|||
for verModeSin in ${verModeList}
|
||||
do
|
||||
cd ${TDENGINE_ROOT_DIR}/packaging
|
||||
bash testpackage.sh -f server -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py
|
||||
bash testpackage.sh -m ${verModeSin} -f client -l false -c arm64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
|
||||
python3 checkPackageRuning.py 192.168.0.21
|
||||
done
|
||||
python3 checkPackageRuning.py 192.168.0.21
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,6 +206,10 @@ else
|
|||
fi
|
||||
|
||||
|
||||
if [[ ${packgeName} =~ "server" ]] ;then
|
||||
echoColor BD " pkill -9 taosd "
|
||||
pkill -9 taosd
|
||||
fi
|
||||
|
||||
|
||||
echoColor G "===== new workroom path ====="
|
||||
|
@ -334,7 +338,7 @@ elif ([[ ${packgeName} =~ "arm64" ]] && [[ ${packgeName} =~ "client" ]]);then
|
|||
echoColor G "===== install taos-tools arm when package is arm64-client ====="
|
||||
cd ${installPath}
|
||||
if [ ! -f "taosTools-2.1.3-Linux-x64.tar.gz " ];then
|
||||
wgetFile taosTools-2.1.3-Linux-x64.tar.gz v2.1.3 web
|
||||
wgetFile taosTools-2.1.3-Linux-arm64.tar.gz v2.1.3 web
|
||||
tar xf taosTools-2.1.3-Linux-arm64.tar.gz
|
||||
fi
|
||||
|
||||
|
|
|
@ -205,6 +205,7 @@ function set_hostname() {
|
|||
break
|
||||
else
|
||||
read -p "Please enter one hostname(must not be 'localhost'):" newHostname
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -324,7 +325,9 @@ function local_fqdn_check() {
|
|||
;;
|
||||
|
||||
*)
|
||||
set_ipAsFqdn
|
||||
echo "Invalid input..."
|
||||
break
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
|
|
@ -51,7 +51,7 @@ Source: taos.bat; DestDir: "{app}\include"; Flags: igNoreversion;
|
|||
;Source: taosdemo.png; DestDir: "{app}\include"; Flags: igNoreversion;
|
||||
;Source: taosShell.png; DestDir: "{app}\include"; Flags: igNoreversion;
|
||||
Source: favicon.ico; DestDir: "{app}\include"; Flags: igNoreversion;
|
||||
Source: {#MyAppSourceDir}{#MyAppDLLName}; DestDir: "{win}\System32"; Flags: 64bit;Check:IsWin64;
|
||||
Source: {#MyAppSourceDir}{#MyAppDLLName}; DestDir: "{win}\System32"; Flags: igNoreversion recursesubdirs createallsubdirs 64bit;Check:IsWin64;
|
||||
Source: {#MyAppSourceDir}{#MyAppCfgName}; DestDir: "{app}\cfg"; Flags: igNoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
|
||||
Source: {#MyAppSourceDir}{#MyAppDriverName}; DestDir: "{app}\driver"; Flags: igNoreversion recursesubdirs createallsubdirs
|
||||
;Source: {#MyAppSourceDir}{#MyAppConnectorName}; DestDir: "{app}\connector"; Flags: igNoreversion recursesubdirs createallsubdirs
|
||||
|
|
|
@ -131,7 +131,7 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas
|
|||
p = taosMemoryCalloc(1, sizeof(struct SAppInstInfo));
|
||||
p->mgmtEp = epSet;
|
||||
taosThreadMutexInit(&p->qnodeMutex, NULL);
|
||||
p->pTransporter = openTransporter(user, secretEncrypt, tsNumOfCores);
|
||||
p->pTransporter = openTransporter(user, secretEncrypt, tsNumOfCores / 2);
|
||||
p->pAppHbMgr = appHbMgrInit(p, key);
|
||||
if (NULL == p->pAppHbMgr) {
|
||||
destroyAppInst(p);
|
||||
|
@ -2293,10 +2293,16 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) {
|
|||
|
||||
taosAsyncQueryImpl(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly);
|
||||
tsem_wait(¶m->sem);
|
||||
|
||||
SRequestObj *pRequest = NULL;
|
||||
if (param->pRequest != NULL) {
|
||||
param->pRequest->syncQuery = true;
|
||||
pRequest = param->pRequest;
|
||||
} else {
|
||||
taosMemoryFree(param);
|
||||
}
|
||||
return param->pRequest;
|
||||
|
||||
return pRequest;
|
||||
}
|
||||
|
||||
TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly, int64_t reqid) {
|
||||
|
@ -2310,8 +2316,14 @@ TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly,
|
|||
|
||||
taosAsyncQueryImplWithReqid(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly, reqid);
|
||||
tsem_wait(¶m->sem);
|
||||
|
||||
SRequestObj *pRequest = NULL;
|
||||
if (param->pRequest != NULL) {
|
||||
param->pRequest->syncQuery = true;
|
||||
pRequest = param->pRequest;
|
||||
} else {
|
||||
taosMemoryFree(param);
|
||||
}
|
||||
return param->pRequest;
|
||||
|
||||
return pRequest;
|
||||
}
|
||||
|
|
|
@ -152,9 +152,12 @@ int32_t stmtRestoreQueryFields(STscStmt* pStmt) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char* tbFName, const char* sTableName, bool autoCreateTbl) {
|
||||
int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, SName* tbName, const char* sTableName, bool autoCreateTbl) {
|
||||
STscStmt* pStmt = (STscStmt*)stmt;
|
||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||
tNameExtractFullName(tbName, tbFName);
|
||||
|
||||
memcpy(&pStmt->bInfo.sname, tbName, sizeof(*tbName));
|
||||
strncpy(pStmt->bInfo.tbFName, tbFName, sizeof(pStmt->bInfo.tbFName) - 1);
|
||||
pStmt->bInfo.tbFName[sizeof(pStmt->bInfo.tbFName) - 1] = 0;
|
||||
|
||||
|
@ -178,11 +181,11 @@ int32_t stmtUpdateExecInfo(TAOS_STMT* stmt, SHashObj* pVgHash, SHashObj* pBlockH
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t stmtUpdateInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char* tbFName, bool autoCreateTbl,
|
||||
int32_t stmtUpdateInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, SName* tbName, bool autoCreateTbl,
|
||||
SHashObj* pVgHash, SHashObj* pBlockHash, const char* sTableName) {
|
||||
STscStmt* pStmt = (STscStmt*)stmt;
|
||||
|
||||
STMT_ERR_RET(stmtUpdateBindInfo(stmt, pTableMeta, tags, tbFName, sTableName, autoCreateTbl));
|
||||
STMT_ERR_RET(stmtUpdateBindInfo(stmt, pTableMeta, tags, tbName, sTableName, autoCreateTbl));
|
||||
STMT_ERR_RET(stmtUpdateExecInfo(stmt, pVgHash, pBlockHash, autoCreateTbl));
|
||||
|
||||
pStmt->sql.autoCreateTbl = autoCreateTbl;
|
||||
|
@ -773,7 +776,9 @@ int stmtAddBatch(TAOS_STMT* stmt) {
|
|||
int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
|
||||
tscDebug("stmt start to update tbUid, blockNum: %d", pRsp->nBlocks);
|
||||
|
||||
size_t keyLen = 0;
|
||||
int32_t code = 0;
|
||||
int32_t finalCode = 0;
|
||||
size_t keyLen = 0;
|
||||
STableDataBlocks** pIter = taosHashIterate(pStmt->exec.pBlockHash, NULL);
|
||||
while (pIter) {
|
||||
STableDataBlocks* pBlock = *pIter;
|
||||
|
@ -809,10 +814,20 @@ int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
|
|||
} else {
|
||||
tscDebug("table %s not found in submit rsp, will update from catalog", pStmt->bInfo.tbFName);
|
||||
if (NULL == pStmt->pCatalog) {
|
||||
STMT_ERR_RET(catalogGetHandle(pStmt->taos->pAppInfo->clusterId, &pStmt->pCatalog));
|
||||
code = catalogGetHandle(pStmt->taos->pAppInfo->clusterId, &pStmt->pCatalog);
|
||||
if (code) {
|
||||
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
||||
finalCode = code;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
STMT_ERR_RET(stmtCreateRequest(pStmt));
|
||||
code = stmtCreateRequest(pStmt);
|
||||
if (code) {
|
||||
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
||||
finalCode = code;
|
||||
continue;
|
||||
}
|
||||
|
||||
STableMeta* pTableMeta = NULL;
|
||||
SRequestConnInfo conn = {.pTrans = pStmt->taos->pAppInfo->pTransporter,
|
||||
|
@ -824,19 +839,22 @@ int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
|
|||
taos_free_result(pStmt->exec.pRequest);
|
||||
pStmt->exec.pRequest = NULL;
|
||||
|
||||
if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code) {
|
||||
tscDebug("tb %s not exist", pStmt->bInfo.tbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
if (code || NULL == pTableMeta) {
|
||||
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
||||
finalCode = code;
|
||||
taosMemoryFree(pTableMeta);
|
||||
continue;
|
||||
}
|
||||
|
||||
pMeta->uid = pTableMeta->uid;
|
||||
pStmt->bInfo.tbUid = pTableMeta->uid;
|
||||
taosMemoryFree(pTableMeta);
|
||||
}
|
||||
|
||||
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
return finalCode;
|
||||
}
|
||||
|
||||
int stmtExec(TAOS_STMT* stmt) {
|
||||
|
|
|
@ -308,6 +308,9 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
|
||||
tsNumOfTaskQueueThreads = tsNumOfCores / 2;
|
||||
tsNumOfTaskQueueThreads = TMAX(tsNumOfTaskQueueThreads, 4);
|
||||
if (tsNumOfTaskQueueThreads >= 10) {
|
||||
tsNumOfTaskQueueThreads = 10;
|
||||
}
|
||||
if (cfgAddInt32(pCfg, "numOfTaskQueueThreads", tsNumOfTaskQueueThreads, 4, 1024, 0) != 0) return -1;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -250,7 +250,7 @@ int32_t dmInitClient(SDnode *pDnode) {
|
|||
|
||||
SRpcInit rpcInit = {0};
|
||||
rpcInit.label = "DND-C";
|
||||
rpcInit.numOfThreads = 4;
|
||||
rpcInit.numOfThreads = tsNumOfRpcThreads;
|
||||
rpcInit.cfp = (RpcCfp)dmProcessRpcMsg;
|
||||
rpcInit.sessions = 1024;
|
||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||
|
|
|
@ -219,12 +219,12 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
|
|||
SDB_GET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER)
|
||||
taosInitRWLatch(&pDb->lock);
|
||||
|
||||
if (pDb->cfg.tsdbPageSize <= TSDB_MIN_TSDB_PAGESIZE) {
|
||||
if (pDb->cfg.tsdbPageSize != TSDB_MIN_TSDB_PAGESIZE) {
|
||||
mInfo("db:%s, tsdbPageSize set from %d to default %d", pDb->name, pDb->cfg.tsdbPageSize,
|
||||
TSDB_DEFAULT_TSDB_PAGESIZE);
|
||||
}
|
||||
|
||||
if (pDb->cfg.sstTrigger <= TSDB_MIN_STT_TRIGGER) {
|
||||
if (pDb->cfg.sstTrigger != TSDB_MIN_STT_TRIGGER) {
|
||||
mInfo("db:%s, sstTrigger set from %d to default %d", pDb->name, pDb->cfg.sstTrigger, TSDB_DEFAULT_SST_TRIGGER);
|
||||
}
|
||||
|
||||
|
|
|
@ -803,12 +803,12 @@ void mndSetRestored(SMnode *pMnode, bool restored) {
|
|||
taosThreadRwlockWrlock(&pMnode->lock);
|
||||
pMnode->restored = true;
|
||||
taosThreadRwlockUnlock(&pMnode->lock);
|
||||
mTrace("mnode set restored:%d", restored);
|
||||
mInfo("mnode set restored:%d", restored);
|
||||
} else {
|
||||
taosThreadRwlockWrlock(&pMnode->lock);
|
||||
pMnode->restored = false;
|
||||
taosThreadRwlockUnlock(&pMnode->lock);
|
||||
mTrace("mnode set restored:%d", restored);
|
||||
mInfo("mnode set restored:%d", restored);
|
||||
while (1) {
|
||||
if (pMnode->rpcRef <= 0) break;
|
||||
taosMsleep(3);
|
||||
|
@ -822,7 +822,7 @@ void mndSetStop(SMnode *pMnode) {
|
|||
taosThreadRwlockWrlock(&pMnode->lock);
|
||||
pMnode->stopped = true;
|
||||
taosThreadRwlockUnlock(&pMnode->lock);
|
||||
mTrace("mnode set stopped");
|
||||
mInfo("mnode set stopped");
|
||||
}
|
||||
|
||||
bool mndGetStop(SMnode *pMnode) { return pMnode->stopped; }
|
||||
|
|
|
@ -525,6 +525,7 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre
|
|||
|
||||
tFreeSMCreateStbReq(&createReq);
|
||||
mndFreeStb(&stbObj);
|
||||
mndReleaseStb(pMnode, pStb);
|
||||
mndReleaseDb(pMnode, pDb);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -434,6 +434,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
|
|||
return -1;
|
||||
}
|
||||
topicObj.stbUid = pStb->uid;
|
||||
mndReleaseStb(pMnode, pStb);
|
||||
}
|
||||
/*} else if (pCreate->subType == TOPIC_SUB_TYPE__DB) {*/
|
||||
/*topicObj.ast = NULL;*/
|
||||
|
|
|
@ -1084,10 +1084,10 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
|
|||
if (!force) {
|
||||
mInfo("vgId:%d, will add 1 vnode", pVgroup->vgId);
|
||||
if (mndAddVnodeToVgroup(pMnode, &newVg, pArray) != 0) return -1;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1;
|
||||
for (int32_t i = 0; i < newVg.replica - 1; ++i) {
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1;
|
||||
}
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1;
|
||||
|
||||
mInfo("vgId:%d, will remove 1 vnode", pVgroup->vgId);
|
||||
|
@ -1108,12 +1108,12 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
|
|||
newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica];
|
||||
memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid));
|
||||
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1;
|
||||
for (int32_t i = 0; i < newVg.replica; ++i) {
|
||||
if (i != vnIndex) {
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1;
|
||||
}
|
||||
}
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1;
|
||||
|
||||
if (newVg.replica == 1) {
|
||||
|
@ -1190,10 +1190,10 @@ static int32_t mndAddIncVgroupReplicaToTrans(SMnode *pMnode, STrans *pTrans, SDb
|
|||
pGid->dnodeId = newDnodeId;
|
||||
pGid->syncState = TAOS_SYNC_STATE_ERROR;
|
||||
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1;
|
||||
for (int32_t i = 0; i < pVgroup->replica - 1; ++i) {
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, pVgroup, pVgroup->vnodeGid[i].dnodeId) != 0) return -1;
|
||||
}
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1;
|
||||
|
||||
return 0;
|
||||
|
@ -1589,11 +1589,16 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb
|
|||
pVgroup->vnodeGid[0].dnodeId);
|
||||
|
||||
if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1;
|
||||
if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0)
|
||||
return -1;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1;
|
||||
|
||||
if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0)
|
||||
return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0)
|
||||
return -1;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1;
|
||||
} else if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) {
|
||||
|
@ -1603,9 +1608,14 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb
|
|||
SVnodeGid del1 = {0};
|
||||
SVnodeGid del2 = {0};
|
||||
if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del1) != 0) return -1;
|
||||
if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1;
|
||||
if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0)
|
||||
return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0)
|
||||
return -1;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1;
|
||||
|
||||
if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1;
|
||||
if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0)
|
||||
return -1;
|
||||
|
@ -1662,15 +1672,15 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj
|
|||
|
||||
if (newVg1.replica == 1) {
|
||||
if (mndAddVnodeToVgroup(pMnode, &newVg1, pArray) != 0) goto _OVER;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[0].dnodeId) != 0) goto _OVER;
|
||||
if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER;
|
||||
} else if (newVg1.replica == 3) {
|
||||
SVnodeGid del1 = {0};
|
||||
if (mndRemoveVnodeFromVgroup(pMnode, &newVg1, pArray, &del1) != 0) goto _OVER;
|
||||
if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[0].dnodeId) != 0) goto _OVER;
|
||||
if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[1].dnodeId) != 0) goto _OVER;
|
||||
if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER;
|
||||
if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER;
|
||||
} else {
|
||||
goto _OVER;
|
||||
|
|
|
@ -299,7 +299,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp
|
|||
taosArrayDestroyP(pSchemas, (FDelete)tDeleteSSchemaWrapper);
|
||||
pBlocks = taosArrayInit(0, sizeof(SSDataBlock));
|
||||
pSchemas = taosArrayInit(0, sizeof(void*));
|
||||
return -1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (pHandle->fetchMeta) {
|
||||
|
|
|
@ -61,6 +61,7 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) {
|
|||
ASSERT(0);
|
||||
// TODO
|
||||
}
|
||||
taosMemoryFree(memBuf);
|
||||
}
|
||||
|
||||
taosCloseFile(&pFile);
|
||||
|
|
|
@ -1205,7 +1205,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
|
|||
stbCtx.pName = &stbName;
|
||||
|
||||
STableMeta* stbMeta = NULL;
|
||||
ctgReadTbMetaFromCache(pCtg, &stbCtx, &stbMeta);
|
||||
(void)ctgReadTbMetaFromCache(pCtg, &stbCtx, &stbMeta);
|
||||
if (stbMeta && stbMeta->sversion >= pOut->tbMeta->sversion) {
|
||||
ctgDebug("use cached stb meta, tbName:%s", tNameGetTableName(pName));
|
||||
exist = 1;
|
||||
|
|
|
@ -270,10 +270,10 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
|
|||
"CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm "
|
||||
"WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
|
||||
"STRICT '%s' WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d",
|
||||
dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod,
|
||||
pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, pCfg->pages,
|
||||
pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, pCfg->numOfVgroups,
|
||||
1 == pCfg->numOfStables);
|
||||
dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile,
|
||||
pCfg->walFsyncPeriod, pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2,
|
||||
pCfg->pages, pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel,
|
||||
pCfg->numOfVgroups, 1 == pCfg->numOfStables);
|
||||
|
||||
if (retentions) {
|
||||
len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, " RETENTIONS %s", retentions);
|
||||
|
@ -501,7 +501,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p
|
|||
return terrno;
|
||||
}
|
||||
|
||||
int32_t len = 0;
|
||||
int32_t len = 0;
|
||||
|
||||
if (TSDB_SUPER_TABLE == pCfg->tableType) {
|
||||
len += sprintf(buf2 + VARSTR_HEADER_SIZE, "CREATE STABLE `%s` (", tbName);
|
||||
|
@ -691,9 +691,15 @@ static int32_t createSelectResultDataBlock(SNodeList* pProjects, SSDataBlock** p
|
|||
|
||||
SNode* pProj = NULL;
|
||||
FOREACH(pProj, pProjects) {
|
||||
SExprNode* pExpr = (SExprNode*)pProj;
|
||||
SColumnInfoData infoData = {0};
|
||||
infoData.info.type = ((SExprNode*)pProj)->resType.type;
|
||||
infoData.info.bytes = ((SExprNode*)pProj)->resType.bytes;
|
||||
if (TSDB_DATA_TYPE_NULL == pExpr->resType.type) {
|
||||
infoData.info.type = TSDB_DATA_TYPE_VARCHAR;
|
||||
infoData.info.bytes = 0;
|
||||
} else {
|
||||
infoData.info.type = pExpr->resType.type;
|
||||
infoData.info.bytes = pExpr->resType.bytes;
|
||||
}
|
||||
blockDataAppendColInfo(pBlock, &infoData);
|
||||
}
|
||||
*pOutput = pBlock;
|
||||
|
|
|
@ -782,13 +782,18 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
|
|||
}
|
||||
case QUERY_NODE_PHYSICAL_PLAN_EXCHANGE: {
|
||||
SExchangePhysiNode *pExchNode = (SExchangePhysiNode *)pNode;
|
||||
SExplainGroup *group = taosHashGet(ctx->groupHash, &pExchNode->srcStartGroupId, sizeof(pExchNode->srcStartGroupId));
|
||||
if (NULL == group) {
|
||||
qError("exchange src group %d not in groupHash", pExchNode->srcStartGroupId);
|
||||
QRY_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
||||
int32_t nodeNum = 0;
|
||||
for (int32_t i = pExchNode->srcStartGroupId; i <= pExchNode->srcEndGroupId; ++i) {
|
||||
SExplainGroup *group = taosHashGet(ctx->groupHash, &pExchNode->srcStartGroupId, sizeof(pExchNode->srcStartGroupId));
|
||||
if (NULL == group) {
|
||||
qError("exchange src group %d not in groupHash", pExchNode->srcStartGroupId);
|
||||
QRY_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
||||
}
|
||||
|
||||
nodeNum += group->nodeNum;
|
||||
}
|
||||
|
||||
EXPLAIN_ROW_NEW(level, EXPLAIN_EXCHANGE_FORMAT, pExchNode->singleChannel ? 1 : group->nodeNum);
|
||||
EXPLAIN_ROW_NEW(level, EXPLAIN_EXCHANGE_FORMAT, pExchNode->singleChannel ? 1 : nodeNum);
|
||||
EXPLAIN_ROW_APPEND(EXPLAIN_LEFT_PARENTHESIS_FORMAT);
|
||||
if (pResNode->pExecInfo) {
|
||||
QRY_ERR_RET(qExplainBufAppendExecInfo(pResNode->pExecInfo, tbuf, &tlen));
|
||||
|
@ -819,7 +824,9 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
|
|||
}
|
||||
}
|
||||
|
||||
QRY_ERR_RET(qExplainAppendGroupResRows(ctx, pExchNode->srcStartGroupId, level + 1, pExchNode->singleChannel));
|
||||
for (int32_t i = pExchNode->srcStartGroupId; i <= pExchNode->srcEndGroupId; ++i) {
|
||||
QRY_ERR_RET(qExplainAppendGroupResRows(ctx, i, level + 1, pExchNode->singleChannel));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_PHYSICAL_PLAN_SORT: {
|
||||
|
|
|
@ -1282,7 +1282,9 @@ static void doStreamFillImpl(SOperatorInfo* pOperator) {
|
|||
blockDataCleanup(pInfo->pSrcBlock);
|
||||
}
|
||||
|
||||
static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlock* delRes) {
|
||||
static void buildDeleteRange(SOperatorInfo* pOp, TSKEY start, TSKEY end, uint64_t groupId, SSDataBlock* delRes) {
|
||||
SStreamState* pState = pOp->pTaskInfo->streamInfo.pState;
|
||||
|
||||
SSDataBlock* pBlock = delRes;
|
||||
SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX);
|
||||
SColumnInfoData* pEndCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX);
|
||||
|
@ -1290,25 +1292,42 @@ static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlo
|
|||
SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX);
|
||||
SColumnInfoData* pCalStartCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX);
|
||||
SColumnInfoData* pCalEndCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX);
|
||||
SColumnInfoData* pTbNameCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX);
|
||||
colDataAppend(pStartCol, pBlock->info.rows, (const char*)&start, false);
|
||||
colDataAppend(pEndCol, pBlock->info.rows, (const char*)&end, false);
|
||||
colDataAppendNULL(pUidCol, pBlock->info.rows);
|
||||
colDataAppend(pGroupCol, pBlock->info.rows, (const char*)&groupId, false);
|
||||
colDataAppendNULL(pCalStartCol, pBlock->info.rows);
|
||||
colDataAppendNULL(pCalEndCol, pBlock->info.rows);
|
||||
|
||||
SColumnInfoData* pTableCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX);
|
||||
|
||||
void* tbname = NULL;
|
||||
streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, groupId, &tbname);
|
||||
if (tbname == NULL) {
|
||||
colDataAppendNULL(pTableCol, pBlock->info.rows);
|
||||
} else {
|
||||
char parTbName[VARSTR_HEADER_SIZE + TSDB_TABLE_NAME_LEN];
|
||||
STR_WITH_MAXSIZE_TO_VARSTR(parTbName, tbname, sizeof(parTbName));
|
||||
colDataAppend(pTableCol, pBlock->info.rows, (const char*)parTbName, false);
|
||||
}
|
||||
tdbFree(tbname);
|
||||
|
||||
pBlock->info.rows++;
|
||||
}
|
||||
|
||||
static void buildDeleteResult(SStreamFillSupporter* pFillSup, TSKEY startTs, TSKEY endTs, uint64_t groupId,
|
||||
static void buildDeleteResult(SOperatorInfo* pOperator, TSKEY startTs, TSKEY endTs, uint64_t groupId,
|
||||
SSDataBlock* delRes) {
|
||||
SStreamFillOperatorInfo* pInfo = pOperator->info;
|
||||
SStreamFillSupporter* pFillSup = pInfo->pFillSup;
|
||||
if (hasPrevWindow(pFillSup)) {
|
||||
TSKEY start = getNextWindowTs(pFillSup->prev.key, &pFillSup->interval);
|
||||
buildDeleteRange(start, endTs, groupId, delRes);
|
||||
buildDeleteRange(pOperator, start, endTs, groupId, delRes);
|
||||
} else if (hasNextWindow(pFillSup)) {
|
||||
TSKEY end = getPrevWindowTs(pFillSup->next.key, &pFillSup->interval);
|
||||
buildDeleteRange(startTs, end, groupId, delRes);
|
||||
buildDeleteRange(pOperator, startTs, end, groupId, delRes);
|
||||
} else {
|
||||
buildDeleteRange(startTs, endTs, groupId, delRes);
|
||||
buildDeleteRange(pOperator, startTs, endTs, groupId, delRes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1319,7 +1338,7 @@ static void doDeleteFillResultImpl(SOperatorInfo* pOperator, TSKEY startTs, TSKE
|
|||
SWinKey key = {.ts = startTs, .groupId = groupId};
|
||||
if (!pInfo->pFillInfo->needFill) {
|
||||
streamStateFillDel(pOperator->pTaskInfo->streamInfo.pState, &key);
|
||||
buildDeleteResult(pInfo->pFillSup, startTs, endTs, groupId, pInfo->pDelRes);
|
||||
buildDeleteResult(pOperator, startTs, endTs, groupId, pInfo->pDelRes);
|
||||
} else {
|
||||
STimeRange tw = {
|
||||
.skey = startTs,
|
||||
|
@ -1715,9 +1734,9 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
|
|||
}
|
||||
|
||||
pInfo->srcRowIndex = 0;
|
||||
setOperatorInfo(pOperator, "StreamFillOperator", QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL, false, OP_NOT_OPENED, pInfo, pTaskInfo);
|
||||
pOperator->fpSet =
|
||||
createOperatorFpSet(operatorDummyOpenFn, doStreamFill, NULL, destroyStreamFillOperatorInfo, NULL);
|
||||
setOperatorInfo(pOperator, "StreamFillOperator", QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL, false, OP_NOT_OPENED, pInfo,
|
||||
pTaskInfo);
|
||||
pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamFill, NULL, destroyStreamFillOperatorInfo, NULL);
|
||||
|
||||
code = appendDownstream(pOperator, &downstream, 1);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
|
|
|
@ -1499,7 +1499,7 @@ int32_t leastSQRFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
|||
|
||||
param12 /= param[1][1];
|
||||
|
||||
char buf[64] = {0};
|
||||
char buf[512] = {0};
|
||||
size_t len =
|
||||
snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{slop:%.6lf, intercept:%.6lf}", param02, param12);
|
||||
varDataSetLen(buf, len);
|
||||
|
@ -3613,6 +3613,7 @@ bool histogramFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultIn
|
|||
char* binDesc = strndup(varDataVal(pCtx->param[2].param.pz), varDataLen(pCtx->param[2].param.pz));
|
||||
int64_t normalized = pCtx->param[3].param.i;
|
||||
if (normalized != 0 && normalized != 1) {
|
||||
taosMemoryFree(binDesc);
|
||||
return false;
|
||||
}
|
||||
if (!getHistogramBinDesc(pInfo, binDesc, binType, (bool)normalized)) {
|
||||
|
|
|
@ -654,7 +654,7 @@ cgroup_name(A) ::= NK_ID(B).
|
|||
|
||||
/************************************************ expression **********************************************************/
|
||||
expr_or_subquery(A) ::= expression(B). { A = B; }
|
||||
expr_or_subquery(A) ::= subquery(B). { A = B; }
|
||||
//expr_or_subquery(A) ::= subquery(B). { A = createTempTableNode(pCxt, releaseRawExprNode(pCxt, B), NULL); }
|
||||
|
||||
expression(A) ::= literal(B). { A = B; }
|
||||
expression(A) ::= pseudo_column(B). { A = B; }
|
||||
|
|
|
@ -1407,7 +1407,7 @@ SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* p
|
|||
|
||||
SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
char password[TSDB_USET_PASSWORD_LEN] = {0};
|
||||
char password[TSDB_USET_PASSWORD_LEN + 3] = {0};
|
||||
if (!checkUserName(pCxt, pUserName) || !checkPassword(pCxt, pPassword, password)) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -372,14 +372,42 @@ static bool isEmptyResultQuery(SNode* pStmt) {
|
|||
return isEmptyResult;
|
||||
}
|
||||
|
||||
static void resetProjectNullTypeImpl(SNodeList* pProjects) {
|
||||
SNode* pProj = NULL;
|
||||
FOREACH(pProj, pProjects) {
|
||||
SExprNode* pExpr = (SExprNode*)pProj;
|
||||
if (TSDB_DATA_TYPE_NULL == pExpr->resType.type) {
|
||||
pExpr->resType.type = TSDB_DATA_TYPE_VARCHAR;
|
||||
pExpr->resType.bytes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void resetProjectNullType(SNode* pStmt) {
|
||||
switch (nodeType(pStmt)) {
|
||||
case QUERY_NODE_SELECT_STMT:
|
||||
resetProjectNullTypeImpl(((SSelectStmt*)pStmt)->pProjectionList);
|
||||
break;
|
||||
case QUERY_NODE_SET_OPERATOR: {
|
||||
resetProjectNullTypeImpl(((SSetOperator*)pStmt)->pProjectionList);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) {
|
||||
SCalcConstContext cxt = {.pParseCxt = pParseCxt,
|
||||
.msgBuf.buf = pParseCxt->pMsg,
|
||||
.msgBuf.len = pParseCxt->msgLen,
|
||||
.code = TSDB_CODE_SUCCESS};
|
||||
int32_t code = calcConstQuery(&cxt, pQuery->pRoot, false);
|
||||
if (TSDB_CODE_SUCCESS == code && isEmptyResultQuery(pQuery->pRoot)) {
|
||||
pQuery->execMode = QUERY_EXEC_MODE_EMPTY_RESULT;
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
resetProjectNullType(pQuery->pRoot);
|
||||
if (isEmptyResultQuery(pQuery->pRoot)) {
|
||||
pQuery->execMode = QUERY_EXEC_MODE_EMPTY_RESULT;
|
||||
}
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -1529,9 +1529,7 @@ static int32_t setStmtInfo(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt)
|
|||
memcpy(tags, &pCxt->tags, sizeof(pCxt->tags));
|
||||
|
||||
SStmtCallback* pStmtCb = pCxt->pComCxt->pStmtCb;
|
||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||
tNameExtractFullName(&pStmt->targetTableName, tbFName);
|
||||
int32_t code = (*pStmtCb->setInfoFn)(pStmtCb->pStmt, pStmt->pTableMeta, tags, tbFName, pStmt->usingTableProcessing,
|
||||
int32_t code = (*pStmtCb->setInfoFn)(pStmtCb->pStmt, pStmt->pTableMeta, tags, &pStmt->targetTableName, pStmt->usingTableProcessing,
|
||||
pStmt->pVgroupsHashObj, pStmt->pTableBlockHashObj, pStmt->usingTableName.tname);
|
||||
|
||||
memset(&pCxt->tags, 0, sizeof(pCxt->tags));
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1158,7 +1158,7 @@ int32_t syncNodeStartElectTimer(SSyncNode* pSyncNode, int32_t ms) {
|
|||
pSyncNode->electTimerParam.pSyncNode = pSyncNode;
|
||||
pSyncNode->electTimerParam.pData = NULL;
|
||||
|
||||
taosTmrReset(pSyncNode->FpElectTimerCB, pSyncNode->electTimerMS, pSyncNode, syncEnv()->pTimerManager,
|
||||
taosTmrReset(pSyncNode->FpElectTimerCB, pSyncNode->electTimerMS, (void*)(pSyncNode->rid), syncEnv()->pTimerManager,
|
||||
&pSyncNode->pElectTimer);
|
||||
|
||||
} else {
|
||||
|
@ -1916,13 +1916,21 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) {
|
|||
static void syncNodeEqElectTimer(void* param, void* tmrId) {
|
||||
if (!syncIsInit()) return;
|
||||
|
||||
SSyncNode* pNode = (SSyncNode*)param;
|
||||
int64_t rid = (int64_t)param;
|
||||
SSyncNode* pNode = syncNodeAcquire(rid);
|
||||
|
||||
if (pNode == NULL) return;
|
||||
if (pNode->syncEqMsg == NULL) return;
|
||||
|
||||
if (pNode->syncEqMsg == NULL) {
|
||||
syncNodeRelease(pNode);
|
||||
return;
|
||||
}
|
||||
|
||||
int64_t tsNow = taosGetTimestampMs();
|
||||
if (tsNow < pNode->electTimerParam.executeTime) return;
|
||||
if (tsNow < pNode->electTimerParam.executeTime) {
|
||||
syncNodeRelease(pNode);
|
||||
return;
|
||||
}
|
||||
|
||||
SRpcMsg rpcMsg = {0};
|
||||
int32_t code =
|
||||
|
@ -1930,7 +1938,7 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) {
|
|||
|
||||
if (code != 0) {
|
||||
sError("failed to build elect msg");
|
||||
|
||||
syncNodeRelease(pNode);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1941,9 +1949,11 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) {
|
|||
if (code != 0) {
|
||||
sError("failed to sync enqueue elect msg since %s", terrstr());
|
||||
rpcFreeCont(rpcMsg.pCont);
|
||||
|
||||
syncNodeRelease(pNode);
|
||||
return;
|
||||
}
|
||||
|
||||
syncNodeRelease(pNode);
|
||||
}
|
||||
|
||||
static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
|
||||
|
|
|
@ -210,6 +210,7 @@ int tdbPagerOpen(SPCache *pCache, const char *fileName, SPager **ppPager) {
|
|||
ret = tdbGetFileSize(pPager->fd, pPager->pageSize, &(pPager->dbOrigSize));
|
||||
pPager->dbFileSize = pPager->dbOrigSize;
|
||||
|
||||
tdbTrace("pager/open reset dirty tree: %p", &pPager->rbt);
|
||||
tRBTreeCreate(&pPager->rbt, pageCmpFn);
|
||||
|
||||
*ppPager = pPager;
|
||||
|
@ -296,7 +297,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) {
|
|||
|
||||
// ref page one more time so the page will not be release
|
||||
tdbRefPage(pPage);
|
||||
tdbDebug("pcache/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id);
|
||||
tdbDebug("pager/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id);
|
||||
|
||||
// Set page as dirty
|
||||
pPage->isDirty = 1;
|
||||
|
@ -316,6 +317,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) {
|
|||
pPage->pDirtyNext = *ppPage;
|
||||
*ppPage = pPage;
|
||||
*/
|
||||
tdbTrace("put page: %p %d to dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt);
|
||||
tRBTreePut(&pPager->rbt, (SRBTreeNode *)pPage);
|
||||
|
||||
// Write page to journal if neccessary
|
||||
|
@ -373,6 +375,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
|
|||
SRBTreeNode *pNode = NULL;
|
||||
while ((pNode = tRBTreeIterNext(&iter)) != NULL) {
|
||||
pPage = (SPage *)pNode;
|
||||
|
||||
ASSERT(pPage->nOverflow == 0);
|
||||
ret = tdbPagerWritePageToDB(pPager, pPage);
|
||||
if (ret < 0) {
|
||||
|
@ -398,6 +401,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
|
|||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||
}
|
||||
|
||||
tdbTrace("pager/commit reset dirty tree: %p", &pPager->rbt);
|
||||
tRBTreeCreate(&pPager->rbt, pageCmpFn);
|
||||
|
||||
// sync the db file
|
||||
|
@ -471,6 +475,7 @@ int tdbPagerPrepareAsyncCommit(SPager *pPager, TXN *pTxn) {
|
|||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||
}
|
||||
/*
|
||||
tdbTrace("reset dirty tree: %p", &pPager->rbt);
|
||||
tRBTreeCreate(&pPager->rbt, pageCmpFn);
|
||||
|
||||
// sync the db file
|
||||
|
@ -566,6 +571,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
|
|||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||
}
|
||||
|
||||
tdbTrace("reset dirty tree: %p", &pPager->rbt);
|
||||
tRBTreeCreate(&pPager->rbt, pageCmpFn);
|
||||
|
||||
// 4, remove the journal file
|
||||
|
@ -580,6 +586,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
|
|||
|
||||
int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) {
|
||||
SPage *pPage;
|
||||
i32 nRef;
|
||||
SPgno maxPgno = pPager->dbOrigSize;
|
||||
int ret;
|
||||
|
||||
// loop to write the dirty pages to file
|
||||
|
@ -587,29 +595,52 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) {
|
|||
SRBTreeNode *pNode = NULL;
|
||||
while ((pNode = tRBTreeIterNext(&iter)) != NULL) {
|
||||
pPage = (SPage *)pNode;
|
||||
nRef = tdbGetPageRef(pPage);
|
||||
if (nRef > 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SPgno pgno = TDB_PAGE_PGNO(pPage);
|
||||
if (pgno > maxPgno) {
|
||||
maxPgno = pgno;
|
||||
}
|
||||
ret = tdbPagerWritePageToDB(pPager, pPage);
|
||||
if (ret < 0) {
|
||||
tdbError("failed to write page to db since %s", tstrerror(terrno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
tdbTrace("tdbttl commit:%p, %d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize);
|
||||
pPager->dbOrigSize = pPager->dbFileSize;
|
||||
tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno);
|
||||
pPager->dbOrigSize = maxPgno;
|
||||
|
||||
pPage->isDirty = 0;
|
||||
|
||||
tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt);
|
||||
tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
||||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||
|
||||
break;
|
||||
}
|
||||
/*
|
||||
tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno);
|
||||
pPager->dbOrigSize = maxPgno;
|
||||
|
||||
// release the page
|
||||
iter = tRBTreeIterCreate(&pPager->rbt, 1);
|
||||
while ((pNode = tRBTreeIterNext(&iter)) != NULL) {
|
||||
pPage = (SPage *)pNode;
|
||||
nRef = tdbGetPageRef(pPage);
|
||||
if (nRef > 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
pPage->isDirty = 0;
|
||||
|
||||
tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt);
|
||||
tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
||||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||
}
|
||||
|
||||
tRBTreeCreate(&pPager->rbt, pageCmpFn);
|
||||
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ void* rpcOpen(const SRpcInit* pInit) {
|
|||
pRpc->destroyFp = pInit->dfp;
|
||||
|
||||
pRpc->numOfThreads = pInit->numOfThreads > TSDB_MAX_RPC_THREADS ? TSDB_MAX_RPC_THREADS : pInit->numOfThreads;
|
||||
if (pRpc->numOfThreads <= 0) {
|
||||
pRpc->numOfThreads = 1;
|
||||
}
|
||||
|
||||
uint32_t ip = 0;
|
||||
if (pInit->connType == TAOS_CONN_SERVER) {
|
||||
|
|
|
@ -656,6 +656,7 @@ static SCliConn* cliCreateConn(SCliThrd* pThrd) {
|
|||
conn->stream = (uv_stream_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
||||
uv_tcp_init(pThrd->loop, (uv_tcp_t*)(conn->stream));
|
||||
conn->stream->data = conn;
|
||||
transSetConnOption((uv_tcp_t*)conn->stream);
|
||||
|
||||
uv_timer_t* timer = taosArrayGetSize(pThrd->timerList) > 0 ? *(uv_timer_t**)taosArrayPop(pThrd->timerList) : NULL;
|
||||
if (timer == NULL) {
|
||||
|
|
|
@ -202,9 +202,8 @@ bool transReadComplete(SConnBuffer* connBuf) {
|
|||
}
|
||||
|
||||
int transSetConnOption(uv_tcp_t* stream) {
|
||||
uv_tcp_nodelay(stream, 0);
|
||||
int ret = uv_tcp_keepalive(stream, 5, 60);
|
||||
return ret;
|
||||
return uv_tcp_nodelay(stream, 1);
|
||||
// int ret = uv_tcp_keepalive(stream, 5, 60);
|
||||
}
|
||||
|
||||
SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb) {
|
||||
|
|
|
@ -846,7 +846,7 @@ static bool addHandleToAcceptloop(void* arg) {
|
|||
return true;
|
||||
}
|
||||
void* transWorkerThread(void* arg) {
|
||||
setThreadName("trans-worker");
|
||||
setThreadName("trans-svr-work");
|
||||
SWorkThrd* pThrd = (SWorkThrd*)arg;
|
||||
uv_run(pThrd->loop, UV_RUN_DEFAULT);
|
||||
|
||||
|
|
|
@ -205,6 +205,9 @@ void* taosArrayPop(SArray* pArray) {
|
|||
}
|
||||
|
||||
void* taosArrayGet(const SArray* pArray, size_t index) {
|
||||
if (NULL == pArray) {
|
||||
return NULL;
|
||||
}
|
||||
assert(index < pArray->size);
|
||||
return TARRAY_GET_ELEM(pArray, index);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#define LOG_MAX_LINE_SIZE (1024)
|
||||
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 3)
|
||||
#define LOG_MAX_LINE_DUMP_SIZE (65 * 1024)
|
||||
#define LOG_MAX_LINE_DUMP_SIZE (1024 * 1024)
|
||||
#define LOG_MAX_LINE_DUMP_BUFFER_SIZE (LOG_MAX_LINE_DUMP_SIZE + 3)
|
||||
|
||||
#define LOG_FILE_NAME_LEN 300
|
||||
|
@ -496,7 +496,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
|
|||
if (!osLogSpaceAvailable()) return;
|
||||
if (!(dflag & DEBUG_FILE) && !(dflag & DEBUG_SCREEN)) return;
|
||||
|
||||
char buffer[LOG_MAX_LINE_DUMP_BUFFER_SIZE];
|
||||
char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE);
|
||||
int32_t len = taosBuildLogHead(buffer, flags);
|
||||
|
||||
va_list argpointer;
|
||||
|
@ -509,6 +509,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
|
|||
buffer[len] = 0;
|
||||
|
||||
taosPrintLogImp(level, dflag, buffer, len);
|
||||
taosMemoryFree(buffer);
|
||||
}
|
||||
|
||||
void taosDumpData(unsigned char *msg, int32_t len) {
|
||||
|
|
|
@ -104,61 +104,6 @@ static void tRBTreeTransplant(SRBTree *pTree, SRBTreeNode *u, SRBTreeNode *v) {
|
|||
v->parent = u->parent;
|
||||
}
|
||||
|
||||
static void tRBTreeDropFix(SRBTree *pTree, SRBTreeNode *x) {
|
||||
while (x != pTree->root && x->color == BLACK) {
|
||||
if (x == x->parent->left) {
|
||||
SRBTreeNode *w = x->parent->right;
|
||||
if (w->color == RED) {
|
||||
w->color = BLACK;
|
||||
x->parent->color = RED;
|
||||
tRBTreeRotateLeft(pTree, x->parent);
|
||||
w = x->parent->right;
|
||||
}
|
||||
if (w->left->color == BLACK && w->right->color == BLACK) {
|
||||
w->color = RED;
|
||||
x = x->parent;
|
||||
} else {
|
||||
if (w->right->color == BLACK) {
|
||||
w->left->color = BLACK;
|
||||
w->color = RED;
|
||||
tRBTreeRotateRight(pTree, w);
|
||||
w = x->parent->right;
|
||||
}
|
||||
w->color = x->parent->color;
|
||||
x->parent->color = BLACK;
|
||||
w->right->color = BLACK;
|
||||
tRBTreeRotateLeft(pTree, x->parent);
|
||||
x = pTree->root;
|
||||
}
|
||||
} else {
|
||||
SRBTreeNode *w = x->parent->left;
|
||||
if (w->color == RED) {
|
||||
w->color = BLACK;
|
||||
x->parent->color = RED;
|
||||
tRBTreeRotateRight(pTree, x->parent);
|
||||
w = x->parent->left;
|
||||
}
|
||||
if (w->right->color == BLACK && w->left->color == BLACK) {
|
||||
w->color = RED;
|
||||
x = x->parent;
|
||||
} else {
|
||||
if (w->left->color == BLACK) {
|
||||
w->right->color = BLACK;
|
||||
w->color = RED;
|
||||
tRBTreeRotateLeft(pTree, w);
|
||||
w = x->parent->left;
|
||||
}
|
||||
w->color = x->parent->color;
|
||||
x->parent->color = BLACK;
|
||||
w->left->color = BLACK;
|
||||
tRBTreeRotateRight(pTree, x->parent);
|
||||
x = pTree->root;
|
||||
}
|
||||
}
|
||||
}
|
||||
x->color = BLACK;
|
||||
}
|
||||
|
||||
static SRBTreeNode *tRBTreeSuccessor(SRBTree *pTree, SRBTreeNode *pNode) {
|
||||
if (pNode->right != pTree->NIL) {
|
||||
pNode = pNode->right;
|
||||
|
@ -255,11 +200,205 @@ SRBTreeNode *tRBTreePut(SRBTree *pTree, SRBTreeNode *z) {
|
|||
return z;
|
||||
}
|
||||
|
||||
void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) {
|
||||
SRBTreeNode *y = z;
|
||||
SRBTreeNode *x;
|
||||
ECOLOR y_orignal_color = y->color;
|
||||
#define RBTREE_NULL rbtree->NIL
|
||||
#define rbtree_t SRBTree
|
||||
#define rbnode_t SRBTreeNode
|
||||
#define rbtree_rotate_left tRBTreeRotateLeft
|
||||
#define rbtree_rotate_right tRBTreeRotateRight
|
||||
|
||||
static void rbtree_delete_fixup(rbtree_t *rbtree, rbnode_t *child, rbnode_t *child_parent) {
|
||||
rbnode_t *sibling;
|
||||
int go_up = 1;
|
||||
|
||||
/* determine sibling to the node that is one-black short */
|
||||
if (child_parent->right == child)
|
||||
sibling = child_parent->left;
|
||||
else
|
||||
sibling = child_parent->right;
|
||||
|
||||
while (go_up) {
|
||||
if (child_parent == RBTREE_NULL) {
|
||||
/* removed parent==black from root, every path, so ok */
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling->color == RED) { /* rotate to get a black sibling */
|
||||
child_parent->color = RED;
|
||||
sibling->color = BLACK;
|
||||
if (child_parent->right == child)
|
||||
rbtree_rotate_right(rbtree, child_parent);
|
||||
else
|
||||
rbtree_rotate_left(rbtree, child_parent);
|
||||
/* new sibling after rotation */
|
||||
if (child_parent->right == child)
|
||||
sibling = child_parent->left;
|
||||
else
|
||||
sibling = child_parent->right;
|
||||
}
|
||||
|
||||
if (child_parent->color == BLACK && sibling->color == BLACK && sibling->left->color == BLACK &&
|
||||
sibling->right->color == BLACK) { /* fixup local with recolor of sibling */
|
||||
if (sibling != RBTREE_NULL) sibling->color = RED;
|
||||
|
||||
child = child_parent;
|
||||
child_parent = child_parent->parent;
|
||||
/* prepare to go up, new sibling */
|
||||
if (child_parent->right == child)
|
||||
sibling = child_parent->left;
|
||||
else
|
||||
sibling = child_parent->right;
|
||||
} else
|
||||
go_up = 0;
|
||||
}
|
||||
|
||||
if (child_parent->color == RED && sibling->color == BLACK && sibling->left->color == BLACK &&
|
||||
sibling->right->color == BLACK) {
|
||||
/* move red to sibling to rebalance */
|
||||
if (sibling != RBTREE_NULL) sibling->color = RED;
|
||||
child_parent->color = BLACK;
|
||||
return;
|
||||
}
|
||||
assert(sibling != RBTREE_NULL);
|
||||
|
||||
/* get a new sibling, by rotating at sibling. See which child
|
||||
of sibling is red */
|
||||
if (child_parent->right == child && sibling->color == BLACK && sibling->right->color == RED &&
|
||||
sibling->left->color == BLACK) {
|
||||
sibling->color = RED;
|
||||
sibling->right->color = BLACK;
|
||||
rbtree_rotate_left(rbtree, sibling);
|
||||
/* new sibling after rotation */
|
||||
if (child_parent->right == child)
|
||||
sibling = child_parent->left;
|
||||
else
|
||||
sibling = child_parent->right;
|
||||
} else if (child_parent->left == child && sibling->color == BLACK && sibling->left->color == RED &&
|
||||
sibling->right->color == BLACK) {
|
||||
sibling->color = RED;
|
||||
sibling->left->color = BLACK;
|
||||
rbtree_rotate_right(rbtree, sibling);
|
||||
/* new sibling after rotation */
|
||||
if (child_parent->right == child)
|
||||
sibling = child_parent->left;
|
||||
else
|
||||
sibling = child_parent->right;
|
||||
}
|
||||
|
||||
/* now we have a black sibling with a red child. rotate and exchange colors. */
|
||||
sibling->color = child_parent->color;
|
||||
child_parent->color = BLACK;
|
||||
if (child_parent->right == child) {
|
||||
assert(sibling->left->color == RED);
|
||||
sibling->left->color = BLACK;
|
||||
rbtree_rotate_right(rbtree, child_parent);
|
||||
} else {
|
||||
assert(sibling->right->color == RED);
|
||||
sibling->right->color = BLACK;
|
||||
rbtree_rotate_left(rbtree, child_parent);
|
||||
}
|
||||
}
|
||||
|
||||
/** helpers for delete: swap node colours */
|
||||
static void swap_int8(ECOLOR *x, ECOLOR *y) {
|
||||
ECOLOR t = *x;
|
||||
*x = *y;
|
||||
*y = t;
|
||||
}
|
||||
|
||||
/** helpers for delete: swap node pointers */
|
||||
static void swap_np(rbnode_t **x, rbnode_t **y) {
|
||||
rbnode_t *t = *x;
|
||||
*x = *y;
|
||||
*y = t;
|
||||
}
|
||||
|
||||
/** Update parent pointers of child trees of 'parent' */
|
||||
static void change_parent_ptr(rbtree_t *rbtree, rbnode_t *parent, rbnode_t *old, rbnode_t *new) {
|
||||
if (parent == RBTREE_NULL) {
|
||||
assert(rbtree->root == old);
|
||||
if (rbtree->root == old) rbtree->root = new;
|
||||
return;
|
||||
}
|
||||
assert(parent->left == old || parent->right == old || parent->left == new || parent->right == new);
|
||||
if (parent->left == old) parent->left = new;
|
||||
if (parent->right == old) parent->right = new;
|
||||
}
|
||||
/** Update parent pointer of a node 'child' */
|
||||
static void change_child_ptr(rbtree_t *rbtree, rbnode_t *child, rbnode_t *old, rbnode_t *new) {
|
||||
if (child == RBTREE_NULL) return;
|
||||
assert(child->parent == old || child->parent == new);
|
||||
if (child->parent == old) child->parent = new;
|
||||
}
|
||||
|
||||
rbnode_t *rbtree_delete(rbtree_t *rbtree, void *key) {
|
||||
rbnode_t *to_delete = key;
|
||||
rbnode_t *child;
|
||||
|
||||
/* make sure we have at most one non-leaf child */
|
||||
if (to_delete->left != RBTREE_NULL && to_delete->right != RBTREE_NULL) {
|
||||
/* swap with smallest from right subtree (or largest from left) */
|
||||
rbnode_t *smright = to_delete->right;
|
||||
while (smright->left != RBTREE_NULL) smright = smright->left;
|
||||
/* swap the smright and to_delete elements in the tree,
|
||||
* but the rbnode_t is first part of user data struct
|
||||
* so cannot just swap the keys and data pointers. Instead
|
||||
* readjust the pointers left,right,parent */
|
||||
|
||||
/* swap colors - colors are tied to the position in the tree */
|
||||
swap_int8(&to_delete->color, &smright->color);
|
||||
|
||||
/* swap child pointers in parents of smright/to_delete */
|
||||
change_parent_ptr(rbtree, to_delete->parent, to_delete, smright);
|
||||
if (to_delete->right != smright) change_parent_ptr(rbtree, smright->parent, smright, to_delete);
|
||||
|
||||
/* swap parent pointers in children of smright/to_delete */
|
||||
change_child_ptr(rbtree, smright->left, smright, to_delete);
|
||||
change_child_ptr(rbtree, smright->left, smright, to_delete);
|
||||
change_child_ptr(rbtree, smright->right, smright, to_delete);
|
||||
change_child_ptr(rbtree, smright->right, smright, to_delete);
|
||||
change_child_ptr(rbtree, to_delete->left, to_delete, smright);
|
||||
if (to_delete->right != smright) change_child_ptr(rbtree, to_delete->right, to_delete, smright);
|
||||
if (to_delete->right == smright) {
|
||||
/* set up so after swap they work */
|
||||
to_delete->right = to_delete;
|
||||
smright->parent = smright;
|
||||
}
|
||||
|
||||
/* swap pointers in to_delete/smright nodes */
|
||||
swap_np(&to_delete->parent, &smright->parent);
|
||||
swap_np(&to_delete->left, &smright->left);
|
||||
swap_np(&to_delete->right, &smright->right);
|
||||
|
||||
/* now delete to_delete (which is at the location where the smright previously was) */
|
||||
}
|
||||
assert(to_delete->left == RBTREE_NULL || to_delete->right == RBTREE_NULL);
|
||||
|
||||
if (to_delete->left != RBTREE_NULL)
|
||||
child = to_delete->left;
|
||||
else
|
||||
child = to_delete->right;
|
||||
|
||||
/* unlink to_delete from the tree, replace to_delete with child */
|
||||
change_parent_ptr(rbtree, to_delete->parent, to_delete, child);
|
||||
change_child_ptr(rbtree, child, to_delete, to_delete->parent);
|
||||
|
||||
if (to_delete->color == RED) {
|
||||
/* if node is red then the child (black) can be swapped in */
|
||||
} else if (child->color == RED) {
|
||||
/* change child to BLACK, removing a RED node is no problem */
|
||||
if (child != RBTREE_NULL) child->color = BLACK;
|
||||
} else
|
||||
rbtree_delete_fixup(rbtree, child, to_delete->parent);
|
||||
|
||||
/* unlink completely */
|
||||
to_delete->parent = RBTREE_NULL;
|
||||
to_delete->left = RBTREE_NULL;
|
||||
to_delete->right = RBTREE_NULL;
|
||||
to_delete->color = BLACK;
|
||||
return to_delete;
|
||||
}
|
||||
|
||||
void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) {
|
||||
// update min/max node
|
||||
if (pTree->min == z) {
|
||||
pTree->min = tRBTreeSuccessor(pTree, pTree->min);
|
||||
|
@ -268,34 +407,8 @@ void tRBTreeDrop(SRBTree *pTree, SRBTreeNode *z) {
|
|||
pTree->max = tRBTreePredecessor(pTree, pTree->max);
|
||||
}
|
||||
|
||||
// drop impl
|
||||
if (z->left == pTree->NIL) {
|
||||
x = z->right;
|
||||
tRBTreeTransplant(pTree, z, z->right);
|
||||
} else if (z->right == pTree->NIL) {
|
||||
x = z->left;
|
||||
tRBTreeTransplant(pTree, z, z->left);
|
||||
} else {
|
||||
y = tRBTreeSuccessor(pTree, z);
|
||||
y_orignal_color = y->color;
|
||||
x = y->right;
|
||||
if (y->parent == z) {
|
||||
x->parent = z;
|
||||
} else {
|
||||
tRBTreeTransplant(pTree, y, y->right);
|
||||
y->right = z->right;
|
||||
y->right->parent = y;
|
||||
}
|
||||
tRBTreeTransplant(pTree, z, y);
|
||||
y->left = z->left;
|
||||
y->left->parent = y;
|
||||
y->color = z->color;
|
||||
}
|
||||
rbtree_delete(pTree, z);
|
||||
|
||||
// fix
|
||||
if (y_orignal_color == BLACK) {
|
||||
tRBTreeDropFix(pTree, x);
|
||||
}
|
||||
pTree->n--;
|
||||
}
|
||||
|
||||
|
|
|
@ -409,7 +409,7 @@
|
|||
,,n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
|
||||
,,n,system-test,python3 ./test.py -f 0-others/udfTest.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/udf_create.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_restart_taosd.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/udf_cfg1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/udf_cfg2.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py
|
||||
|
@ -425,7 +425,7 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py
|
||||
,,n,system-test,python3 ./test.py -f 1-insert/boundary.py
|
||||
,,,system-test,python3 ./test.py -f 1-insert/boundary.py
|
||||
,,n,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_comment.py
|
||||
,,n,system-test,python3 ./test.py -f 1-insert/time_range_wise.py
|
||||
|
@ -633,41 +633,41 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py
|
||||
,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode1mnode.py
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -i False
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -i False
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -i False
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -i False
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3
|
||||
,,,system-test,python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1
|
||||
,,,system-test,python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/create_wrong_topic.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/basic5.py
|
||||
|
@ -702,19 +702,19 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmqDropStb.py
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmqDropStbCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStbCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUdf.py
|
||||
|
@ -723,13 +723,13 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmq_taosx.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-19201.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3
|
||||
,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ltrim.py -Q 2
|
||||
|
|
|
@ -823,5 +823,8 @@ class TDDnodes:
|
|||
def addSimExtraCfg(self, option, value):
|
||||
self.sim.addExtraCfg(option, value)
|
||||
|
||||
def getAsan(self):
|
||||
return self.asan
|
||||
|
||||
|
||||
tdDnodes = TDDnodes()
|
||||
|
|
|
@ -1,199 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
system sh/deploy.sh -n dnode5 -i 5
|
||||
system sh/deploy.sh -n dnode6 -i 6
|
||||
system sh/deploy.sh -n dnode7 -i 7
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode1 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode1 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode1 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode1 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 3
|
||||
|
||||
######## dnode 2 the same with dnode1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode2 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode2 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode2 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode2 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 3
|
||||
|
||||
######## dnode 3 one para no same with dnode1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
|
||||
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode3 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode3 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode3 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode3 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 3
|
||||
|
||||
######## dnode 4 one para no same with dnode1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 5
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode4 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode4 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode4 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode4 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 3
|
||||
|
||||
######## dnode 5 one para no same with dnode1
|
||||
system sh/cfg.sh -n dnode5 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode5 -c offlineThreshold -v 7
|
||||
system sh/cfg.sh -n dnode5 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode5 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode5 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode5 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode5 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode5 -c balanceInterval -v 3
|
||||
|
||||
|
||||
######## dnode 6 one para no same with dnode1
|
||||
system sh/cfg.sh -n dnode6 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode6 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode6 -c statusInterval -v 2
|
||||
system sh/cfg.sh -n dnode6 -c arbitrator -v $arbitrator
|
||||
#system sh/cfg.sh -n dnode6 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode6 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode6 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode6 -c balanceInterval -v 3
|
||||
|
||||
|
||||
######## dnode 7 one para no same with dnode1
|
||||
system sh/cfg.sh -n dnode7 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode7 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode7 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode7 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode7 -c arbitrator -v "plum-VirtualBox:8001"
|
||||
#system sh/cfg.sh -n dnode7 -c timezone -v ""
|
||||
#system sh/cfg.sh -n dnode7 -c locale -v ""
|
||||
#system sh/cfg.sh -n dnode7 -c charset -v ""
|
||||
system sh/cfg.sh -n dnode7 -c balanceInterval -v 3
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2~7 and add into cluster
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
system sh/exec.sh -n dnode6 -s start
|
||||
system sh/exec.sh -n dnode7 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sql create dnode $hostname5
|
||||
sql create dnode $hostname6
|
||||
sql create dnode $hostname7
|
||||
sleep 10000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode_created:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 8 then
|
||||
sleep 2000
|
||||
goto wait_dnode_created
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
$dnode5Status = $data4_5
|
||||
$dnode6Status = $data4_6
|
||||
$dnode7Status = $data4_7
|
||||
|
||||
if $dnode1Status != ready then
|
||||
return -1
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
return -1
|
||||
endi
|
||||
if $dnode3Status != offline then
|
||||
return -1
|
||||
endi
|
||||
if $dnode4Status != offline then
|
||||
return -1
|
||||
endi
|
||||
if $dnode5Status != offline then
|
||||
return -1
|
||||
endi
|
||||
if $dnode6Status != offline then
|
||||
return -1
|
||||
endi
|
||||
if $dnode7Status != offline then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sleep 10000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode_offline_overtime_dropped:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode_offline_overtime_dropped
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
$dnode5Status = $data4_5
|
||||
$dnode6Status = $data4_6
|
||||
$dnode7Status = $data4_7
|
||||
|
||||
if $dnode1Status != ready then
|
||||
return -1
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
return -1
|
||||
endi
|
|
@ -1,222 +0,0 @@
|
|||
# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode
|
||||
# step 1: start dnode1
|
||||
# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode)
|
||||
# step 2: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841)
|
||||
# step 3: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc
|
||||
# step 4: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2
|
||||
# step 5: insert two data rows: now-21d, now-41d
|
||||
# step 6: restart dnode2, waiting sync end
|
||||
# expect: in dnode2, the files 1837 and 1839 will be removed
|
||||
|
||||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 1
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2 cache 1
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 double) tags(t1 int)
|
||||
$rowNum = 130000
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1577808000000 # 2020-01-01 00:00:00.000
|
||||
|
||||
# insert over 2M data in order to falling disc, generate one file
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
# $ts = $tsStart + $x
|
||||
sql insert into $tb values ( now + 0s , $x ) ( now + 1s , $x ) ( now + 2s , $x ) ( now + 3s , $x ) ( now + 4s , $x ) ( now + 5s , $x ) ( now + 6s , $x ) ( now + 7s , $x ) ( now + 8s , $x ) ( now + 9s , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print rows:$rows data00:$data00
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data00 == 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$totalRows = $data00
|
||||
|
||||
print ============== step3: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc
|
||||
sql insert into $tb values ( now - 20d , -20 )
|
||||
sql insert into $tb values ( now - 40d , -40 )
|
||||
$totalRows = $totalRows + 2
|
||||
|
||||
print ============== step4: stop dnode3, so date rows falling disc, generate two new files in dnode3
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
|
||||
sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ---->dnode3 data files: $system_content expect: 9
|
||||
if $system_content != 9 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: insert two data rows: now-16d, now+16d,
|
||||
sql insert into $tb values ( now - 21d , -21 )
|
||||
sql insert into $tb values ( now - 41d , -41 )
|
||||
$totalRows = $totalRows + 2
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ---->dnode2 data files: $system_content expect: 3
|
||||
if $system_content != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step7: restart dnode3, waiting sync end
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 2000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_ready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ---->dnode2 data files: $system_content expect: 3
|
||||
if $system_content != 3 then
|
||||
return -1
|
||||
endi
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ---->dnode3 data files: $system_content expect: 3
|
||||
if $system_content != 3 then
|
||||
return -1
|
||||
endi
|
|
@ -1,52 +0,0 @@
|
|||
# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode
|
||||
# step 1: start dnode1
|
||||
# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode)
|
||||
# step 3: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841)
|
||||
# step 4: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc
|
||||
# step 5: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2
|
||||
# step 6: insert two data rows: now-21d, now-41d
|
||||
# step 7: restart dnode2, waiting sync end
|
||||
# expect: in dnode2, the files 1837 and 1839 will be removed
|
||||
|
||||
sql connect
|
||||
sleep 2000
|
||||
|
||||
print ============== step7: restart dnode2, waiting sync end
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 2000
|
||||
|
||||
wait_dnode2_ready:
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
|
||||
sleep 1000
|
||||
# check using select
|
||||
$db = db
|
||||
$stb = stb
|
||||
sql use $db
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00, should equal to dn2_mn1_cache_file_sync.sim output
|
||||
#if $data00 != $totalRows then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
print ============== step8: please check there should be 1 file in sim/dnode2/data/vnode/vnode2/tsdb/data/, and 1 file sim/dnode3/data/vnode/vnode2/tsdb/data/
|
|
@ -1,101 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table to max tables
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 16
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 10
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step3: create one table, should return error for not more vnode
|
||||
sql_error create table tbm using $stb tags( 10000 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table to max tables
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 16
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 10
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step3: drop dnode4, should return error for not more dnode
|
||||
sql_error drop dnode $hostname4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,310 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 10
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: drop the middle table 5
|
||||
sql drop table tb5
|
||||
$totalRows = $totalRows - 10
|
||||
sleep 6000
|
||||
|
||||
print ============== step4: insert data into other tables
|
||||
$tsStart = 1420041610000
|
||||
$i = 0
|
||||
$tblNum = 5
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
$i = 6
|
||||
$tblNum = 10
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step5: create the middle table 5 and insert data
|
||||
sql create table tb5 using $stb tags( 5 )
|
||||
sleep 2000
|
||||
|
||||
$tsStart = 1420041620000
|
||||
$i = 5
|
||||
$tblNum = 6
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from tb5
|
||||
print data00 $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: drop the first table 0
|
||||
sql drop table tb0
|
||||
$totalRows = $totalRows - 20
|
||||
sleep 6000
|
||||
|
||||
print ============== step7: insert data into other tables
|
||||
$tsStart = 1420041630000
|
||||
$i = 1
|
||||
$tblNum = 10
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from tb5
|
||||
print data00 $data00
|
||||
if $data00 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step8: create the first table 0 and insert data
|
||||
sql create table tb0 using $stb tags( 0 )
|
||||
sleep 2000
|
||||
|
||||
$tsStart = 1420041640000
|
||||
$i = 0
|
||||
$tblNum = 10
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from tb0
|
||||
print data00 $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step9: drop the last table 9
|
||||
sql drop table tb9
|
||||
$totalRows = $totalRows - 40
|
||||
sleep 6000
|
||||
|
||||
print ============== step10: insert data into other tables
|
||||
$tsStart = 1420041650000
|
||||
$i = 0
|
||||
$tblNum = 9
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step11: create the last table 9 and insert data
|
||||
sql create table tb9 using $stb tags( 9 )
|
||||
sleep 2000
|
||||
|
||||
$tsStart = 1420041660000
|
||||
$i = 0
|
||||
$tblNum = 10
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from tb9
|
||||
print data00 $data00
|
||||
if $data00 != 10 then
|
||||
return -1
|
||||
endi
|
|
@ -1,160 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$rowNum = 10
|
||||
$tblNum = 16
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print info: select count(*) from $stb
|
||||
sleep 1000
|
||||
sql reset query cache
|
||||
sleep 1000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4, after timerout dnode4 will be auto-dropped.
|
||||
### The script using down port to stop the network is invalid, so temp it stops the service instead
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
#system sh/port.sh -p 7400 -s down
|
||||
sleep 12000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_dropped:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode4, but there no dnode4 in cluster
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -1,358 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sleep 3000
|
||||
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode3, and remove its vnodeX subdirector
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
#sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_2
|
||||
$dnode2Vtatus = $data7_2
|
||||
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode3/data
|
||||
#system rm -rf ../../../sim/dnode3/data/vnode/*
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode3, waiting sync end
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_2
|
||||
$dnode2Vtatus = $data7_2
|
||||
|
||||
print dnode2Vtatus: $dnode3Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode2, and remove its vnode
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode2/data
|
||||
#system rm -rf ../../../sim/dnode2/data/vnode/*
|
||||
#system rm -rf ../../../sim/dnode3/data/vnode/*
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step6: restart dnode2, and check rows
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_reready
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_2
|
||||
$dnode2Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
if $dnode2Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
|
@ -1,409 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4, and remove its vnodeX subdirector
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode4/data
|
||||
#system rm -rf ../../../sim/dnode4/data/vnode/*
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
#sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode3/dnode2, and remove its vnode
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode23_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode2/data
|
||||
system rm -rf ../../../sim/dnode3/data
|
||||
#system rm -rf ../../../sim/dnode2/data/vnode/*
|
||||
#system rm -rf ../../../sim/dnode3/data/vnode/*
|
||||
|
||||
print ============== step6: restart dnode2/dnode3, and check rows
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode23_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step7: stop dnode3/dnode2, and cluster unable to provide services
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 2000
|
||||
sql select count(*) from $stb -x s71
|
||||
s71:
|
||||
|
||||
print ============== step8: restart dnode2, and cluster Still unable to provide services
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 2000
|
||||
sql select count(*) from $stb -x s81
|
||||
s81:
|
||||
|
||||
print ============== step9: restart dnode3, and cluster Resume service delivery
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_master_2:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_2
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_2
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_2
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
|
@ -1,367 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
system sh/deploy.sh -n dnode5 -i 5
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode5 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode5 -c walLevel -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode5 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 16
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 16
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 16
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 16
|
||||
system sh/cfg.sh -n dnode5 -c maxVgroupsPerDb -v 16
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 200
|
||||
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 200
|
||||
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200
|
||||
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 200
|
||||
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 200
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
system sh/cfg.sh -n dnode5 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode5 -c arbitrator -v $arbitrator
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode5 -c offlineThreshold -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode5 -c enableCoreFile -v 1
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster, then create database replica 2, create table , and insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sleep 2000
|
||||
|
||||
$rowNum = 100
|
||||
$tblNum = 16
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print info: select count(*) from $stb
|
||||
sleep 1000
|
||||
sql reset query cache
|
||||
sleep 1000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: add one new dnode4 expect auto balancing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname4
|
||||
sleep 10000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step4: stop dnode3, after offlineThreshold, dnode3 will be dropped for cluster
|
||||
system sh/exec.sh -n dnode3 -s stop
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
#sleep 2000
|
||||
#sql select * from information_schema.ins_dnodes
|
||||
#print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
#print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#
|
||||
#if $dnode1Status != ready then
|
||||
# return -1
|
||||
#endi
|
||||
#if $dnode2Status != ready then
|
||||
# return -1
|
||||
#endi
|
||||
#if $dnode3Status != offline then
|
||||
# return -1
|
||||
#endi
|
||||
#if $dnode4Status != ready then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
sleep 15000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_drop:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_drop
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode1Status != ready then
|
||||
return -1
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
return -1
|
||||
endi
|
||||
if $dnode3Status != null then
|
||||
return -1
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4-1: restart dnode3, adn add into cluster
|
||||
system rm -rf ../../../sim/dnode3
|
||||
sleep 1000
|
||||
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10
|
||||
system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 16
|
||||
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname3
|
||||
sleep 2000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_ready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print rows: $rows
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
$dnode5Status = $data4_5
|
||||
|
||||
if $dnode1Status != ready then
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
if $dnode3Status != null then
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
if $dnode5Status != ready then
|
||||
goto wait_dnode3_ready
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: start dnode5 and add into cluster , drop database
|
||||
sql drop database $db
|
||||
sleep 1000
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
sql create dnode $hostname5
|
||||
sleep 2000
|
||||
$loopCnt = 0
|
||||
wait_dnode5:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode5
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode4Status = $data4_4
|
||||
$dnode5Status = $data4_5
|
||||
$dnode6Status = $data4_6
|
||||
|
||||
if $dnode1Status != ready then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
if $dnode3Status != null then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
if $dnode5Status != ready then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
if $dnode6Status != ready then
|
||||
goto wait_dnode5
|
||||
endi
|
||||
|
||||
print ============== step6: create database and table until not free vnodes
|
||||
$rowNum = 100
|
||||
$tblNum = 32
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$db = db1
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print info: select count(*) from $stb
|
||||
sleep 2000
|
||||
sql reset query cache
|
||||
sleep 2000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step7: drop dnode $hostname5, system should prompt "DB error: no enough dnodes"
|
||||
sql_error drop dnode $hostname5
|
||||
print error: $error
|
||||
print ============== step8: create table tb_more using $stb tags( 1000 ), system should prompt 'DB error: no enough dnodes'
|
||||
sql_error create table tb_more using $stb tags( 1000 )
|
||||
print error: $error
|
|
@ -1,358 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2 and add into cluster , then create database with replica 1, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
step1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print dnode1 $data4_1
|
||||
print dnode2 $data4_2
|
||||
|
||||
if $data4_1 != ready then
|
||||
goto step1
|
||||
endi
|
||||
if $data4_2 != ready then
|
||||
goto step1
|
||||
endi
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 1
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step2-1: stop dnode2 for falling disc, then restart dnode2, and check rows
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
a0:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 1 then
|
||||
goto a0
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: start dnode3 and add into cluster , then alter replica from 1 to 2, and waiting sync
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname3
|
||||
|
||||
$x = 0
|
||||
step2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print dnode1 $data4_1
|
||||
print dnode2 $data4_2
|
||||
print dnode3 $data4_3
|
||||
|
||||
if $data4_3 != ready then
|
||||
goto step2
|
||||
endi
|
||||
|
||||
sql alter database $db replica 2
|
||||
|
||||
$x = 0
|
||||
a1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 2 then
|
||||
goto a1
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: stop dnode2 for checking if sync ok
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
$x = 0
|
||||
a2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 1 then
|
||||
goto a2
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
$x = 0
|
||||
a3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 2 then
|
||||
goto a3
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: start dnode4 and add into cluster , then alter replica from 2 to 3, and waiting sync
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname4
|
||||
$x = 0
|
||||
step6:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print dnode1 $data4_1
|
||||
print dnode2 $data4_2
|
||||
print dnode3 $data4_3
|
||||
print dnode4 $data4_4
|
||||
|
||||
if $data4_4 != ready then
|
||||
goto step6
|
||||
endi
|
||||
|
||||
sql alter database $db replica 3
|
||||
$x = 0
|
||||
a4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 3 then
|
||||
goto a4
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step7: alter replica from 3 to 2, and waiting sync
|
||||
sql alter database $db replica 2
|
||||
$x = 0
|
||||
a5:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 2 then
|
||||
goto a5
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step8: alter replica from 2 to 1, and waiting sync
|
||||
sql alter database $db replica 1
|
||||
$x = 0
|
||||
a6:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 1 then
|
||||
goto a6
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step9: drop dnode2/dnode3
|
||||
sql drop dnode $hostname2
|
||||
sql drop dnode $hostname3
|
||||
sleep $sleepTimer
|
||||
|
||||
$x = 0
|
||||
step9:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
goto step9
|
||||
endi
|
||||
|
||||
$x = 0
|
||||
a7:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 40 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
print online vnodes $data03
|
||||
if $data03 != 1 then
|
||||
goto a7
|
||||
endi
|
||||
|
||||
sleep $sleepTimer #waiting move vnode from dnode3/dnode3 to dnode4
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -1,150 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 10000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: drop dnode4, then check rows
|
||||
#system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sql drop dnode $hostname4
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode4_dropped:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
|
||||
sql reset query cache
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -1,222 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 5
|
||||
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 5
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 5
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 5
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1
|
||||
system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$rowNum = 10
|
||||
$tblNum = 16
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
print info: select count(*) from $stb
|
||||
sleep 1000
|
||||
sql reset query cache
|
||||
sleep 1000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4, after timerout dnode4 will be auto-dropped.
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
sleep 12000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_dropped:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_dropped
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode4, but there are not dnode4 in cluster
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 2000
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: recreate dnode4 into cluster, result should fail
|
||||
sql create dnode $hostname4
|
||||
sleep 12000
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should ok
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
system rm -rf ../../../sim/dnode4
|
||||
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 5
|
||||
system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1
|
||||
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname4
|
||||
sleep 6000
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_ready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_6
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
|
@ -1,319 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
|
||||
print ============== step3: stop dnode4, then destroy the contents of its data file
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
wait_dnode4_vgroup_offline:
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
system echo "haha, nothing......" > ../../../sim/dnode4/data/vnode/vnode2/tsdb/data/v2f1643.data
|
||||
#system rm -rf ../../../sim/dnode4/data/vnode/*
|
||||
sleep 1000
|
||||
|
||||
print ============== step3-1: insert new data
|
||||
sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode3/dnode2, and check rows
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode23_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_offline
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
|
@ -1,435 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
#sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode3 for falling disc, then corrupt vnode data file in dnode3
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_2
|
||||
$dnode2Vtatus = $data7_2
|
||||
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
|
||||
#$expectCnt = 3 . :
|
||||
#print expectCnt: [ $expectCnt ]
|
||||
#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':'
|
||||
#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':'
|
||||
#print --2-->dnode3 data files: [ $system_content ]
|
||||
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n'
|
||||
print ---->dnode2 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n'
|
||||
print ---->dnode3 data files: $system_content expect: 3
|
||||
if $system_content != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data
|
||||
|
||||
print ============== step3-1: insert some news data for let version changed
|
||||
sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x )
|
||||
sql insert into $tb values ( now + 10a , $x ) ( now + 11a , $x ) ( now + 12a , $x )
|
||||
$totalRows = $totalRows + 6
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode3, and run query
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ----> dnode2 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ----> dnode3 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
print there should be no data file in dnode3 after sync
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: stop dnode3 for falling disck
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
|
||||
sql show vgroups
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
|
||||
|
||||
print ============== step7: restart dnode3, and run query
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode23_reready_2:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode23_vgroup_ok:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus == offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
if $dnode3Vtatus == offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,354 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data to can fall disc
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
#sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 4
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db cache 1 replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 128 * 1024
|
||||
$tblNum = 1
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
$tsLast = $ts + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: corrupt vnode data file in dnode3, not stop dnode3
|
||||
system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data
|
||||
sleep 1000
|
||||
|
||||
print ============== step4: insert new data, and run query
|
||||
sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print select * from information_schema.ins_dnodes
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
|
||||
print show vgroups
|
||||
sql show vgroups
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
|
||||
|
||||
$tsStart = $tsLast + 1
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
#sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
$tsLast = $ts + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: stop dnode3 for falling disc
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step7: restart dnode2/dnode3, and run query
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master_1:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,316 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
#sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: corrupt vnode data file in dnode3, not stop dnode3
|
||||
system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data
|
||||
sleep 1000
|
||||
|
||||
print ============== step4: insert new data, and run query
|
||||
sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: stop dnode3 for falling disc
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step7: restart dnode2/dnode3, and run query
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master_1:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master_1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,458 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4, and remove its vnodeX subdirector
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode4/data/vnode/*
|
||||
|
||||
print ============== step4: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode3, and remove its vnodeX subdirector
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode3/data/vnode/*
|
||||
|
||||
print ============== step6: restart dnode3, and check rows
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step7: stop dnode2, and remove its vnodeX subdirector
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
|
||||
system rm -rf ../../../sim/dnode2/data/vnode/*
|
||||
|
||||
print ============== step8: restart dnode2, and check rows
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_reready
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
print dnode4Vtatus: $dnode4Vtatus
|
||||
print dnode3Vtatus: $dnode3Vtatus
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_slave
|
||||
endi
|
||||
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 )
|
||||
$totalRows = $totalRows + 3
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,434 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
#sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
sleep 1000
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode3 for falling disc, then corrupt vnode data file in dnode3
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_2
|
||||
$dnode2Vtatus = $data7_2
|
||||
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_offline
|
||||
endi
|
||||
|
||||
#$expectCnt = 3 . :
|
||||
#print expectCnt: [ $expectCnt ]
|
||||
#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':'
|
||||
#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':'
|
||||
#print --2-->dnode3 data files: [ $system_content ]
|
||||
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n'
|
||||
print ---->dnode2 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n'
|
||||
print ---->dnode3 data files: $system_content expect: 3
|
||||
if $system_content != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
#system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/f1643.data
|
||||
|
||||
print ============== step3-1: insert some news data for let version changed
|
||||
sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x )
|
||||
sql insert into $tb values ( now + 10a , $x ) ( now + 11a , $x ) ( now + 12a , $x )
|
||||
$totalRows = $totalRows + 6
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step4: restart dnode3, and run query
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode3_reready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_reready
|
||||
endi
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_slave:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
if $dnode3Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_slave
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ----> dnode2 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
|
||||
print ----> dnode3 data files: $system_content expect: 0
|
||||
if $system_content != 0 then
|
||||
print there should be no data file in dnode3 after sync
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode3_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode3_vgroup_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step6: stop dnode3 for falling disck
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
|
||||
sql show vgroups
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
|
||||
|
||||
print ============== step7: restart dnode2/dnode3, and run query
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode23_reready_2:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode23_reready_2
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode23_vgroup_ok:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode2Vtatus = $data7_2
|
||||
$dnode3Vtatus = $data5_2
|
||||
|
||||
if $dnode2Vtatus == offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
if $dnode3Vtatus == offline then
|
||||
sleep 2000
|
||||
goto wait_dnode23_vgroup_ok
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4/dnode2
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != unsynced then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb -x s31
|
||||
s31:
|
||||
#sql_error insert into $tb values (now, 9988) -x s32
|
||||
#s32:
|
||||
|
||||
print ============== step4: restart dnode2, then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db1
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 100
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode3
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$loopCnt = 0
|
||||
wait_dnode3_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
print dnode1Status $dnode1Status
|
||||
print dnode2Status $dnode2Status
|
||||
print dnode3Status $dnode3Status
|
||||
print dnode4Status $dnode4Status
|
||||
|
||||
if $dnode3Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode3_offline_0
|
||||
endi
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_vgroup_master:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode3Vtatus = $data5_3
|
||||
$dnode2Vtatus = $data7_3
|
||||
|
||||
if $dnode3Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_master
|
||||
endi
|
||||
if $dnode2Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode2_vgroup_master
|
||||
endi
|
||||
|
||||
sql insert into $tb values (now, 9000) (now + 1s, 9001) (now + 2s, 9002)
|
||||
$totalRows = $totalRows + 3
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
#system sh/cfg.sh -n dnode1 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 3, and create table to max tables
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
#system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sleep 2000
|
||||
sql create dnode $hostname3
|
||||
#sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 4
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 10
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step3: stop dnode2
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
sleep 2000
|
||||
|
||||
sql select * from information_schema.ins_mnodes
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$mnode1Status = $data2_1
|
||||
$mnode2Status = $data2_2
|
||||
$mnode3Status = $data2_3
|
||||
#$mnode4Status = $data2_4
|
||||
|
||||
if $mnode1Status != master then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $mnode2Status != offline then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql reset query cache
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -1,293 +0,0 @@
|
|||
# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode
|
||||
# step 1: start dnode1
|
||||
# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode)
|
||||
# step 3: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841)
|
||||
# step 4: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc
|
||||
# step 5: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2
|
||||
# step 6: insert two data rows: now-16d, now+16d
|
||||
# step 7: restart dnode2, waiting sync end
|
||||
# expect: in dnode2, the files 1840 and 1842 will be removed
|
||||
|
||||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 1
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 2 cache 1
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 double) tags(t1 int)
|
||||
$rowNum = 130000
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1577808000000 # 2020-01-01 00:00:00.000
|
||||
|
||||
# insert over 2M data in order to falling disc, generate one file
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
# $ts = $tsStart + $x
|
||||
sql insert into $tb values ( now + 0s , $x ) ( now + 1s , $x ) ( now + 2s , $x ) ( now + 3s , $x ) ( now + 4s , $x ) ( now + 5s , $x ) ( now + 6s , $x ) ( now + 7s , $x ) ( now + 8s , $x ) ( now + 9s , $x )
|
||||
$x = $x + 10
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql show db.vgroups;
|
||||
print d1: $data04 $data05 , d2: $data06 $data07
|
||||
|
||||
sql select count(*) from $stb
|
||||
print rtest1==> rows:$rows data00:$data00
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data00 == 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
$totalRows = $data00
|
||||
|
||||
sql select count(*) from $stb
|
||||
print test2==> rows:$rows data00:$data00
|
||||
sql select count(*) from $stb
|
||||
print test3==> rows:$rows data00:$data00
|
||||
sql select count(*) from $stb
|
||||
print test4==> rows:$rows data00:$data00
|
||||
sql select count(*) from $stb
|
||||
print test5==> rows:$rows data00:$data00
|
||||
|
||||
print ============== step3: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc
|
||||
sql insert into $tb values ( now - 20d , -20 )
|
||||
sql insert into $tb values ( now - 40d , -40 )
|
||||
$totalRows = $totalRows + 2
|
||||
|
||||
print ============== step4: stop dnode2, so date rows falling disc, generate two new files in dnode2
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode2_offline:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
if $dnode3Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_offline
|
||||
endi
|
||||
|
||||
sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3
|
||||
# check using select
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
|
||||
print ============== step5: insert two data rows: now-16d, now+16d,
|
||||
sql insert into $tb values ( now - 21d , -21 )
|
||||
sql insert into $tb values ( now - 41d , -41 )
|
||||
$totalRows = $totalRows + 2
|
||||
|
||||
print ============== step6: restart dnode2, waiting sync end
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 2000
|
||||
$loopCnt = 0
|
||||
wait_dnode2_ready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
|
||||
sleep $sleepTimer
|
||||
# check using select
|
||||
sleep 3000
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
|
@ -1,217 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
wait_dnode4_vgroup_offline:
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: alter table and insert more data rows
|
||||
sql alter table $stb drop column c1
|
||||
sql alter table $stb add column f1 double
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql insert into $tb values (now, 10001, 1.0001) (now + 1s, 10002, 1.0002) (now + 2s, 10003, 1.0003) (now + 3s, 10004, 1.0004)
|
||||
$i = $i + 1
|
||||
endw
|
||||
$addRows = 4 * $tblNum
|
||||
$totalRows = $totalRows + $addRows
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$loopCnt = 0
|
||||
wait_dnode4_ready:
|
||||
$loopCnt = $loopCnt + 1
|
||||
if $loopCnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00 totalRows: $totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,247 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
#system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
#system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i , $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: alter table and tag, then drop all sub tables, recreate som subtable and insert more data rows
|
||||
sql alter table $stb drop column c1
|
||||
sql alter table $stb add column f1 double
|
||||
|
||||
sql alter table $stb add tag t2 int
|
||||
sql alter table $stb add tag t3 int
|
||||
sql alter table $stb drop tag t1
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql drop table $tb
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
$totalRows = 0
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i , $i , $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00 totalRows: $totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,233 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: create more tables and insert data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = $tblNum
|
||||
$tblNum = $tblNum * 2
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: drop db
|
||||
sql drop database $db
|
||||
|
||||
print ============== step5: restart dnode4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
print ============== step6: check result
|
||||
sql reset query cache
|
||||
$cnt = 0
|
||||
wait_database_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 0 then
|
||||
sleep 2000
|
||||
goto wait_database_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: drop some tables
|
||||
$i = 1
|
||||
$dropTblNum = 6
|
||||
|
||||
while $i < $dropTblNum
|
||||
$tb = tb . $i
|
||||
sql drop table if exists $tb
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tblNum = $tblNum - 5
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(tbname) from $stb
|
||||
if $data00 != $tblNum then
|
||||
print data00: $data00 tblNum: $tblNum
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: alter table and insert more data rows
|
||||
sql alter table $stb drop column c1
|
||||
sql alter table $stb add column f1 double
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql insert into $tb values (now, 10001, 1.0001) (now + 1s, 10002, 1.0002) (now + 2s, 10003, 1.0003) (now + 3s, 10004, 1.0004)
|
||||
$i = $i + 1
|
||||
endw
|
||||
$addRows = 4 * $tblNum
|
||||
$totalRows = $totalRows + $addRows
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00 totalRows: $totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,247 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
#system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
#system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
#system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i , $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: alter table and tag, then drop all sub tables, recreate som subtable and insert more data rows
|
||||
sql alter table $stb drop column c1
|
||||
sql alter table $stb add column f1 double
|
||||
|
||||
sql alter table $stb add tag t2 int
|
||||
sql alter table $stb add tag t3 int
|
||||
sql alter table $stb drop tag t1
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql drop table $tb
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
$totalRows = 0
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i , $i , $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x )
|
||||
$x = $x + 20
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00 totalRows: $totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,234 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
$maxTables = $totalTableNum * 2
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: create more tables and insert data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = $tblNum
|
||||
$tblNum = $tblNum * 2
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: drop db
|
||||
sql drop database $db
|
||||
|
||||
print ============== step5: restart dnode4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
print ============== step6: check result
|
||||
sql reset query cache
|
||||
$cnt = 0
|
||||
wait_database_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 0 then
|
||||
sleep 2000
|
||||
goto wait_database_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: drop some tables
|
||||
$i = 1
|
||||
$dropTblNum = 6
|
||||
|
||||
while $i < $dropTblNum
|
||||
$tb = tb . $i
|
||||
sql drop table if exists $tb
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tblNum = $tblNum - 5
|
||||
|
||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
#$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
print ============== step6: check result
|
||||
|
||||
sql reset query cache
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(tbname) from $stb
|
||||
if $data00 != $tblNum then
|
||||
print data00: $data00 tblNum: $tblNum
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,238 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 0
|
||||
system sh/cfg.sh -n dnode2 -c role -v 0
|
||||
system sh/cfg.sh -n dnode3 -c role -v 0
|
||||
system sh/cfg.sh -n dnode4 -c role -v 0
|
||||
|
||||
$totalTableNum = 12
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 8
|
||||
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 8
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode2 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode3 -c statusInterval -v 3
|
||||
system sh/cfg.sh -n dnode4 -c statusInterval -v 3
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: replica is 1, and start 1 dnode, then create tables and insert data
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
$totalTableNum = 12
|
||||
|
||||
$db = db
|
||||
sql create database $db replica 1
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 10
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = $rowNum * $tblNum
|
||||
|
||||
$ts0 = 1420041600000
|
||||
$ts = $ts0
|
||||
$delta = 1
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
$i = $i + 1
|
||||
print $tb inserted rows: $x
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step2: add 1 new dnode, expect balanced
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode $hostname2
|
||||
sleep 2000
|
||||
|
||||
# expect after balanced, 2 vondes in dnode1, 1 vonde in dnode2
|
||||
$cnt = 0
|
||||
wait_dnode2_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
|
||||
if $dnode1Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode2_ready
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode1/dnode2, modify cfg numOfMnodes to 2, and restart dnode1/dnode2
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
sleep 2000
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
|
||||
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 0
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
||||
print ============= step4: wait dnode ready
|
||||
$cnt = 0
|
||||
wait_dnode_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 3 then
|
||||
sleep 2000
|
||||
goto wait_dnode_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode1Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode_ready
|
||||
endi
|
||||
if $dnode2Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode_ready
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: stop dnode1
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
sleep 2000
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode2_master:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_mnodes
|
||||
if $rows != 2 then
|
||||
sleep 2000
|
||||
goto wait_dnode2_master
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $data2_1 != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode2_master
|
||||
endi
|
||||
if $data2_2 != master then
|
||||
sleep 2000
|
||||
goto wait_dnode2_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_alterTable_background_add.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, add one column and insert 36 rows
|
||||
$totalRows = $totalRows + 36
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_alterTable_background_drop.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, drop one column and add one new column, then insert 36 rows
|
||||
$totalRows = $totalRows + 36
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
#$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while drop database in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_dropDb_background.sim
|
||||
|
||||
print ============== step6: check result
|
||||
$cnt = 0
|
||||
wait_database_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 0 then
|
||||
sleep 2000
|
||||
goto wait_database_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
#system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
#sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 2
|
||||
sql create database $db replica 2
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode4Status = $data4_3
|
||||
#$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while drop some tables in other thread when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_dropTable_background.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, drop 5 tables
|
||||
$totalRows = $totalRows - 5400
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
$tblNum = $tblNum - 5
|
||||
sql select count(tbname) from $stb
|
||||
if $data00 != $tblNum then
|
||||
print data00: $data00 tblNum: $tblNum
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
|
@ -1,198 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
$dnode4Vtatus = $data05
|
||||
$dnode3Vtatus = $data07
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_alterTable_background_add.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, add one column and insert 36 rows
|
||||
$totalRows = $totalRows + 36
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
|
@ -1,204 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_alterTable_background_drop.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, drop one column and add one new column, then insert 36 rows
|
||||
$totalRows = $totalRows + 36
|
||||
|
||||
$cnt = 0
|
||||
wait_table_altered:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00: $data00
|
||||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 20
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = 10
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_createTable_background_add.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, add 10 tables and insert 100 rows
|
||||
$totalRows = $totalRows + 100
|
||||
|
||||
$cnt = 0
|
||||
wait_table_created:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show tables
|
||||
if $rows != $totalTableNum then
|
||||
print rows:$rows totalTableNum:$totalTableNum
|
||||
sleep 2000
|
||||
goto wait_table_created
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
sleep 2000
|
||||
goto wait_table_created
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,485 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 40
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 20
|
||||
$sleepTimer = 3000
|
||||
|
||||
$maxTables = $totalTableNum * 2
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = 10
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
$x = $x + 10
|
||||
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: drop some tables
|
||||
sql drop table tb0
|
||||
sql drop table tb9
|
||||
sql drop table tb1
|
||||
sql drop table tb8
|
||||
|
||||
$totalRows = $totalRows - 40
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_slave:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave
|
||||
endi
|
||||
|
||||
print ============== step6: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 1000
|
||||
system rm -rf ../../../sim/dnode2/data
|
||||
system rm -rf ../../../sim/dnode3/data
|
||||
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_master:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step7: stop dnode4 and create some new tables
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
|
||||
$ts = $tsStart
|
||||
sql insert into tb10 using stb tags(10) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
sql insert into tb11 using stb tags(11) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
sql insert into tb12 using stb tags(12) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
sql insert into tb13 using stb tags(13) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
|
||||
$totalRows = $totalRows + 40
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step8: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready_2:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready_2
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready_2
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_slave_2:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave_2
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave_2
|
||||
endi
|
||||
|
||||
print ============== step9: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 1000
|
||||
system rm -rf ../../../sim/dnode2/data
|
||||
system rm -rf ../../../sim/dnode3/data
|
||||
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_master_2:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_2
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_2
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============== step10: stop dnode4 and alter table column
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
|
||||
sql alter table stb add column c2 int
|
||||
sql alter table stb add column c3 int
|
||||
sql alter table stb add column c4 int
|
||||
sql alter table stb drop column c1
|
||||
|
||||
sql alter table stb add tag t2 int
|
||||
sql alter table stb add tag t3 int
|
||||
sql_error alter table stb drop tag t1
|
||||
|
||||
$ts = $tsEnd + 10000
|
||||
sql insert into tb2 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb3 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb4 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb5 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
|
||||
|
||||
$ts = $tsStart
|
||||
sql insert into tb14 using stb tags(14, 14, 14) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb15 using stb tags(15, 15, 15) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb16 using stb tags(16, 16, 16) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
sql insert into tb17 using stb tags(17, 17, 17) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x )
|
||||
|
||||
$totalRows = $totalRows + 80
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step11: restart dnode4, waiting sync end
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_ready_3:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 4 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready_3
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
|
||||
if $dnode4Status != ready then
|
||||
sleep 2000
|
||||
goto wait_dnode4_ready_3
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_slave_3:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave_3
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != slave then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_slave_3
|
||||
endi
|
||||
|
||||
print ============== step12: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 1000
|
||||
system rm -rf ../../../sim/dnode2/data
|
||||
system rm -rf ../../../sim/dnode3/data
|
||||
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_master_3:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_3
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_master_3
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
|
@ -1,200 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while drop database in other thead when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_dropDb_background.sim
|
||||
|
||||
print ============== step6: check result
|
||||
$cnt = 0
|
||||
wait_database_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 0 then
|
||||
sleep 2000
|
||||
goto wait_database_dropped
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
|
||||
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c role -v 1
|
||||
system sh/cfg.sh -n dnode2 -c role -v 2
|
||||
system sh/cfg.sh -n dnode3 -c role -v 2
|
||||
system sh/cfg.sh -n dnode4 -c role -v 2
|
||||
|
||||
$totalTableNum = 10
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
|
||||
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
|
||||
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
|
||||
|
||||
print ============== step0: start tarbitrator
|
||||
system sh/exec_tarbitrator.sh -s start
|
||||
|
||||
print ============== step1: start dnode1, only deploy mnode
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
sql connect
|
||||
|
||||
print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sleep 2000
|
||||
|
||||
$totalTableNum = 10
|
||||
$sleepTimer = 3000
|
||||
|
||||
$db = db
|
||||
print create database $db replica 3
|
||||
sql create database $db replica 3
|
||||
sql use $db
|
||||
|
||||
# create table , insert data
|
||||
$stb = stb
|
||||
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
$rowNum = 500
|
||||
$tblNum = $totalTableNum
|
||||
$totalRows = 0
|
||||
$tsStart = 1420041600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
$tsEnd = $tsStart + $totalRows / $tblNum
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00 $data00
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step3: stop dnode4
|
||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||
sleep $sleepTimer
|
||||
$cnt = 0
|
||||
wait_dnode4_offline_0:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 5 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
|
||||
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
|
||||
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
|
||||
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
|
||||
#$dnode1Status = $data4_1
|
||||
$dnode2Status = $data4_2
|
||||
$dnode3Status = $data4_3
|
||||
$dnode4Status = $data4_4
|
||||
#$dnode5Status = $data4_5
|
||||
|
||||
if $dnode4Status != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_offline_0
|
||||
endi
|
||||
|
||||
$cnt = 0
|
||||
wait_dnode4_vgroup_offline:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 10 then
|
||||
return -1
|
||||
endi
|
||||
sql show vgroups
|
||||
if $rows != 1 then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
print show vgroups:
|
||||
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
|
||||
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
if $dnode3Vtatus != master then
|
||||
sleep 2000
|
||||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
|
||||
print ============== step4: insert more data rows
|
||||
$tsStart = $tsEnd + 1000
|
||||
$i = 0
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x )
|
||||
$x = $x + 60
|
||||
endw
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql select count(*) from $stb
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
if $data00 != $totalRows then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============== step5: restart dnode4, while drop some tables in other thread when dnode4 is syncing
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
run_back unique/arbitrator/sync_replica_dropTable_background.sim
|
||||
|
||||
print ============== step6: check result
|
||||
#in background.sim, drop 5 tables
|
||||
$totalRows = $totalRows - 5400
|
||||
|
||||
$cnt = 0
|
||||
wait_table_dropped:
|
||||
$cnt = $cnt + 1
|
||||
if $cnt == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(*) from $stb
|
||||
if $data00 != $totalRows then
|
||||
print data00:$data00 totalRows:$totalRows
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
$tblNum = $tblNum - 5
|
||||
sql select count(tbname) from $stb
|
||||
if $data00 != $tblNum then
|
||||
print data00: $data00 tblNum: $tblNum
|
||||
sleep 2000
|
||||
goto wait_table_dropped
|
||||
endi
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
sql connect
|
||||
|
||||
$db = db
|
||||
$stb = stb
|
||||
print =============== sync_replica_alterTable_background_add.sim step0: alter table and insert data
|
||||
$totalTableNum = 10
|
||||
|
||||
sql use $db
|
||||
|
||||
#sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
print alter table $stb add column f1 float
|
||||
sql alter table $stb add column f1 float
|
||||
|
||||
$tblNum = $totalTableNum
|
||||
$alterTblNum = 10
|
||||
|
||||
sql reset query cache
|
||||
sleep 100
|
||||
|
||||
$i = 1
|
||||
while $i < $alterTblNum
|
||||
$tb = tb . $i
|
||||
sql insert into $tb values (now, 10001, 10001) (now + 1s, 10002, 10002) (now + 2s, 10003, 10003) (now + 3s, 10004, 10004)
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
sql connect
|
||||
|
||||
$db = db
|
||||
$stb = stb
|
||||
print =============== sync_replica_alterTable_background_drop.sim step0: alter table and insert data
|
||||
$totalTableNum = 100
|
||||
|
||||
sql use $db
|
||||
|
||||
#sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
sql alter table $stb add column f1 double
|
||||
sql alter table $stb drop column c1
|
||||
|
||||
$tblNum = $totalTableNum
|
||||
$alterTblNum = 10
|
||||
|
||||
$i = 1
|
||||
while $i < $alterTblNum
|
||||
$tb = tb . $i
|
||||
sql insert into $tb values (now, 10001) (now + 1s, 10002) (now + 2s, 10003) (now + 3s, 10004)
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
sql connect
|
||||
|
||||
$db = db
|
||||
$stb = stb
|
||||
print =============== sync_replica_createTable_background_add.sim step0: create table and insert data
|
||||
$totalTableNum = 10
|
||||
|
||||
sql use $db
|
||||
|
||||
#sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
||||
# create table , insert data
|
||||
#$rowNum = 500
|
||||
$tblNum = 20
|
||||
$totalRows = 100
|
||||
$tsStart = 1420141600000
|
||||
$tsEnd = 0
|
||||
|
||||
$i = 10
|
||||
while $i < $tblNum
|
||||
$tb = tb . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
$x = 10
|
||||
$ts = $tsStart + $x
|
||||
sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x )
|
||||
|
||||
$totalRows = $totalRows + $x
|
||||
print info: inserted $x rows into $tb and totalRows: $totalRows
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
sql connect
|
||||
|
||||
$db = db
|
||||
$stb = stb
|
||||
print =============== sync_replica_dropDb_background.sim step0: drop db
|
||||
sql drop database if exists $db
|
|
@ -1,18 +0,0 @@
|
|||
sql connect
|
||||
|
||||
$db = db
|
||||
$stb = stb
|
||||
print =============== sync_replica_dropTable_background.sim step0: drop table
|
||||
$totalTableNum = 6
|
||||
|
||||
sql use $db
|
||||
|
||||
$tblNum = $totalTableNum
|
||||
$dropTblNum = 6
|
||||
|
||||
$i = 1
|
||||
while $i < $dropTblNum
|
||||
$tb = tb . $i
|
||||
sql drop table if exists $tb
|
||||
$i = $i + 1
|
||||
endw
|
|
@ -3,6 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
|||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
@ -34,7 +35,7 @@ if $data(2)[4] != ready then
|
|||
endi
|
||||
|
||||
print =============== step2: create database
|
||||
sql create database db vgroups 1
|
||||
sql create database db vgroups 4
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
|
@ -43,14 +44,9 @@ if $data(db)[4] != 1 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $data(2)[2] != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
# vnodes
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $data(2)[2] != 1 then
|
||||
if $data(2)[2] != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -61,13 +57,28 @@ if $data(2)[3] != 2 then
|
|||
endi
|
||||
|
||||
sql_error alter database db replica 3
|
||||
|
||||
sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 binary(16)) comment "abd"
|
||||
sql create table db.ctb using db.stb tags(101, "102")
|
||||
sql insert into db.ctb values(now, 1, "2")
|
||||
sql select * from db.stb
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql create table db.ctb0 using db.stb tags(100, "100")
|
||||
sql create table db.ctb1 using db.stb tags(101, "101")
|
||||
sql create table db.ctb2 using db.stb tags(102, "102")
|
||||
sql create table db.ctb3 using db.stb tags(103, "103")
|
||||
sql create table db.ctb4 using db.stb tags(104, "104")
|
||||
sql create table db.ctb5 using db.stb tags(105, "105")
|
||||
sql create table db.ctb6 using db.stb tags(106, "106")
|
||||
sql create table db.ctb7 using db.stb tags(107, "107")
|
||||
sql create table db.ctb8 using db.stb tags(108, "108")
|
||||
sql create table db.ctb9 using db.stb tags(109, "109")
|
||||
sql insert into db.ctb0 values(now, 0, "0")
|
||||
sql insert into db.ctb1 values(now, 1, "1")
|
||||
sql insert into db.ctb2 values(now, 2, "2")
|
||||
sql insert into db.ctb3 values(now, 3, "3")
|
||||
sql insert into db.ctb4 values(now, 4, "4")
|
||||
sql insert into db.ctb5 values(now, 5, "5")
|
||||
sql insert into db.ctb6 values(now, 6, "6")
|
||||
sql insert into db.ctb7 values(now, 7, "7")
|
||||
sql insert into db.ctb8 values(now, 8, "8")
|
||||
sql insert into db.ctb9 values(now, 9, "9")
|
||||
|
||||
print =============== step3: create dnodes
|
||||
sql create dnode $hostname port 7300
|
||||
|
@ -106,6 +117,8 @@ endi
|
|||
print ============= step4: alter database
|
||||
sql alter database db replica 3
|
||||
|
||||
$leaderIndex = 0
|
||||
|
||||
$x = 0
|
||||
step4:
|
||||
$x = $x + 1
|
||||
|
@ -114,46 +127,73 @@ step4:
|
|||
print ====> dnode not ready!
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show db.vgroups
|
||||
print ===> rows: $rows
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
if $data[0][4] != leader then
|
||||
goto step4
|
||||
endi
|
||||
if $data[0][6] != follower then
|
||||
goto step4
|
||||
endi
|
||||
if $data[0][8] != follower then
|
||||
if $data[0][4] == leader then
|
||||
$leaderIndex = 1
|
||||
endi
|
||||
if $data[0][6] == leader then
|
||||
$leaderIndex = 2
|
||||
endi
|
||||
if $data[0][8] == leader then
|
||||
$leaderIndex = 3
|
||||
endi
|
||||
|
||||
if $$leaderIndex == 0 then
|
||||
goto step4
|
||||
endi
|
||||
|
||||
print leaderIndex ==> $leaderIndex
|
||||
|
||||
print ============= step5: result
|
||||
$i = 0
|
||||
while $i < 10
|
||||
$i = $i + 1
|
||||
|
||||
sleep 1000
|
||||
$leaderIndex2 = 0
|
||||
sql show db.vgroups
|
||||
print ===> loop: $i | v0: $data03 $data04 | v1: $data05 $data06 | v2: $data07 $data08
|
||||
if $data[0][4] != leader then
|
||||
return -1
|
||||
if $data[0][4] == leader then
|
||||
$leaderIndex2 = 1
|
||||
endi
|
||||
if $data[0][6] == leader then
|
||||
return -1
|
||||
$leaderIndex2 = 2
|
||||
endi
|
||||
if $data[0][8] == leader then
|
||||
$leaderIndex2 = 3
|
||||
endi
|
||||
|
||||
print leaderIndex2 ==> $leaderIndex2
|
||||
if $leaderIndex2 != $leaderIndex then
|
||||
return -1
|
||||
endi
|
||||
|
||||
endw
|
||||
|
||||
|
||||
print ============= step5: stop dnode 2
|
||||
sql select * from db.stb
|
||||
print ============= step5: check data
|
||||
sql select * from db.ctb0
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
return
|
||||
sql select * from db.ctb1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.ctb2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.stb
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
|
|
|
@ -3,6 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
|||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
system sh/deploy.sh -n dnode4 -i 4
|
||||
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
@ -45,7 +46,7 @@ if $data(4)[4] != ready then
|
|||
endi
|
||||
|
||||
print =============== step2: create database
|
||||
sql create database db vgroups 1 replica 3
|
||||
sql create database db vgroups 4 replica 3
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
|
@ -54,26 +55,15 @@ if $data(db)[4] != 3 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $data(2)[2] != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data(3)[2] != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data(4)[2] != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
# vnodes
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $data(2)[2] != 1 then
|
||||
if $data(2)[2] != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data(3)[2] != 1 then
|
||||
if $data(3)[2] != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data(4)[2] != 1 then
|
||||
if $data(4)[2] != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -112,20 +102,50 @@ if $hasleader != 1 then
|
|||
endi
|
||||
|
||||
sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 binary(16)) comment "abd"
|
||||
sql create table db.ctb using db.stb tags(101, "102")
|
||||
sql insert into db.ctb values(now, 1, "2")
|
||||
sql create table db.ctb0 using db.stb tags(100, "100")
|
||||
sql create table db.ctb1 using db.stb tags(101, "101")
|
||||
sql create table db.ctb2 using db.stb tags(102, "102")
|
||||
sql create table db.ctb3 using db.stb tags(103, "103")
|
||||
sql create table db.ctb4 using db.stb tags(104, "104")
|
||||
sql create table db.ctb5 using db.stb tags(105, "105")
|
||||
sql create table db.ctb6 using db.stb tags(106, "106")
|
||||
sql create table db.ctb7 using db.stb tags(107, "107")
|
||||
sql create table db.ctb8 using db.stb tags(108, "108")
|
||||
sql create table db.ctb9 using db.stb tags(109, "109")
|
||||
sql insert into db.ctb0 values(now, 0, "0")
|
||||
sql insert into db.ctb1 values(now, 1, "1")
|
||||
sql insert into db.ctb2 values(now, 2, "2")
|
||||
sql insert into db.ctb3 values(now, 3, "3")
|
||||
sql insert into db.ctb4 values(now, 4, "4")
|
||||
sql insert into db.ctb5 values(now, 5, "5")
|
||||
sql insert into db.ctb6 values(now, 6, "6")
|
||||
sql insert into db.ctb7 values(now, 7, "7")
|
||||
sql insert into db.ctb8 values(now, 8, "8")
|
||||
sql insert into db.ctb9 values(now, 9, "9")
|
||||
|
||||
sql show db.vgroups
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08
|
||||
|
||||
sleep 100
|
||||
sql select * from db.ctb
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
|
||||
sql select * from db.ctb0
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.ctb1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.ctb2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.stb
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============= step3: alter database
|
||||
sql alter database db replica 1
|
||||
$hasleader = 0
|
||||
|
@ -140,7 +160,7 @@ step3:
|
|||
endi
|
||||
sql show db.vgroups
|
||||
print ===> rows: $rows
|
||||
if $rows != 1 then
|
||||
if $rows != 4 then
|
||||
goto step3
|
||||
endi
|
||||
if $data(2)[4] == leader then
|
||||
|
@ -157,11 +177,26 @@ if $hasleader != 1 then
|
|||
endi
|
||||
|
||||
print ============= step5: stop dnode 2
|
||||
sql select * from db.stb
|
||||
sql select * from db.ctb0
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.ctb1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.ctb2
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from db.stb
|
||||
if $rows != 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
|
|
|
@ -259,6 +259,8 @@ class TDTestCase:
|
|||
self.TDDnodes.init("")
|
||||
self.TDDnodes.setTestCluster(testCluster)
|
||||
self.TDDnodes.setValgrind(valgrind)
|
||||
|
||||
self.TDDnodes.setAsan(tdDnodes.getAsan())
|
||||
self.TDDnodes.stopAll()
|
||||
for dnode in self.TDDnodes.dnodes:
|
||||
self.TDDnodes.deploy(dnode.index,{})
|
||||
|
|
|
@ -7,6 +7,7 @@ import os
|
|||
from util.log import *
|
||||
from util.sql import *
|
||||
from util.cases import *
|
||||
from util.dnodes import *
|
||||
from util.dnodes import TDDnodes
|
||||
from util.dnodes import TDDnode
|
||||
import time
|
||||
|
@ -68,6 +69,8 @@ class TDTestCase:
|
|||
self.TDDnodes.init("")
|
||||
self.TDDnodes.setTestCluster(testCluster)
|
||||
self.TDDnodes.setValgrind(valgrind)
|
||||
|
||||
self.TDDnodes.setAsan(tdDnodes.getAsan())
|
||||
self.TDDnodes.stopAll()
|
||||
for dnode in self.TDDnodes.dnodes:
|
||||
self.TDDnodes.deploy(dnode.index,{})
|
||||
|
|
|
@ -8,6 +8,7 @@ import os
|
|||
from util.log import *
|
||||
from util.sql import *
|
||||
from util.cases import *
|
||||
from util.dnodes import *
|
||||
from util.dnodes import TDDnodes
|
||||
from util.dnodes import TDDnode
|
||||
import time
|
||||
|
@ -94,6 +95,8 @@ class TDTestCase:
|
|||
self.TDDnodes.init("")
|
||||
self.TDDnodes.setTestCluster(testCluster)
|
||||
self.TDDnodes.setValgrind(valgrind)
|
||||
|
||||
self.TDDnodes.setAsan(tdDnodes.getAsan())
|
||||
self.TDDnodes.stopAll()
|
||||
for dnode in self.TDDnodes.dnodes:
|
||||
self.TDDnodes.deploy(dnode.index,{})
|
||||
|
@ -249,6 +252,9 @@ class TDTestCase:
|
|||
tdSql.checkData(0,1,'%s:6030'%self.host)
|
||||
tdSql.checkData(4,1,'%s:6430'%self.host)
|
||||
tdSql.checkData(0,4,'ready')
|
||||
tdSql.checkData(1,4,'ready')
|
||||
tdSql.checkData(2,4,'ready')
|
||||
tdSql.checkData(3,4,'ready')
|
||||
tdSql.checkData(4,4,'ready')
|
||||
tdSql.query("select * from information_schema.ins_mnodes;")
|
||||
tdSql.checkRows(1)
|
||||
|
|
|
@ -159,6 +159,8 @@ class TDTestCase:
|
|||
self.TDDnodes.init("")
|
||||
self.TDDnodes.setTestCluster(testCluster)
|
||||
self.TDDnodes.setValgrind(valgrind)
|
||||
|
||||
self.TDDnodes.setAsan(tdDnodes.getAsan())
|
||||
self.TDDnodes.stopAll()
|
||||
for dnode in self.TDDnodes.dnodes:
|
||||
self.TDDnodes.deploy(dnode.index,{})
|
||||
|
|
|
@ -117,6 +117,8 @@ class TDTestCase:
|
|||
self.TDDnodes.init("")
|
||||
self.TDDnodes.setTestCluster(testCluster)
|
||||
self.TDDnodes.setValgrind(valgrind)
|
||||
|
||||
self.TDDnodes.setAsan(tdDnodes.getAsan())
|
||||
self.TDDnodes.stopAll()
|
||||
for dnode in self.TDDnodes.dnodes:
|
||||
self.TDDnodes.deploy(dnode.index,{})
|
||||
|
|
|
@ -7,12 +7,12 @@ python3 .\test.py -f 0-others\taosdMonitor.py
|
|||
@REM python3 .\test.py -f 0-others\udfTest.py
|
||||
@REM python3 .\test.py -f 0-others\udf_create.py
|
||||
@REM python3 .\test.py -f 0-others\udf_restart_taosd.py
|
||||
@REM python3 .\test.py -f 0-others\cachelast.py
|
||||
python3 .\test.py -f 0-others\cachemodel.py
|
||||
|
||||
@REM python3 .\test.py -f 0-others\user_control.py
|
||||
@REM python3 .\test.py -f 0-others\fsync.py
|
||||
|
||||
@REM python3 .\test.py -f 1-insert\influxdb_line_taosc_insert.py
|
||||
python3 .\test.py -f 1-insert\influxdb_line_taosc_insert.py
|
||||
@REM python3 .\test.py -f 1-insert\opentsdb_telnet_line_taosc_insert.py
|
||||
@REM python3 .\test.py -f 1-insert\opentsdb_json_taosc_insert.py
|
||||
@REM #python3 .\test.py -f 1-insert\test_stmt_muti_insert_query.py
|
||||
|
@ -72,7 +72,7 @@ python3 .\test.py -f 0-others\taosdMonitor.py
|
|||
@REM python3 .\test.py -f 2-query\arcsin.py
|
||||
@REM python3 .\test.py -f 2-query\arccos.py
|
||||
@REM python3 .\test.py -f 2-query\arctan.py
|
||||
@REM python3 .\test.py -f 2-query\query_cols_tags_and_or.py
|
||||
python3 .\test.py -f 2-query\query_cols_tags_and_or.py
|
||||
@REM # python3 .\test.py -f 2-query\nestedQuery.py
|
||||
@REM # TD-15983 subquery output duplicate name column.
|
||||
@REM # Please Xiangyang Guo modify the following script
|
||||
|
@ -94,7 +94,7 @@ python3 .\test.py -f 0-others\taosdMonitor.py
|
|||
@REM python3 .\test.py -f 7-tmq\subscribeDb.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeDb0.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeDb1.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeStb.py
|
||||
python3 .\test.py -f 7-tmq\subscribeStb.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeStb0.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeStb1.py
|
||||
@REM python3 .\test.py -f 7-tmq\subscribeStb2.py
|
||||
|
|
|
@ -90,7 +90,7 @@ goto :eof
|
|||
|
||||
:CheckSkipCase
|
||||
set skipCase=false
|
||||
if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=true )
|
||||
if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=true )
|
||||
if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=false )
|
||||
if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=false )
|
||||
echo %* | grep "\-R" && set skipCase=true
|
||||
:goto eof
|
Loading…
Reference in New Issue