Merge remote-tracking branch 'origin/develop' into feature/crash_gen
This commit is contained in:
commit
e98867baef
|
@ -14,5 +14,6 @@ ADD_SUBDIRECTORY(mnode)
|
|||
ADD_SUBDIRECTORY(vnode)
|
||||
ADD_SUBDIRECTORY(tsdb)
|
||||
ADD_SUBDIRECTORY(wal)
|
||||
ADD_SUBDIRECTORY(cq)
|
||||
ADD_SUBDIRECTORY(dnode)
|
||||
ADD_SUBDIRECTORY(connector/jdbc)
|
||||
|
|
|
@ -312,8 +312,6 @@ typedef struct SSqlObj {
|
|||
void (*fp)();
|
||||
void (*fetchFp)();
|
||||
void * param;
|
||||
uint32_t ip;
|
||||
short vnode;
|
||||
int64_t stime;
|
||||
uint32_t queryId;
|
||||
void * pStream;
|
||||
|
|
|
@ -206,7 +206,6 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
|||
case TSDB_SQL_DROP_ACCT:
|
||||
case TSDB_SQL_DROP_DNODE:
|
||||
case TSDB_SQL_DROP_DB: {
|
||||
const char* msg1 = "invalid ip address";
|
||||
const char* msg2 = "invalid name";
|
||||
const char* msg3 = "param name too long";
|
||||
|
||||
|
@ -230,10 +229,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
|||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
|
||||
}
|
||||
} else if (pInfo->type == TSDB_SQL_DROP_DNODE) {
|
||||
if (!validateIpAddress(pzName->z, pzName->n)) {
|
||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
||||
}
|
||||
|
||||
pzName->n = strdequote(pzName->z);
|
||||
strncpy(pTableMetaInfo->name, pzName->z, pzName->n);
|
||||
} else { // drop user
|
||||
if (pzName->n > TSDB_USER_LEN) {
|
||||
|
@ -304,10 +300,6 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
|||
}
|
||||
|
||||
SSQLToken* pIpAddr = &pInfo->pDCLInfo->a[0];
|
||||
// if (!validateIpAddress(pIpAddr->z, pIpAddr->n)) {
|
||||
// return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg);
|
||||
// }
|
||||
|
||||
pIpAddr->n = strdequote(pIpAddr->z);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,13 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
|
|||
// offset of cmd in SSqlObj structure
|
||||
char *pSqlObjAddr = (char *)pCmd - offsetof(SSqlObj, cmd);
|
||||
|
||||
if (pMemBuffer == NULL || pDesc->pColumnModel == NULL) {
|
||||
if (pMemBuffer == NULL) {
|
||||
tscError("%p pMemBuffer", pMemBuffer);
|
||||
pRes->code = TSDB_CODE_APP_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
if (pDesc->pColumnModel == NULL) {
|
||||
tscLocalReducerEnvDestroy(pMemBuffer, pDesc, finalmodel, numOfBuffer);
|
||||
|
||||
tscError("%p no local buffer or intermediate result format model", pSqlObjAddr);
|
||||
|
|
|
@ -231,7 +231,11 @@ int tscSendMsgToServer(SSqlObj *pSql) {
|
|||
|
||||
void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
|
||||
SSqlObj *pSql = (SSqlObj *)rpcMsg->handle;
|
||||
if (pSql == NULL || pSql->signature != pSql) {
|
||||
if (pSql == NULL) {
|
||||
tscError("%p sql is already released", pSql->signature);
|
||||
return;
|
||||
}
|
||||
if (pSql->signature != pSql) {
|
||||
tscError("%p sql is already released, signature:%p", pSql, pSql->signature);
|
||||
return;
|
||||
}
|
||||
|
@ -313,7 +317,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg) {
|
|||
pRes->rspType = rpcMsg->msgType;
|
||||
pRes->rspLen = rpcMsg->contLen;
|
||||
|
||||
if (pRes->rspLen > 0) {
|
||||
if (pRes->rspLen > 0 && rpcMsg->pCont) {
|
||||
char *tmp = (char *)realloc(pRes->pRsp, pRes->rspLen);
|
||||
if (tmp == NULL) {
|
||||
pRes->code = TSDB_CODE_CLI_OUT_OF_MEMORY;
|
||||
|
|
|
@ -172,17 +172,17 @@ static void tscSetTimestampForRes(SSqlStream *pStream, SSqlObj *pSql) {
|
|||
static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOfRows) {
|
||||
SSqlStream * pStream = (SSqlStream *)param;
|
||||
SSqlObj * pSql = (SSqlObj *)res;
|
||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
||||
|
||||
if (pSql == NULL || numOfRows < 0) {
|
||||
int64_t retryDelayTime = tscGetRetryDelayTime(pStream->slidingTime, pStream->precision);
|
||||
tscError("%p stream:%p, retrieve data failed, code:%d, retry in %" PRId64 "ms", pSql, pStream, numOfRows, retryDelayTime);
|
||||
tscClearTableMetaInfo(pTableMetaInfo, true);
|
||||
|
||||
tscSetRetryTimer(pStream, pStream->pSql, retryDelayTime);
|
||||
return;
|
||||
}
|
||||
|
||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
||||
|
||||
if (numOfRows > 0) { // when reaching here the first execution of stream computing is successful.
|
||||
pStream->numOfRes += numOfRows;
|
||||
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
|
||||
|
|
|
@ -757,7 +757,9 @@ void tscCloseTscObj(STscObj* pObj) {
|
|||
taosTmrStopA(&(pObj->pTimer));
|
||||
tscFreeSqlObj(pSql);
|
||||
|
||||
if (pSql) {
|
||||
sem_destroy(&pSql->rspSem);
|
||||
}
|
||||
rpcClose(pObj->pMgmtConn);
|
||||
|
||||
pthread_mutex_destroy(&pObj->mutex);
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
PROJECT(TDengine)
|
||||
|
||||
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
|
||||
INCLUDE_DIRECTORIES(inc)
|
||||
|
||||
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SRC)
|
||||
|
||||
ADD_LIBRARY(tcq ${SRC})
|
||||
TARGET_LINK_LIBRARIES(tcq tutil common taos)
|
||||
|
||||
ADD_SUBDIRECTORY(test)
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
/*
|
||||
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||
*
|
||||
* This program is free software: you can use, redistribute, and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3
|
||||
* or later ("AGPL"), as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "tlog.h"
|
||||
#include "twal.h"
|
||||
#include "tcq.h"
|
||||
#include "taos.h"
|
||||
|
||||
#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__);}
|
||||
#define cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);}
|
||||
#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);}
|
||||
#define cPrint(...) {taosPrintLog("WAL ", 255, __VA_ARGS__);}
|
||||
|
||||
typedef struct {
|
||||
int vgId;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_PASSWORD_LEN];
|
||||
FCqWrite cqWrite;
|
||||
void *ahandle;
|
||||
int num; // number of continuous streams
|
||||
struct SCqObj *pHead;
|
||||
void *dbConn;
|
||||
pthread_mutex_t mutex;
|
||||
} SCqContext;
|
||||
|
||||
typedef struct SCqObj {
|
||||
int tid; // table ID
|
||||
int rowSize; // bytes of a row
|
||||
char *sqlStr; // SQL string
|
||||
int columns; // number of columns
|
||||
SSchema *pSchema; // pointer to schema array
|
||||
void *pStream;
|
||||
struct SCqObj *prev;
|
||||
struct SCqObj *next;
|
||||
SCqContext *pContext;
|
||||
} SCqObj;
|
||||
|
||||
int cqDebugFlag = 135;
|
||||
|
||||
static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row);
|
||||
|
||||
void *cqOpen(void *ahandle, const SCqCfg *pCfg) {
|
||||
|
||||
SCqContext *pContext = calloc(sizeof(SCqContext), 1);
|
||||
if (pContext == NULL) return NULL;
|
||||
|
||||
strcpy(pContext->user, pCfg->user);
|
||||
strcpy(pContext->pass, pCfg->pass);
|
||||
pContext->vgId = pCfg->vgId;
|
||||
pContext->cqWrite = pCfg->cqWrite;
|
||||
pContext->ahandle = ahandle;
|
||||
|
||||
pthread_mutex_init(&pContext->mutex, NULL);
|
||||
|
||||
cTrace("vgId:%d, CQ is opened", pContext->vgId);
|
||||
|
||||
return pContext;
|
||||
}
|
||||
|
||||
void cqClose(void *handle) {
|
||||
SCqContext *pContext = handle;
|
||||
|
||||
// stop all CQs
|
||||
cqStop(pContext);
|
||||
|
||||
// free all resources
|
||||
SCqObj *pObj = pContext->pHead;
|
||||
while (pObj) {
|
||||
SCqObj *pTemp = pObj;
|
||||
pObj = pObj->next;
|
||||
free(pTemp);
|
||||
}
|
||||
|
||||
pthread_mutex_destroy(&pContext->mutex);
|
||||
|
||||
cTrace("vgId:%d, CQ is closed", pContext->vgId);
|
||||
free(pContext);
|
||||
}
|
||||
|
||||
void cqStart(void *handle) {
|
||||
SCqContext *pContext = handle;
|
||||
cTrace("vgId:%d, start all CQs", pContext->vgId);
|
||||
if (pContext->dbConn) return;
|
||||
|
||||
pthread_mutex_lock(&pContext->mutex);
|
||||
|
||||
tscEmbedded = 1;
|
||||
pContext->dbConn = taos_connect("localhost", pContext->user, pContext->pass, NULL, 0);
|
||||
if (pContext->dbConn == NULL) {
|
||||
cError("vgId:%d, failed to connect to TDengine(%s)", pContext->vgId, tstrerror(terrno));
|
||||
pthread_mutex_unlock(&pContext->mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
SCqObj *pObj = pContext->pHead;
|
||||
while (pObj) {
|
||||
int64_t lastKey = 0;
|
||||
pObj->pStream = taos_open_stream(pContext->dbConn, pObj->sqlStr, cqProcessStreamRes, lastKey, pObj, NULL);
|
||||
if (pObj->pStream) {
|
||||
pContext->num++;
|
||||
cTrace("vgId:%d, id:%d CQ:%s is openned", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
} else {
|
||||
cError("vgId:%d, id:%d CQ:%s, failed to open", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
}
|
||||
pObj = pObj->next;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&pContext->mutex);
|
||||
}
|
||||
|
||||
void cqStop(void *handle) {
|
||||
SCqContext *pContext = handle;
|
||||
cTrace("vgId:%d, stop all CQs", pContext->vgId);
|
||||
if (pContext->dbConn == NULL) return;
|
||||
|
||||
pthread_mutex_lock(&pContext->mutex);
|
||||
|
||||
SCqObj *pObj = pContext->pHead;
|
||||
while (pObj) {
|
||||
if (pObj->pStream) {
|
||||
taos_close_stream(pObj->pStream);
|
||||
pObj->pStream = NULL;
|
||||
cTrace("vgId:%d, id:%d CQ:%s is closed", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
}
|
||||
|
||||
pObj = pObj->next;
|
||||
}
|
||||
|
||||
if (pContext->dbConn) taos_close(pContext->dbConn);
|
||||
pContext->dbConn = NULL;
|
||||
|
||||
pthread_mutex_unlock(&pContext->mutex);
|
||||
}
|
||||
|
||||
void *cqCreate(void *handle, int tid, char *sqlStr, SSchema *pSchema, int columns) {
|
||||
SCqContext *pContext = handle;
|
||||
|
||||
SCqObj *pObj = calloc(sizeof(SCqObj), 1);
|
||||
if (pObj == NULL) return NULL;
|
||||
|
||||
pObj->tid = tid;
|
||||
pObj->sqlStr = malloc(strlen(sqlStr)+1);
|
||||
strcpy(pObj->sqlStr, sqlStr);
|
||||
|
||||
pObj->columns = columns;
|
||||
|
||||
int size = sizeof(SSchema) * columns;
|
||||
pObj->pSchema = malloc(size);
|
||||
memcpy(pObj->pSchema, pSchema, size);
|
||||
|
||||
cTrace("vgId:%d, id:%d CQ:%s is created", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
|
||||
pthread_mutex_lock(&pContext->mutex);
|
||||
|
||||
pObj->next = pContext->pHead;
|
||||
if (pContext->pHead) pContext->pHead->prev = pObj;
|
||||
pContext->pHead = pObj;
|
||||
|
||||
if (pContext->dbConn) {
|
||||
int64_t lastKey = 0;
|
||||
pObj->pStream = taos_open_stream(pContext->dbConn, pObj->sqlStr, cqProcessStreamRes, lastKey, pObj, NULL);
|
||||
if (pObj->pStream) {
|
||||
pContext->num++;
|
||||
cTrace("vgId:%d, id:%d CQ:%s is openned", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
} else {
|
||||
cError("vgId:%d, id:%d CQ:%s, failed to launch", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&pContext->mutex);
|
||||
|
||||
return pObj;
|
||||
}
|
||||
|
||||
void cqDrop(void *handle) {
|
||||
SCqObj *pObj = handle;
|
||||
SCqContext *pContext = pObj->pContext;
|
||||
|
||||
pthread_mutex_lock(&pContext->mutex);
|
||||
|
||||
if (pObj->prev) {
|
||||
pObj->prev->next = pObj->next;
|
||||
} else {
|
||||
pContext->pHead = pObj->next;
|
||||
}
|
||||
|
||||
if (pObj->next) {
|
||||
pObj->next->prev = pObj->prev;
|
||||
}
|
||||
|
||||
// free the resources associated
|
||||
if (pObj->pStream) taos_close_stream(pObj->pStream);
|
||||
pObj->pStream = NULL;
|
||||
|
||||
cTrace("vgId:%d, id:%d CQ:%s is dropped", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
free(pObj);
|
||||
|
||||
pthread_mutex_lock(&pContext->mutex);
|
||||
}
|
||||
|
||||
static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
|
||||
SCqObj *pObj = (SCqObj *)param;
|
||||
SCqContext *pContext = pObj->pContext;
|
||||
if (pObj->pStream == NULL) return;
|
||||
|
||||
cTrace("vgId:%d, id:%d CQ:%s stream result is ready", pContext->vgId, pObj->tid, pObj->sqlStr);
|
||||
|
||||
// construct data
|
||||
int size = sizeof(SWalHead) + sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + pObj->rowSize;
|
||||
char *buffer = calloc(size, 1);
|
||||
|
||||
SWalHead *pHead = (SWalHead *)buffer;
|
||||
pHead->msgType = TSDB_MSG_TYPE_SUBMIT;
|
||||
pHead->len = size - sizeof(SWalHead);
|
||||
|
||||
SSubmitMsg *pSubmit = (SSubmitMsg *) (buffer + sizeof(SWalHead));
|
||||
// to do: fill in the SSubmitMsg structure
|
||||
pSubmit->numOfBlocks = 1;
|
||||
|
||||
|
||||
SSubmitBlk *pBlk = (SSubmitBlk *) (buffer + sizeof(SWalHead) + sizeof(SSubmitMsg));
|
||||
// to do: fill in the SSubmitBlk strucuture
|
||||
pBlk->tid = pObj->tid;
|
||||
|
||||
|
||||
// write into vnode write queue
|
||||
pContext->cqWrite(pContext->ahandle, pHead, TAOS_QTYPE_CQ);
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
PROJECT(TDengine)
|
||||
|
||||
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
|
||||
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
|
||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
|
||||
INCLUDE_DIRECTORIES(../inc)
|
||||
|
||||
LIST(APPEND CQTEST_SRC ./cqtest.c)
|
||||
ADD_EXECUTABLE(cqtest ${CQTEST_SRC})
|
||||
TARGET_LINK_LIBRARIES(cqtest tcq)
|
||||
|
||||
ENDIF ()
|
||||
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||
*
|
||||
* This program is free software: you can use, redistribute, and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3
|
||||
* or later ("AGPL"), as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "taosmsg.h"
|
||||
#include "tglobal.h"
|
||||
#include "tlog.h"
|
||||
#include "tcq.h"
|
||||
|
||||
int64_t ver = 0;
|
||||
void *pCq = NULL;
|
||||
|
||||
int writeToQueue(void *pVnode, void *data, int type) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int num = 3;
|
||||
|
||||
for (int i=1; i<argc; ++i) {
|
||||
if (strcmp(argv[i], "-d")==0 && i < argc-1) {
|
||||
ddebugFlag = atoi(argv[++i]);
|
||||
} else if (strcmp(argv[i], "-n") == 0 && i <argc-1) {
|
||||
num = atoi(argv[++i]);
|
||||
} else {
|
||||
printf("\nusage: %s [options] \n", argv[0]);
|
||||
printf(" [-n num]: number of streams, default:%d\n", num);
|
||||
printf(" [-d debugFlag]: debug flag, default:%d\n", ddebugFlag);
|
||||
printf(" [-h help]: print out this help\n\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
taosInitLog("cq.log", 100000, 10);
|
||||
|
||||
SCqCfg cqCfg;
|
||||
strcpy(cqCfg.user, "root");
|
||||
strcpy(cqCfg.pass, "taosdata");
|
||||
cqCfg.vgId = 2;
|
||||
cqCfg.cqWrite = writeToQueue;
|
||||
|
||||
pCq = cqOpen(NULL, &cqCfg);
|
||||
if (pCq == NULL) {
|
||||
printf("failed to open CQ\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
SSchema schema[2];
|
||||
schema[0].type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||
strcpy(schema[0].name, "ts");
|
||||
schema[0].colId = 0;
|
||||
schema[0].bytes = 8;
|
||||
|
||||
schema[1].type = TSDB_DATA_TYPE_INT;
|
||||
strcpy(schema[1].name, "avgspeed");
|
||||
schema[1].colId = 1;
|
||||
schema[1].bytes = 4;
|
||||
|
||||
for (int sid =1; sid<10; ++sid) {
|
||||
cqCreate(pCq, sid, "select avg(speed) from demo.t1 sliding(1s) interval(5s)", schema, 2);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
char c = getchar();
|
||||
|
||||
switch(c) {
|
||||
case 's':
|
||||
cqStart(pCq);
|
||||
break;
|
||||
case 't':
|
||||
cqStop(pCq);
|
||||
break;
|
||||
case 'c':
|
||||
// create a CQ
|
||||
break;
|
||||
case 'd':
|
||||
// drop a CQ
|
||||
break;
|
||||
case 'q':
|
||||
break;
|
||||
default:
|
||||
printf("invalid command:%c", c);
|
||||
}
|
||||
|
||||
if (c=='q') break;
|
||||
}
|
||||
|
||||
cqClose(pCq);
|
||||
|
||||
taosCloseLog();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -213,6 +213,7 @@ static void dnodeCheckDataDirOpenned(char *dir) {
|
|||
int32_t ret = flock(fd, LOCK_EX | LOCK_NB);
|
||||
if (ret != 0) {
|
||||
dError("failed to lock file:%s ret:%d, database may be running, quit", filepath, ret);
|
||||
close(fd);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -335,6 +335,11 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
|
|||
#define TSDB_PORT_MNODEDNODE 15
|
||||
#define TSDB_PORT_SYNC 20
|
||||
|
||||
#define TAOS_QTYPE_RPC 0
|
||||
#define TAOS_QTYPE_FWD 1
|
||||
#define TAOS_QTYPE_WAL 2
|
||||
#define TAOS_QTYPE_CQ 3
|
||||
|
||||
typedef enum {
|
||||
TSDB_PRECISION_MILLI,
|
||||
TSDB_PRECISION_MICRO,
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||
*
|
||||
* This program is free software: you can use, redistribute, and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3
|
||||
* or later ("AGPL"), as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _TD_CQ_H_
|
||||
#define _TD_CQ_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef int (*FCqWrite)(void *ahandle, void *pHead, int type);
|
||||
|
||||
typedef struct {
|
||||
int vgId;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_PASSWORD_LEN];
|
||||
FCqWrite cqWrite;
|
||||
} SCqCfg;
|
||||
|
||||
// the following API shall be called by vnode
|
||||
void *cqOpen(void *ahandle, const SCqCfg *pCfg);
|
||||
void cqClose(void *handle);
|
||||
|
||||
// if vnode is master, vnode call this API to start CQ
|
||||
void cqStart(void *handle);
|
||||
|
||||
// if vnode is slave/unsynced, vnode shall call this API to stop CQ
|
||||
void cqStop(void *handle);
|
||||
|
||||
// cqCreate is called by TSDB to start an instance of CQ
|
||||
void *cqCreate(void *handle, int sid, char *sqlStr, SSchema *pSchema, int columns);
|
||||
|
||||
// cqDrop is called by TSDB to stop an instance of CQ, handle is the return value of cqCreate
|
||||
void cqDrop(void *handle);
|
||||
|
||||
extern int cqDebugFlag;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _TD_CQ_H_
|
|
@ -38,9 +38,9 @@ extern "C" {
|
|||
typedef struct {
|
||||
// WAL handle
|
||||
void *appH;
|
||||
void *cqH;
|
||||
int (*walCallBack)(void *);
|
||||
int (*eventCallBack)(void *);
|
||||
int (*cqueryCallBack)(void *);
|
||||
} STsdbAppH;
|
||||
|
||||
// --------- TSDB REPOSITORY CONFIGURATION DEFINITION
|
||||
|
|
|
@ -142,6 +142,7 @@ static void shellSourceFile(TAOS *con, char *fptr) {
|
|||
|
||||
if (wordexp(fptr, &full_path, 0) != 0) {
|
||||
fprintf(stderr, "ERROR: illegal file name\n");
|
||||
free(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,13 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
|||
if (arg) arguments->password = arg;
|
||||
break;
|
||||
case 'P':
|
||||
if (arg) {
|
||||
tsMnodeShellPort = atoi(arg);
|
||||
} else {
|
||||
fprintf(stderr, "Invalid port\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
case 't':
|
||||
arguments->timezone = arg;
|
||||
|
@ -101,7 +107,12 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
|||
wordfree(&full_path);
|
||||
break;
|
||||
case 'T':
|
||||
if (arg) {
|
||||
arguments->threadNum = atoi(arg);
|
||||
} else {
|
||||
fprintf(stderr, "Invalid number of threads\n");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
arguments->database = arg;
|
||||
|
|
|
@ -340,6 +340,9 @@ int main(int argc, char *argv[]) {
|
|||
int count_data_type = 0;
|
||||
char dataString[512];
|
||||
bool do_aggreFunc = true;
|
||||
|
||||
memset(dataString, 0, 512);
|
||||
|
||||
if (strcasecmp(data_type[0], "BINARY") == 0 || strcasecmp(data_type[0], "BOOL") == 0) {
|
||||
do_aggreFunc = false;
|
||||
}
|
||||
|
|
|
@ -383,14 +383,13 @@ int taosGetTableRecordInfo(char *table, STableRecordInfo *pTableRecordInfo) {
|
|||
|
||||
TAOS_FIELD *fields = taos_fetch_fields(result);
|
||||
|
||||
while ((row = taos_fetch_row(result)) != NULL) {
|
||||
if ((row = taos_fetch_row(result)) != NULL) {
|
||||
isSet = true;
|
||||
pTableRecordInfo->isMetric = false;
|
||||
strncpy(pTableRecordInfo->tableRecord.name, (char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
|
||||
fields[TSDB_SHOW_TABLES_NAME_INDEX].bytes);
|
||||
strncpy(pTableRecordInfo->tableRecord.metric, (char *)row[TSDB_SHOW_TABLES_METRIC_INDEX],
|
||||
fields[TSDB_SHOW_TABLES_METRIC_INDEX].bytes);
|
||||
break;
|
||||
}
|
||||
|
||||
taos_free_result(result);
|
||||
|
@ -410,11 +409,10 @@ int taosGetTableRecordInfo(char *table, STableRecordInfo *pTableRecordInfo) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
while ((row = taos_fetch_row(result)) != NULL) {
|
||||
if ((row = taos_fetch_row(result)) != NULL) {
|
||||
isSet = true;
|
||||
pTableRecordInfo->isMetric = true;
|
||||
strcpy(pTableRecordInfo->tableRecord.metric, table);
|
||||
break;
|
||||
}
|
||||
|
||||
taos_free_result(result);
|
||||
|
|
|
@ -32,8 +32,8 @@ struct SMnodeObj;
|
|||
typedef struct SDnodeObj {
|
||||
int32_t dnodeId;
|
||||
uint16_t dnodePort;
|
||||
char dnodeFqdn[TSDB_FQDN_LEN];
|
||||
char dnodeEp[TSDB_FQDN_LEN];
|
||||
char dnodeFqdn[TSDB_FQDN_LEN + 1];
|
||||
char dnodeEp[TSDB_FQDN_LEN + 1];
|
||||
int64_t createdTime;
|
||||
uint32_t lastAccess;
|
||||
int32_t openVnodes;
|
||||
|
@ -96,7 +96,7 @@ typedef struct {
|
|||
int32_t numOfColumns; //used by normal table
|
||||
int32_t sid;
|
||||
int32_t vgId;
|
||||
char superTableId[TSDB_TABLE_ID_LEN + 1];
|
||||
uint64_t suid;
|
||||
int32_t sqlLen;
|
||||
int8_t reserved[1];
|
||||
int8_t updateEnd[1];
|
||||
|
|
|
@ -38,7 +38,7 @@ void * mgmtGetNextDnode(void *pNode, SDnodeObj **pDnode);
|
|||
void mgmtIncDnodeRef(SDnodeObj *pDnode);
|
||||
void mgmtDecDnodeRef(SDnodeObj *pDnode);
|
||||
void * mgmtGetDnode(int32_t dnodeId);
|
||||
void * mgmtGetDnodeByIp(char *ep);
|
||||
void * mgmtGetDnodeByEp(char *ep);
|
||||
void mgmtUpdateDnode(SDnodeObj *pDnode);
|
||||
int32_t mgmtDropDnode(SDnodeObj *pDnode);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ void mgmtCleanUpVgroups();
|
|||
SVgObj *mgmtGetVgroup(int32_t vgId);
|
||||
void mgmtIncVgroupRef(SVgObj *pVgroup);
|
||||
void mgmtDecVgroupRef(SVgObj *pVgroup);
|
||||
void mgmtDropAllDbVgroups(SDbObj *pDropDb);
|
||||
void mgmtDropAllDbVgroups(SDbObj *pDropDb, bool sendMsg);
|
||||
void mgmtDropAllDnodeVgroups(SDnodeObj *pDropDnode);
|
||||
|
||||
void * mgmtGetNextVgroup(void *pNode, SVgObj **pVgroup);
|
||||
|
|
|
@ -82,7 +82,7 @@ static int32_t mgmtDbActionDelete(SSdbOper *pOper) {
|
|||
mgmtDropDbFromAcct(pAcct, pDb);
|
||||
mgmtDropAllChildTables(pDb);
|
||||
mgmtDropAllSuperTables(pDb);
|
||||
mgmtDropAllDbVgroups(pDb);
|
||||
mgmtDropAllDbVgroups(pDb, false);
|
||||
mgmtDecAcctRef(pAcct);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -261,6 +261,13 @@ static int32_t mgmtCheckDbCfg(SDbCfg *pCfg) {
|
|||
return TSDB_CODE_INVALID_OPTION;
|
||||
}
|
||||
|
||||
#ifndef _SYNC
|
||||
if (pCfg->replications != 1) {
|
||||
mError("invalid db option replications:%d can only be 1 in this version", pCfg->replications);
|
||||
return TSDB_CODE_INVALID_OPTION;
|
||||
}
|
||||
#endif
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -932,7 +939,9 @@ static void mgmtProcessDropDbMsg(SQueuedMsg *pMsg) {
|
|||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
mgmtDropAllDbVgroups(pMsg->pDb, true);
|
||||
#else
|
||||
SVgObj *pVgroup = pMsg->pDb->pHead;
|
||||
if (pVgroup != NULL) {
|
||||
mPrint("vgId:%d, will be dropped", pVgroup->vgId);
|
||||
|
|
|
@ -74,7 +74,9 @@ static int32_t mgmtDnodeActionInsert(SSdbOper *pOper) {
|
|||
static int32_t mgmtDnodeActionDelete(SSdbOper *pOper) {
|
||||
SDnodeObj *pDnode = pOper->pObj;
|
||||
|
||||
#ifndef _SYNC
|
||||
mgmtDropAllDnodeVgroups(pDnode);
|
||||
#endif
|
||||
mgmtDropMnodeLocal(pDnode->dnodeId);
|
||||
balanceNotify();
|
||||
|
||||
|
@ -113,7 +115,7 @@ static int32_t mgmtDnodeActionRestored() {
|
|||
int32_t numOfRows = sdbGetNumOfRows(tsDnodeSdb);
|
||||
if (numOfRows <= 0 && dnodeIsFirstDeploy()) {
|
||||
mgmtCreateDnode(tsLocalEp);
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByIp(tsLocalEp);
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByEp(tsLocalEp);
|
||||
mgmtAddMnode(pDnode->dnodeId);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
}
|
||||
|
@ -181,7 +183,7 @@ void *mgmtGetDnode(int32_t dnodeId) {
|
|||
return sdbGetRow(tsDnodeSdb, &dnodeId);
|
||||
}
|
||||
|
||||
void *mgmtGetDnodeByIp(char *ep) {
|
||||
void *mgmtGetDnodeByEp(char *ep) {
|
||||
SDnodeObj *pDnode = NULL;
|
||||
void * pNode = NULL;
|
||||
|
||||
|
@ -271,7 +273,7 @@ void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
|||
|
||||
SDnodeObj *pDnode = NULL;
|
||||
if (pStatus->dnodeId == 0) {
|
||||
pDnode = mgmtGetDnodeByIp(pStatus->dnodeEp);
|
||||
pDnode = mgmtGetDnodeByEp(pStatus->dnodeEp);
|
||||
if (pDnode == NULL) {
|
||||
mTrace("dnode %s not created", pStatus->dnodeEp);
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_DNODE_NOT_EXIST);
|
||||
|
@ -358,7 +360,7 @@ static int32_t mgmtCreateDnode(char *ep) {
|
|||
return grantCode;
|
||||
}
|
||||
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByIp(ep);
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByEp(ep);
|
||||
if (pDnode != NULL) {
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
mError("dnode:%d is alredy exist, %s:%d", pDnode->dnodeId, pDnode->dnodeFqdn, pDnode->dnodePort);
|
||||
|
@ -391,6 +393,7 @@ static int32_t mgmtCreateDnode(char *ep) {
|
|||
return code;
|
||||
}
|
||||
|
||||
//TODO drop others tables
|
||||
int32_t mgmtDropDnode(SDnodeObj *pDnode) {
|
||||
SSdbOper oper = {
|
||||
.type = SDB_OPER_GLOBAL,
|
||||
|
@ -407,8 +410,9 @@ int32_t mgmtDropDnode(SDnodeObj *pDnode) {
|
|||
return code;
|
||||
}
|
||||
|
||||
static int32_t mgmtDropDnodeByIp(char *ep) {
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByIp(ep);
|
||||
static int32_t mgmtDropDnodeByEp(char *ep) {
|
||||
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByEp(ep);
|
||||
if (pDnode == NULL) {
|
||||
mError("dnode:%s, is not exist", ep);
|
||||
return TSDB_CODE_DNODE_NOT_EXIST;
|
||||
|
@ -437,7 +441,7 @@ static void mgmtProcessCreateDnodeMsg(SQueuedMsg *pMsg) {
|
|||
} else {
|
||||
rpcRsp.code = mgmtCreateDnode(pCreate->ep);
|
||||
if (rpcRsp.code == TSDB_CODE_SUCCESS) {
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByIp(pCreate->ep);
|
||||
SDnodeObj *pDnode = mgmtGetDnodeByEp(pCreate->ep);
|
||||
mLPrint("dnode:%d, %s is created by %s", pDnode->dnodeId, pCreate->ep, pMsg->pUser->user);
|
||||
mgmtDecDnodeRef(pDnode);
|
||||
} else {
|
||||
|
@ -456,7 +460,7 @@ static void mgmtProcessDropDnodeMsg(SQueuedMsg *pMsg) {
|
|||
if (strcmp(pMsg->pUser->user, "root") != 0) {
|
||||
rpcRsp.code = TSDB_CODE_NO_RIGHTS;
|
||||
} else {
|
||||
rpcRsp.code = mgmtDropDnodeByIp(pDrop->ep);
|
||||
rpcRsp.code = mgmtDropDnodeByEp(pDrop->ep);
|
||||
if (rpcRsp.code == TSDB_CODE_SUCCESS) {
|
||||
mLPrint("dnode:%s is dropped by %s", pDrop->ep, pMsg->pUser->user);
|
||||
} else {
|
||||
|
@ -812,7 +816,7 @@ static int32_t mgmtGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
|
|||
|
||||
SDnodeObj *pDnode = NULL;
|
||||
if (pShow->payloadLen > 0 ) {
|
||||
pDnode = mgmtGetDnodeByIp(pShow->payload);
|
||||
pDnode = mgmtGetDnodeByEp(pShow->payload);
|
||||
} else {
|
||||
mgmtGetNextDnode(NULL, (SDnodeObj **)&pDnode);
|
||||
}
|
||||
|
|
|
@ -184,6 +184,7 @@ void sdbUpdateMnodeRoles() {
|
|||
if (pMnode != NULL) {
|
||||
pMnode->role = roles.role[i];
|
||||
sdbPrint("mnode:%d, role:%s", pMnode->mnodeId, mgmtGetMnodeRoleStr(pMnode->role));
|
||||
if (pMnode->mnodeId == dnodeGetDnodeId()) tsSdbObj.role = pMnode->role;
|
||||
mgmtDecMnodeRef(pMnode);
|
||||
}
|
||||
}
|
||||
|
@ -212,15 +213,16 @@ static void sdbNotifyRole(void *ahandle, int8_t role) {
|
|||
|
||||
static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
||||
tsSdbObj.code = code;
|
||||
sdbTrace("sdb forward request confirmed, result:%s", tstrerror(code));
|
||||
sem_post(&tsSdbObj.sem);
|
||||
sdbTrace("forward request confirmed, version:%" PRIu64 ", result:%s", (int64_t)param, tstrerror(code));
|
||||
}
|
||||
|
||||
static int32_t sdbForwardToPeer(void *pHead) {
|
||||
static int32_t sdbForwardToPeer(SWalHead *pHead) {
|
||||
if (tsSdbObj.sync == NULL) return TSDB_CODE_SUCCESS;
|
||||
|
||||
int32_t code = syncForwardToPeer(tsSdbObj.sync, pHead, NULL);
|
||||
int32_t code = syncForwardToPeer(tsSdbObj.sync, pHead, (void*)pHead->version);
|
||||
if (code > 0) {
|
||||
sdbTrace("forward request is sent, version:%" PRIu64 ", code:%d", pHead->version, code);
|
||||
sem_wait(&tsSdbObj.sem);
|
||||
return tsSdbObj.code;
|
||||
}
|
||||
|
@ -293,6 +295,7 @@ void sdbUpdateSync() {
|
|||
} else {
|
||||
tsSdbObj.sync = syncStart(&syncInfo);
|
||||
}
|
||||
sdbUpdateMnodeRoles();
|
||||
}
|
||||
|
||||
int32_t sdbInit() {
|
||||
|
@ -332,7 +335,7 @@ void sdbIncRef(void *handle, void *pRow) {
|
|||
SSdbTable *pTable = handle;
|
||||
int32_t * pRefCount = (int32_t *)(pRow + pTable->refCountPos);
|
||||
atomic_add_fetch_32(pRefCount, 1);
|
||||
if (0 && pTable->tableId == SDB_TABLE_CTABLE) {
|
||||
if (0 && (pTable->tableId == SDB_TABLE_MNODE || pTable->tableId == SDB_TABLE_DNODE)) {
|
||||
sdbTrace("table:%s, add ref to record:%s:%s:%d", pTable->tableName, pTable->tableName, sdbGetkeyStr(pTable, pRow),
|
||||
*pRefCount);
|
||||
}
|
||||
|
@ -344,7 +347,7 @@ void sdbDecRef(void *handle, void *pRow) {
|
|||
SSdbTable *pTable = handle;
|
||||
int32_t * pRefCount = (int32_t *)(pRow + pTable->refCountPos);
|
||||
int32_t refCount = atomic_sub_fetch_32(pRefCount, 1);
|
||||
if (0 && pTable->tableId == SDB_TABLE_CTABLE) {
|
||||
if (0 && (pTable->tableId == SDB_TABLE_MNODE || pTable->tableId == SDB_TABLE_DNODE)) {
|
||||
sdbTrace("table:%s, def ref of record:%s:%s:%d", pTable->tableName, pTable->tableName, sdbGetkeyStr(pTable, pRow),
|
||||
*pRefCount);
|
||||
}
|
||||
|
@ -474,14 +477,18 @@ static int sdbWrite(void *param, void *data, int type) {
|
|||
}
|
||||
walFsync(tsSdbObj.wal);
|
||||
|
||||
sdbForwardToPeer(pHead);
|
||||
code = sdbForwardToPeer(pHead);
|
||||
pthread_mutex_unlock(&tsSdbObj.mutex);
|
||||
|
||||
// from app, oper is created
|
||||
if (param != NULL) return code;
|
||||
if (param != NULL) {
|
||||
//sdbTrace("request from app is disposed, version:%" PRIu64 " code:%s", pHead->version, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
// from wal or forward msg, should create oper
|
||||
// from wal or forward msg, oper not created, should add into hash
|
||||
if (tsSdbObj.sync != NULL) {
|
||||
sdbTrace("forward request is received, version:%" PRIu64 " result:%s, confirm it", pHead->version, tstrerror(code));
|
||||
syncConfirmForward(tsSdbObj.sync, pHead->version, code);
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,9 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) {
|
|||
}
|
||||
|
||||
static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
|
||||
if (rpcMsg == NULL || rpcMsg->pCont == NULL) {
|
||||
assert(rpcMsg);
|
||||
|
||||
if (rpcMsg->pCont == NULL) {
|
||||
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
|
||||
return;
|
||||
}
|
||||
|
@ -375,7 +377,7 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr
|
|||
|
||||
if (!sdbIsMaster()) {
|
||||
*secret = 0;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
return TSDB_CODE_NOT_READY;
|
||||
}
|
||||
|
||||
SUserObj *pUser = mgmtGetUser(user);
|
||||
|
|
|
@ -47,6 +47,7 @@ static int32_t tsChildTableUpdateSize;
|
|||
static int32_t tsSuperTableUpdateSize;
|
||||
static void * mgmtGetChildTable(char *tableId);
|
||||
static void * mgmtGetSuperTable(char *tableId);
|
||||
static void * mgmtGetSuperTableByUid(uint64_t uid);
|
||||
static void mgmtDropAllChildTablesInStable(SSuperTableObj *pStable);
|
||||
static void mgmtAddTableIntoStable(SSuperTableObj *pStable, SChildTableObj *pCtable);
|
||||
static void mgmtRemoveTableFromStable(SSuperTableObj *pStable, SChildTableObj *pCtable);
|
||||
|
@ -118,7 +119,7 @@ static int32_t mgmtChildTableActionInsert(SSdbOper *pOper) {
|
|||
|
||||
if (pTable->info.type == TSDB_CHILD_TABLE) {
|
||||
// add ref
|
||||
pTable->superTable = mgmtGetSuperTable(pTable->superTableId);
|
||||
pTable->superTable = mgmtGetSuperTableByUid(pTable->suid);
|
||||
mgmtAddTableIntoStable(pTable->superTable, pTable);
|
||||
grantAdd(TSDB_GRANT_TIMESERIES, pTable->superTable->numOfColumns - 1);
|
||||
pAcct->acctInfo.numOfTimeSeries += (pTable->superTable->numOfColumns - 1);
|
||||
|
@ -308,9 +309,9 @@ static int32_t mgmtChildTableActionRestored() {
|
|||
}
|
||||
|
||||
if (pTable->info.type == TSDB_CHILD_TABLE) {
|
||||
SSuperTableObj *pSuperTable = mgmtGetSuperTable(pTable->superTableId);
|
||||
SSuperTableObj *pSuperTable = mgmtGetSuperTableByUid(pTable->suid);
|
||||
if (pSuperTable == NULL) {
|
||||
mError("ctable:%s, stable:%s not exist", pTable->info.tableId, pTable->superTableId);
|
||||
mError("ctable:%s, stable:%" PRIu64 " not exist", pTable->info.tableId, pTable->suid);
|
||||
pTable->vgId = 0;
|
||||
SSdbOper desc = {0};
|
||||
desc.type = SDB_OPER_LOCAL;
|
||||
|
@ -560,6 +561,22 @@ static void *mgmtGetSuperTable(char *tableId) {
|
|||
return sdbGetRow(tsSuperTableSdb, tableId);
|
||||
}
|
||||
|
||||
static void *mgmtGetSuperTableByUid(uint64_t uid) {
|
||||
SSuperTableObj *pStable = NULL;
|
||||
void * pNode = NULL;
|
||||
|
||||
while (1) {
|
||||
pNode = mgmtGetNextSuperTable(pNode, &pStable);
|
||||
if (pStable == NULL) break;
|
||||
if (pStable->uid == uid) {
|
||||
return pStable;
|
||||
}
|
||||
mgmtDecTableRef(pStable);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *mgmtGetTable(char *tableId) {
|
||||
void *pTable = mgmtGetSuperTable(tableId);
|
||||
if (pTable != NULL) {
|
||||
|
@ -1358,8 +1375,8 @@ static SChildTableObj* mgmtDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgObj
|
|||
}
|
||||
mgmtDecTableRef(pSuperTable);
|
||||
|
||||
strcpy(pTable->superTableId, pSuperTable->info.tableId);
|
||||
pTable->uid = (((uint64_t) pTable->vgId) << 40) + ((((uint64_t) pTable->sid) & ((1ul << 24) - 1ul)) << 16) +
|
||||
pTable->suid = pSuperTable->uid;
|
||||
pTable->uid = (((uint64_t)pTable->vgId) << 40) + ((((uint64_t)pTable->sid) & ((1ul << 24) - 1ul)) << 16) +
|
||||
(sdbGetVersion() & ((1ul << 16) - 1ul));
|
||||
pTable->superTable = pSuperTable;
|
||||
} else {
|
||||
|
@ -2073,7 +2090,7 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows,
|
|||
|
||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||
if (pTable->info.type == TSDB_CHILD_TABLE) {
|
||||
mgmtExtractTableName(pTable->superTableId, pWrite);
|
||||
mgmtExtractTableName(pTable->superTable->info.tableId, pWrite);
|
||||
}
|
||||
cols++;
|
||||
|
||||
|
|
|
@ -158,7 +158,11 @@ static int32_t mgmtVgroupActionUpdate(SSdbOper *pOper) {
|
|||
}
|
||||
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
mTrace("vgId:%d, is updated, tables:%d numOfVnode:%d", pVgroup->vgId, pDb->cfg.maxTables, pVgroup->numOfVnodes);
|
||||
|
||||
mTrace("vgId:%d, is updated, numOfVnode:%d", pVgroup->vgId, pVgroup->numOfVnodes);
|
||||
if (pDb) {
|
||||
mTrace("tables:%d", pDb->cfg.maxTables);
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -545,7 +549,7 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) {
|
|||
pCfg->cfgVersion = htonl(pDb->cfgVersion);
|
||||
pCfg->cacheBlockSize = htonl(pDb->cfg.cacheBlockSize);
|
||||
pCfg->totalBlocks = htonl(pDb->cfg.totalBlocks);
|
||||
pCfg->maxTables = htonl(pDb->cfg.maxTables);
|
||||
pCfg->maxTables = htonl(pDb->cfg.maxTables + 1);
|
||||
pCfg->daysPerFile = htonl(pDb->cfg.daysPerFile);
|
||||
pCfg->daysToKeep = htonl(pDb->cfg.daysToKeep);
|
||||
pCfg->daysToKeep1 = htonl(pDb->cfg.daysToKeep1);
|
||||
|
@ -769,7 +773,7 @@ void mgmtDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
|
|||
}
|
||||
}
|
||||
|
||||
void mgmtDropAllDbVgroups(SDbObj *pDropDb) {
|
||||
void mgmtDropAllDbVgroups(SDbObj *pDropDb, bool sendMsg) {
|
||||
void *pNode = NULL;
|
||||
void *pLastNode = NULL;
|
||||
int32_t numOfVgroups = 0;
|
||||
|
@ -790,8 +794,11 @@ void mgmtDropAllDbVgroups(SDbObj *pDropDb) {
|
|||
sdbDeleteRow(&oper);
|
||||
pNode = pLastNode;
|
||||
numOfVgroups++;
|
||||
|
||||
if (sendMsg) {
|
||||
mgmtSendDropVgroupMsg(pVgroup, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
mgmtDecVgroupRef(pVgroup);
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ SSubclauseInfo *setSubclause(SSubclauseInfo *pClause, void *pSqlExprInfo);
|
|||
|
||||
SSubclauseInfo *appendSelectClause(SSubclauseInfo *pInfo, void *pSubclause);
|
||||
|
||||
void setCreatedMeterName(SSqlInfo *pInfo, SSQLToken *pMeterName, SSQLToken *pIfNotExists);
|
||||
void setCreatedTableName(SSqlInfo *pInfo, SSQLToken *pMeterName, SSQLToken *pIfNotExists);
|
||||
|
||||
void SQLInfoDestroy(SSqlInfo *pInfo);
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ signed(A) ::= MINUS INTEGER(X). { A = -strtol(X.z, NULL, 10);}
|
|||
////////////////////////////////// The CREATE TABLE statement ///////////////////////////////
|
||||
cmd ::= CREATE TABLE ifnotexists(Y) ids(X) cpxName(Z) create_table_args. {
|
||||
X.n += Z.n;
|
||||
setCreatedMeterName(pInfo, &X, &Y);
|
||||
setCreatedTableName(pInfo, &X, &Y);
|
||||
}
|
||||
|
||||
%type create_table_args{SCreateTableSQL*}
|
||||
|
|
|
@ -675,7 +675,7 @@ void SQLInfoDestroy(SSqlInfo *pInfo) {
|
|||
free(pInfo->pDCLInfo->a);
|
||||
}
|
||||
|
||||
if (pInfo->type == TSDB_SQL_CREATE_DB) {
|
||||
if (pInfo->pDCLInfo != NULL && pInfo->type == TSDB_SQL_CREATE_DB) {
|
||||
tVariantListDestroy(pInfo->pDCLInfo->dbOpt.keep);
|
||||
}
|
||||
|
||||
|
@ -731,7 +731,7 @@ SSubclauseInfo* appendSelectClause(SSubclauseInfo *pQueryInfo, void *pSubclause)
|
|||
return pQueryInfo;
|
||||
}
|
||||
|
||||
void setCreatedMeterName(SSqlInfo *pInfo, SSQLToken *pMeterName, SSQLToken *pIfNotExists) {
|
||||
void setCreatedTableName(SSqlInfo *pInfo, SSQLToken *pMeterName, SSQLToken *pIfNotExists) {
|
||||
pInfo->pCreateTableInfo->name = *pMeterName;
|
||||
pInfo->pCreateTableInfo->existCheck = (pIfNotExists->n != 0);
|
||||
}
|
||||
|
|
|
@ -636,9 +636,13 @@ void tsBufResetPos(STSBuf* pTSBuf) {
|
|||
|
||||
STSElem tsBufGetElem(STSBuf* pTSBuf) {
|
||||
STSElem elem1 = {.vnode = -1};
|
||||
STSCursor* pCur = &pTSBuf->cur;
|
||||
|
||||
if (pTSBuf == NULL || pCur->vnodeIndex < 0) {
|
||||
if (pTSBuf == NULL) {
|
||||
return elem1;
|
||||
}
|
||||
|
||||
STSCursor* pCur = &pTSBuf->cur;
|
||||
if (pCur != NULL && pCur->vnodeIndex < 0) {
|
||||
return elem1;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,10 @@ void destroyTimeWindowRes(SWindowResult *pWindowRes, int32_t nOutputCols) {
|
|||
}
|
||||
|
||||
void cleanupTimeWindowInfo(SWindowResInfo *pWindowResInfo, int32_t numOfCols) {
|
||||
if (pWindowResInfo == NULL || pWindowResInfo->capacity == 0) {
|
||||
if (pWindowResInfo == NULL) {
|
||||
return;
|
||||
}
|
||||
if (pWindowResInfo->capacity == 0) {
|
||||
assert(pWindowResInfo->hashList == NULL && pWindowResInfo->pResult == NULL);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -202,62 +202,61 @@ typedef union {
|
|||
** yy_default[] Default action for each state.
|
||||
**
|
||||
*********** Begin parsing tables **********************************************/
|
||||
#define YY_ACTTAB_COUNT (531)
|
||||
#define YY_ACTTAB_COUNT (529)
|
||||
static const YYACTIONTYPE yy_action[] = {
|
||||
/* 0 */ 752, 440, 133, 151, 244, 10, 616, 246, 133, 441,
|
||||
/* 10 */ 133, 156, 821, 41, 43, 20, 35, 36, 820, 155,
|
||||
/* 20 */ 821, 29, 741, 440, 201, 39, 37, 40, 38, 132,
|
||||
/* 30 */ 499, 441, 97, 34, 33, 101, 152, 32, 31, 30,
|
||||
/* 40 */ 41, 43, 741, 35, 36, 153, 137, 164, 29, 727,
|
||||
/* 50 */ 749, 201, 39, 37, 40, 38, 186, 101, 225, 224,
|
||||
/* 60 */ 34, 33, 163, 730, 32, 31, 30, 400, 401, 402,
|
||||
/* 0 */ 752, 440, 135, 153, 244, 10, 616, 246, 135, 441,
|
||||
/* 10 */ 135, 158, 821, 41, 43, 20, 35, 36, 820, 157,
|
||||
/* 20 */ 821, 29, 741, 440, 203, 39, 37, 40, 38, 134,
|
||||
/* 30 */ 499, 441, 99, 34, 33, 103, 154, 32, 31, 30,
|
||||
/* 40 */ 41, 43, 741, 35, 36, 155, 139, 166, 29, 727,
|
||||
/* 50 */ 749, 203, 39, 37, 40, 38, 188, 103, 227, 226,
|
||||
/* 60 */ 34, 33, 165, 730, 32, 31, 30, 400, 401, 402,
|
||||
/* 70 */ 403, 404, 405, 406, 407, 408, 409, 410, 411, 245,
|
||||
/* 80 */ 730, 41, 43, 189, 35, 36, 216, 236, 198, 29,
|
||||
/* 90 */ 58, 20, 201, 39, 37, 40, 38, 32, 31, 30,
|
||||
/* 100 */ 56, 34, 33, 76, 730, 32, 31, 30, 43, 236,
|
||||
/* 110 */ 35, 36, 776, 817, 196, 29, 20, 20, 201, 39,
|
||||
/* 120 */ 37, 40, 38, 165, 570, 727, 227, 34, 33, 440,
|
||||
/* 130 */ 168, 32, 31, 30, 238, 35, 36, 441, 7, 816,
|
||||
/* 140 */ 29, 61, 111, 201, 39, 37, 40, 38, 223, 228,
|
||||
/* 80 */ 730, 41, 43, 191, 35, 36, 218, 238, 200, 29,
|
||||
/* 90 */ 58, 20, 203, 39, 37, 40, 38, 32, 31, 30,
|
||||
/* 100 */ 56, 34, 33, 76, 730, 32, 31, 30, 43, 238,
|
||||
/* 110 */ 35, 36, 776, 817, 198, 29, 20, 20, 203, 39,
|
||||
/* 120 */ 37, 40, 38, 167, 570, 727, 229, 34, 33, 440,
|
||||
/* 130 */ 170, 32, 31, 30, 240, 35, 36, 441, 7, 816,
|
||||
/* 140 */ 29, 61, 113, 203, 39, 37, 40, 38, 225, 230,
|
||||
/* 150 */ 727, 727, 34, 33, 50, 728, 32, 31, 30, 15,
|
||||
/* 160 */ 215, 237, 214, 213, 212, 211, 210, 209, 208, 207,
|
||||
/* 160 */ 217, 239, 216, 215, 214, 213, 212, 211, 210, 209,
|
||||
/* 170 */ 712, 51, 701, 702, 703, 704, 705, 706, 707, 708,
|
||||
/* 180 */ 709, 710, 711, 160, 583, 11, 815, 574, 101, 577,
|
||||
/* 190 */ 101, 580, 169, 160, 583, 222, 221, 574, 16, 577,
|
||||
/* 200 */ 20, 580, 34, 33, 146, 26, 32, 31, 30, 238,
|
||||
/* 210 */ 87, 86, 140, 175, 657, 157, 158, 124, 145, 200,
|
||||
/* 220 */ 183, 715, 180, 714, 149, 157, 158, 160, 583, 531,
|
||||
/* 230 */ 60, 574, 150, 577, 726, 580, 237, 16, 39, 37,
|
||||
/* 180 */ 709, 710, 711, 162, 583, 11, 815, 574, 103, 577,
|
||||
/* 190 */ 103, 580, 171, 162, 583, 224, 223, 574, 16, 577,
|
||||
/* 200 */ 20, 580, 34, 33, 148, 26, 32, 31, 30, 240,
|
||||
/* 210 */ 88, 87, 142, 177, 657, 159, 160, 126, 147, 202,
|
||||
/* 220 */ 185, 715, 182, 714, 151, 159, 160, 162, 583, 531,
|
||||
/* 230 */ 60, 574, 152, 577, 726, 580, 239, 16, 39, 37,
|
||||
/* 240 */ 40, 38, 27, 775, 26, 59, 34, 33, 551, 552,
|
||||
/* 250 */ 32, 31, 30, 138, 114, 115, 68, 64, 67, 157,
|
||||
/* 260 */ 158, 96, 515, 666, 185, 512, 124, 513, 26, 514,
|
||||
/* 270 */ 523, 148, 128, 126, 240, 89, 88, 188, 42, 159,
|
||||
/* 280 */ 74, 78, 239, 85, 77, 572, 528, 729, 42, 582,
|
||||
/* 290 */ 80, 17, 658, 166, 167, 124, 243, 242, 93, 582,
|
||||
/* 250 */ 32, 31, 30, 140, 116, 117, 68, 64, 67, 159,
|
||||
/* 260 */ 160, 98, 515, 666, 187, 512, 126, 513, 26, 514,
|
||||
/* 270 */ 523, 150, 130, 128, 91, 90, 89, 190, 42, 161,
|
||||
/* 280 */ 74, 78, 83, 86, 77, 572, 528, 729, 42, 582,
|
||||
/* 290 */ 80, 17, 658, 168, 169, 126, 243, 242, 95, 582,
|
||||
/* 300 */ 47, 542, 543, 600, 581, 45, 13, 12, 584, 576,
|
||||
/* 310 */ 139, 579, 12, 575, 581, 578, 2, 73, 72, 48,
|
||||
/* 320 */ 505, 573, 42, 743, 45, 504, 205, 9, 8, 21,
|
||||
/* 330 */ 21, 141, 519, 582, 520, 517, 142, 518, 84, 83,
|
||||
/* 340 */ 143, 144, 135, 131, 136, 830, 134, 786, 581, 785,
|
||||
/* 350 */ 161, 782, 781, 162, 751, 721, 768, 226, 98, 767,
|
||||
/* 360 */ 112, 113, 516, 668, 206, 110, 129, 24, 219, 665,
|
||||
/* 370 */ 220, 829, 26, 70, 828, 826, 187, 116, 686, 25,
|
||||
/* 380 */ 91, 22, 130, 655, 79, 653, 81, 651, 650, 538,
|
||||
/* 390 */ 170, 125, 190, 648, 647, 646, 644, 194, 52, 740,
|
||||
/* 400 */ 636, 127, 642, 640, 638, 49, 755, 102, 756, 44,
|
||||
/* 410 */ 769, 199, 197, 195, 193, 191, 28, 218, 75, 229,
|
||||
/* 420 */ 230, 231, 232, 233, 234, 235, 203, 53, 241, 614,
|
||||
/* 430 */ 171, 172, 147, 62, 65, 174, 613, 177, 173, 179,
|
||||
/* 440 */ 612, 176, 649, 178, 181, 643, 123, 687, 117, 119,
|
||||
/* 450 */ 118, 120, 121, 90, 103, 725, 108, 104, 105, 122,
|
||||
/* 460 */ 106, 107, 109, 92, 1, 23, 182, 188, 605, 184,
|
||||
/* 470 */ 525, 55, 539, 57, 99, 154, 192, 18, 63, 4,
|
||||
/* 480 */ 544, 100, 480, 585, 3, 19, 5, 14, 202, 6,
|
||||
/* 490 */ 204, 479, 478, 477, 476, 475, 474, 473, 471, 45,
|
||||
/* 500 */ 217, 444, 66, 21, 501, 500, 46, 498, 54, 465,
|
||||
/* 510 */ 463, 455, 461, 457, 69, 459, 71, 453, 451, 472,
|
||||
/* 520 */ 470, 82, 426, 442, 94, 415, 413, 618, 617, 617,
|
||||
/* 530 */ 95,
|
||||
/* 310 */ 141, 579, 12, 575, 581, 578, 2, 73, 72, 48,
|
||||
/* 320 */ 505, 573, 42, 743, 45, 504, 207, 9, 8, 21,
|
||||
/* 330 */ 21, 143, 519, 582, 520, 517, 144, 518, 85, 84,
|
||||
/* 340 */ 145, 146, 137, 133, 138, 830, 136, 786, 581, 785,
|
||||
/* 350 */ 163, 782, 781, 164, 751, 721, 768, 228, 100, 767,
|
||||
/* 360 */ 114, 115, 516, 668, 208, 112, 131, 24, 221, 665,
|
||||
/* 370 */ 222, 829, 26, 70, 828, 826, 189, 118, 686, 25,
|
||||
/* 380 */ 93, 22, 132, 655, 79, 653, 81, 82, 651, 538,
|
||||
/* 390 */ 650, 172, 192, 127, 648, 647, 646, 196, 52, 740,
|
||||
/* 400 */ 645, 644, 636, 129, 642, 640, 49, 638, 44, 105,
|
||||
/* 410 */ 755, 756, 201, 199, 195, 769, 197, 193, 28, 220,
|
||||
/* 420 */ 75, 231, 232, 233, 234, 235, 236, 205, 237, 241,
|
||||
/* 430 */ 53, 614, 173, 174, 175, 149, 62, 65, 176, 613,
|
||||
/* 440 */ 179, 181, 649, 178, 180, 612, 92, 94, 183, 121,
|
||||
/* 450 */ 184, 120, 687, 119, 122, 725, 123, 125, 124, 109,
|
||||
/* 460 */ 106, 104, 643, 107, 110, 108, 111, 23, 1, 190,
|
||||
/* 470 */ 605, 186, 525, 55, 539, 57, 156, 101, 194, 18,
|
||||
/* 480 */ 19, 4, 544, 102, 204, 585, 3, 14, 5, 6,
|
||||
/* 490 */ 63, 480, 206, 479, 478, 477, 476, 475, 474, 473,
|
||||
/* 500 */ 471, 45, 219, 444, 66, 21, 501, 500, 46, 498,
|
||||
/* 510 */ 54, 465, 463, 455, 461, 457, 69, 459, 453, 451,
|
||||
/* 520 */ 472, 470, 71, 442, 96, 97, 415, 413, 618,
|
||||
};
|
||||
static const YYCODETYPE yy_lookahead[] = {
|
||||
/* 0 */ 207, 1, 256, 206, 207, 256, 204, 205, 256, 9,
|
||||
|
@ -300,20 +299,20 @@ static const YYCODETYPE yy_lookahead[] = {
|
|||
/* 370 */ 207, 207, 103, 207, 207, 207, 240, 207, 207, 207,
|
||||
/* 380 */ 59, 207, 207, 207, 207, 207, 207, 207, 207, 107,
|
||||
/* 390 */ 207, 207, 259, 207, 207, 207, 207, 259, 117, 253,
|
||||
/* 400 */ 207, 207, 207, 207, 207, 119, 208, 252, 208, 116,
|
||||
/* 410 */ 208, 111, 115, 110, 109, 108, 121, 75, 84, 83,
|
||||
/* 420 */ 49, 80, 82, 53, 81, 79, 208, 208, 75, 5,
|
||||
/* 430 */ 132, 5, 208, 212, 212, 58, 5, 5, 132, 58,
|
||||
/* 440 */ 5, 132, 208, 132, 132, 208, 215, 222, 221, 216,
|
||||
/* 450 */ 220, 219, 217, 209, 251, 240, 246, 250, 249, 218,
|
||||
/* 460 */ 248, 247, 245, 209, 213, 210, 58, 104, 86, 124,
|
||||
/* 470 */ 97, 105, 97, 101, 96, 1, 96, 101, 72, 112,
|
||||
/* 480 */ 97, 96, 9, 97, 96, 101, 112, 96, 98, 96,
|
||||
/* 490 */ 98, 5, 5, 5, 5, 1, 5, 5, 5, 101,
|
||||
/* 500 */ 15, 76, 72, 101, 5, 5, 16, 97, 96, 5,
|
||||
/* 510 */ 5, 5, 5, 5, 127, 5, 127, 5, 5, 5,
|
||||
/* 520 */ 5, 58, 58, 76, 21, 59, 58, 0, 267, 267,
|
||||
/* 530 */ 21, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 400 */ 207, 207, 207, 207, 207, 207, 119, 207, 116, 251,
|
||||
/* 410 */ 208, 208, 111, 115, 109, 208, 110, 108, 121, 75,
|
||||
/* 420 */ 84, 83, 49, 80, 82, 53, 81, 208, 79, 75,
|
||||
/* 430 */ 208, 5, 132, 5, 132, 208, 212, 212, 58, 5,
|
||||
/* 440 */ 5, 58, 208, 132, 132, 5, 209, 209, 132, 216,
|
||||
/* 450 */ 58, 220, 222, 221, 219, 240, 217, 215, 218, 247,
|
||||
/* 460 */ 250, 252, 208, 249, 246, 248, 245, 210, 213, 104,
|
||||
/* 470 */ 86, 124, 97, 105, 97, 101, 1, 96, 96, 101,
|
||||
/* 480 */ 101, 112, 97, 96, 98, 97, 96, 96, 112, 96,
|
||||
/* 490 */ 72, 9, 98, 5, 5, 5, 5, 1, 5, 5,
|
||||
/* 500 */ 5, 101, 15, 76, 72, 101, 5, 5, 16, 97,
|
||||
/* 510 */ 96, 5, 5, 5, 5, 5, 127, 5, 5, 5,
|
||||
/* 520 */ 5, 5, 127, 76, 21, 21, 59, 58, 0, 267,
|
||||
/* 530 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 540 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 550 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 560 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
|
@ -333,41 +332,41 @@ static const YYCODETYPE yy_lookahead[] = {
|
|||
/* 700 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 710 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 720 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
|
||||
/* 730 */ 267, 267, 267, 267,
|
||||
/* 730 */ 267, 267,
|
||||
};
|
||||
#define YY_SHIFT_COUNT (246)
|
||||
#define YY_SHIFT_MIN (0)
|
||||
#define YY_SHIFT_MAX (527)
|
||||
#define YY_SHIFT_MAX (528)
|
||||
static const unsigned short int yy_shift_ofst[] = {
|
||||
/* 0 */ 141, 74, 182, 226, 128, 128, 128, 128, 128, 128,
|
||||
/* 10 */ 0, 22, 226, 260, 260, 260, 102, 128, 128, 128,
|
||||
/* 20 */ 128, 128, 31, 149, 9, 9, 531, 192, 226, 226,
|
||||
/* 20 */ 128, 128, 31, 149, 9, 9, 529, 192, 226, 226,
|
||||
/* 30 */ 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
|
||||
/* 40 */ 226, 226, 226, 226, 226, 260, 260, 25, 25, 25,
|
||||
/* 50 */ 25, 25, 25, 42, 25, 165, 128, 128, 135, 135,
|
||||
/* 60 */ 185, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
||||
/* 70 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
||||
/* 80 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
||||
/* 90 */ 128, 128, 128, 128, 128, 128, 269, 321, 321, 282,
|
||||
/* 100 */ 282, 321, 281, 286, 293, 300, 297, 303, 305, 307,
|
||||
/* 110 */ 295, 269, 321, 321, 342, 342, 321, 334, 336, 371,
|
||||
/* 120 */ 341, 340, 370, 343, 346, 321, 353, 321, 353, 531,
|
||||
/* 130 */ 531, 27, 68, 68, 68, 94, 119, 213, 213, 213,
|
||||
/* 140 */ 216, 169, 169, 169, 169, 190, 208, 67, 89, 60,
|
||||
/* 150 */ 60, 236, 173, 204, 205, 206, 211, 304, 308, 284,
|
||||
/* 160 */ 220, 199, 53, 223, 228, 229, 327, 330, 191, 201,
|
||||
/* 170 */ 266, 424, 298, 426, 306, 377, 431, 309, 432, 311,
|
||||
/* 180 */ 381, 435, 312, 408, 382, 345, 363, 373, 366, 372,
|
||||
/* 190 */ 375, 378, 474, 380, 383, 385, 376, 367, 384, 374,
|
||||
/* 200 */ 386, 388, 391, 390, 393, 392, 406, 473, 486, 487,
|
||||
/* 210 */ 488, 489, 494, 491, 492, 493, 398, 425, 485, 430,
|
||||
/* 220 */ 490, 387, 389, 402, 499, 500, 410, 412, 402, 504,
|
||||
/* 230 */ 505, 506, 507, 508, 510, 512, 513, 514, 515, 463,
|
||||
/* 240 */ 464, 447, 503, 509, 466, 468, 527,
|
||||
/* 90 */ 128, 128, 128, 128, 128, 128, 128, 128, 269, 321,
|
||||
/* 100 */ 321, 282, 282, 321, 281, 287, 292, 301, 298, 306,
|
||||
/* 110 */ 305, 309, 297, 269, 321, 321, 344, 344, 321, 336,
|
||||
/* 120 */ 338, 373, 343, 342, 372, 345, 349, 321, 354, 321,
|
||||
/* 130 */ 354, 529, 529, 27, 68, 68, 68, 94, 119, 213,
|
||||
/* 140 */ 213, 213, 216, 169, 169, 169, 169, 190, 208, 67,
|
||||
/* 150 */ 89, 60, 60, 236, 173, 204, 205, 206, 211, 304,
|
||||
/* 160 */ 308, 284, 220, 199, 53, 223, 228, 229, 327, 330,
|
||||
/* 170 */ 191, 201, 266, 426, 300, 428, 302, 380, 434, 311,
|
||||
/* 180 */ 435, 312, 383, 440, 316, 392, 384, 347, 365, 375,
|
||||
/* 190 */ 368, 374, 377, 381, 475, 382, 385, 387, 378, 369,
|
||||
/* 200 */ 379, 376, 388, 390, 391, 386, 393, 394, 418, 482,
|
||||
/* 210 */ 488, 489, 490, 491, 496, 493, 494, 495, 400, 427,
|
||||
/* 220 */ 487, 432, 492, 389, 395, 404, 501, 502, 412, 414,
|
||||
/* 230 */ 404, 506, 507, 508, 509, 510, 512, 513, 514, 515,
|
||||
/* 240 */ 516, 447, 503, 504, 467, 469, 528,
|
||||
};
|
||||
#define YY_REDUCE_COUNT (130)
|
||||
#define YY_REDUCE_COUNT (132)
|
||||
#define YY_REDUCE_MIN (-254)
|
||||
#define YY_REDUCE_MAX (255)
|
||||
#define YY_REDUCE_MAX (257)
|
||||
static const short yy_reduce_ofst[] = {
|
||||
/* 0 */ -198, -53, -254, -246, -150, -172, -192, -116, -91, -90,
|
||||
/* 10 */ -207, -203, -248, -179, -162, -138, -218, -175, -19, -17,
|
||||
|
@ -378,11 +377,11 @@ static const short yy_reduce_ofst[] = {
|
|||
/* 60 */ 121, 153, 154, 156, 157, 159, 160, 161, 162, 163,
|
||||
/* 70 */ 164, 166, 167, 168, 170, 171, 172, 174, 175, 176,
|
||||
/* 80 */ 177, 178, 179, 180, 181, 183, 184, 186, 187, 188,
|
||||
/* 90 */ 189, 193, 194, 195, 196, 197, 136, 198, 200, 133,
|
||||
/* 100 */ 138, 202, 146, 155, 203, 207, 209, 212, 214, 210,
|
||||
/* 110 */ 217, 215, 218, 219, 221, 222, 224, 225, 227, 230,
|
||||
/* 120 */ 233, 232, 235, 241, 231, 234, 244, 237, 254, 251,
|
||||
/* 130 */ 255,
|
||||
/* 90 */ 189, 193, 194, 195, 196, 197, 198, 200, 136, 202,
|
||||
/* 100 */ 203, 133, 138, 207, 146, 209, 158, 210, 214, 217,
|
||||
/* 110 */ 212, 218, 221, 215, 219, 222, 224, 225, 227, 230,
|
||||
/* 120 */ 232, 231, 233, 235, 239, 240, 242, 234, 237, 254,
|
||||
/* 130 */ 238, 255, 257,
|
||||
};
|
||||
static const YYACTIONTYPE yy_default[] = {
|
||||
/* 0 */ 615, 667, 823, 823, 615, 615, 615, 615, 615, 615,
|
||||
|
@ -394,21 +393,21 @@ static const YYACTIONTYPE yy_default[] = {
|
|||
/* 60 */ 746, 615, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 70 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 654,
|
||||
/* 80 */ 615, 652, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 90 */ 615, 615, 615, 641, 615, 615, 615, 635, 635, 615,
|
||||
/* 100 */ 615, 635, 779, 783, 777, 765, 773, 764, 760, 759,
|
||||
/* 110 */ 787, 615, 635, 635, 664, 664, 635, 685, 683, 681,
|
||||
/* 120 */ 673, 679, 675, 677, 671, 635, 662, 635, 662, 700,
|
||||
/* 130 */ 713, 615, 788, 822, 778, 806, 805, 818, 812, 811,
|
||||
/* 140 */ 615, 810, 809, 808, 807, 615, 615, 615, 615, 814,
|
||||
/* 150 */ 813, 615, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 160 */ 790, 784, 780, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 90 */ 615, 615, 615, 615, 615, 641, 615, 615, 615, 635,
|
||||
/* 100 */ 635, 615, 615, 635, 779, 783, 777, 765, 773, 764,
|
||||
/* 110 */ 760, 759, 787, 615, 635, 635, 664, 664, 635, 685,
|
||||
/* 120 */ 683, 681, 673, 679, 675, 677, 671, 635, 662, 635,
|
||||
/* 130 */ 662, 700, 713, 615, 788, 822, 778, 806, 805, 818,
|
||||
/* 140 */ 812, 811, 615, 810, 809, 808, 807, 615, 615, 615,
|
||||
/* 150 */ 615, 814, 813, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 160 */ 615, 615, 790, 784, 780, 615, 615, 615, 615, 615,
|
||||
/* 170 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 180 */ 615, 615, 615, 615, 615, 615, 745, 615, 615, 754,
|
||||
/* 190 */ 615, 615, 615, 615, 615, 615, 774, 615, 766, 615,
|
||||
/* 200 */ 615, 615, 615, 615, 615, 722, 615, 615, 615, 615,
|
||||
/* 210 */ 615, 615, 615, 615, 615, 615, 688, 615, 615, 615,
|
||||
/* 220 */ 615, 615, 615, 827, 615, 615, 615, 716, 825, 615,
|
||||
/* 230 */ 615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 180 */ 615, 615, 615, 615, 615, 615, 615, 615, 745, 615,
|
||||
/* 190 */ 615, 754, 615, 615, 615, 615, 615, 615, 774, 615,
|
||||
/* 200 */ 766, 615, 615, 615, 615, 615, 615, 722, 615, 615,
|
||||
/* 210 */ 615, 615, 615, 615, 615, 615, 615, 615, 688, 615,
|
||||
/* 220 */ 615, 615, 615, 615, 615, 827, 615, 615, 615, 716,
|
||||
/* 230 */ 825, 615, 615, 615, 615, 615, 615, 615, 615, 615,
|
||||
/* 240 */ 615, 615, 639, 637, 615, 631, 615,
|
||||
};
|
||||
/********** End of lemon-generated parsing tables *****************************/
|
||||
|
@ -1019,15 +1018,15 @@ static const char *const yyRuleName[] = {
|
|||
/* 24 */ "cmd ::= SHOW dbPrefix VGROUPS ids",
|
||||
/* 25 */ "cmd ::= DROP TABLE ifexists ids cpxName",
|
||||
/* 26 */ "cmd ::= DROP DATABASE ifexists ids",
|
||||
/* 27 */ "cmd ::= DROP DNODE IPTOKEN",
|
||||
/* 27 */ "cmd ::= DROP DNODE ids",
|
||||
/* 28 */ "cmd ::= DROP USER ids",
|
||||
/* 29 */ "cmd ::= DROP ACCOUNT ids",
|
||||
/* 30 */ "cmd ::= USE ids",
|
||||
/* 31 */ "cmd ::= DESCRIBE ids cpxName",
|
||||
/* 32 */ "cmd ::= ALTER USER ids PASS ids",
|
||||
/* 33 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
|
||||
/* 34 */ "cmd ::= ALTER DNODE IPTOKEN ids",
|
||||
/* 35 */ "cmd ::= ALTER DNODE IPTOKEN ids ids",
|
||||
/* 34 */ "cmd ::= ALTER DNODE ids ids",
|
||||
/* 35 */ "cmd ::= ALTER DNODE ids ids ids",
|
||||
/* 36 */ "cmd ::= ALTER LOCAL ids",
|
||||
/* 37 */ "cmd ::= ALTER LOCAL ids ids",
|
||||
/* 38 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
|
||||
|
@ -1692,15 +1691,15 @@ static const struct {
|
|||
{ 205, -4 }, /* (24) cmd ::= SHOW dbPrefix VGROUPS ids */
|
||||
{ 205, -5 }, /* (25) cmd ::= DROP TABLE ifexists ids cpxName */
|
||||
{ 205, -4 }, /* (26) cmd ::= DROP DATABASE ifexists ids */
|
||||
{ 205, -3 }, /* (27) cmd ::= DROP DNODE IPTOKEN */
|
||||
{ 205, -3 }, /* (27) cmd ::= DROP DNODE ids */
|
||||
{ 205, -3 }, /* (28) cmd ::= DROP USER ids */
|
||||
{ 205, -3 }, /* (29) cmd ::= DROP ACCOUNT ids */
|
||||
{ 205, -2 }, /* (30) cmd ::= USE ids */
|
||||
{ 205, -3 }, /* (31) cmd ::= DESCRIBE ids cpxName */
|
||||
{ 205, -5 }, /* (32) cmd ::= ALTER USER ids PASS ids */
|
||||
{ 205, -5 }, /* (33) cmd ::= ALTER USER ids PRIVILEGE ids */
|
||||
{ 205, -4 }, /* (34) cmd ::= ALTER DNODE IPTOKEN ids */
|
||||
{ 205, -5 }, /* (35) cmd ::= ALTER DNODE IPTOKEN ids ids */
|
||||
{ 205, -4 }, /* (34) cmd ::= ALTER DNODE ids ids */
|
||||
{ 205, -5 }, /* (35) cmd ::= ALTER DNODE ids ids ids */
|
||||
{ 205, -3 }, /* (36) cmd ::= ALTER LOCAL ids */
|
||||
{ 205, -4 }, /* (37) cmd ::= ALTER LOCAL ids ids */
|
||||
{ 205, -4 }, /* (38) cmd ::= ALTER DATABASE ids alter_db_optr */
|
||||
|
@ -2063,7 +2062,7 @@ static void yy_reduce(
|
|||
case 26: /* cmd ::= DROP DATABASE ifexists ids */
|
||||
{ setDropDBTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0); }
|
||||
break;
|
||||
case 27: /* cmd ::= DROP DNODE IPTOKEN */
|
||||
case 27: /* cmd ::= DROP DNODE ids */
|
||||
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); }
|
||||
break;
|
||||
case 28: /* cmd ::= DROP USER ids */
|
||||
|
@ -2087,10 +2086,10 @@ static void yy_reduce(
|
|||
case 33: /* cmd ::= ALTER USER ids PRIVILEGE ids */
|
||||
{ setAlterUserSQL(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
|
||||
break;
|
||||
case 34: /* cmd ::= ALTER DNODE IPTOKEN ids */
|
||||
case 34: /* cmd ::= ALTER DNODE ids ids */
|
||||
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
|
||||
break;
|
||||
case 35: /* cmd ::= ALTER DNODE IPTOKEN ids ids */
|
||||
case 35: /* cmd ::= ALTER DNODE ids ids ids */
|
||||
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
|
||||
break;
|
||||
case 36: /* cmd ::= ALTER LOCAL ids */
|
||||
|
@ -2267,7 +2266,7 @@ static void yy_reduce(
|
|||
case 103: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
|
||||
{
|
||||
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
|
||||
setCreatedMeterName(pInfo, &yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0);
|
||||
setCreatedTableName(pInfo, &yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0);
|
||||
}
|
||||
break;
|
||||
case 104: /* create_table_args ::= LP columnlist RP */
|
||||
|
|
|
@ -613,13 +613,15 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
|
|||
pConn->tranId = (uint16_t)(rand() & 0xFFFF);
|
||||
pConn->ownId = htonl(pConn->sid);
|
||||
pConn->linkUid = pHead->linkUid;
|
||||
if (pRpc->afp && (*pRpc->afp)(pConn->user, &pConn->spi, &pConn->encrypt, pConn->secret, pConn->ckey) < 0) {
|
||||
tWarn("%s %p, user not there", pRpc->label, pConn);
|
||||
if (pRpc->afp) {
|
||||
terrno = (*pRpc->afp)(pConn->user, &pConn->spi, &pConn->encrypt, pConn->secret, pConn->ckey);
|
||||
if (terrno != 0) {
|
||||
tWarn("%s %p, user not there or server not ready", pRpc->label, pConn);
|
||||
taosFreeId(pRpc->idPool, sid); // sid shall be released
|
||||
terrno = TSDB_CODE_INVALID_USER;
|
||||
pConn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pConn) {
|
||||
if (pRecv->connType == RPC_CONN_UDPS && pRpc->numOfThreads > 1) {
|
||||
|
@ -1334,7 +1336,8 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) {
|
|||
if ( !rpcIsReq(pHead->msgType) ) {
|
||||
// for response, if code is auth failure, it shall bypass the auth process
|
||||
code = htonl(pHead->code);
|
||||
if (code==TSDB_CODE_INVALID_TIME_STAMP || code==TSDB_CODE_AUTH_FAILURE || code==TSDB_CODE_INVALID_USER) {
|
||||
if (code==TSDB_CODE_INVALID_TIME_STAMP || code==TSDB_CODE_AUTH_FAILURE ||
|
||||
code==TSDB_CODE_INVALID_USER || code == TSDB_CODE_NOT_READY) {
|
||||
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -611,10 +611,6 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) {
|
|||
if (pCfg->maxTables < TSDB_MIN_TABLES || pCfg->maxTables > TSDB_MAX_TABLES) return -1;
|
||||
}
|
||||
|
||||
// Since tableId starts from 1, we increase maxTables by 1
|
||||
// TODO: take a fancier way to do this
|
||||
pCfg->maxTables++;
|
||||
|
||||
// Check daysPerFile
|
||||
if (pCfg->daysPerFile == -1) {
|
||||
pCfg->daysPerFile = TSDB_DEFAULT_DAYS_PER_FILE;
|
||||
|
|
|
@ -283,7 +283,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
|
|||
super->superUid = TSDB_INVALID_SUPER_TABLE_ID;
|
||||
super->schema = tdDupSchema(pCfg->schema);
|
||||
super->tagSchema = tdDupSchema(pCfg->tagSchema);
|
||||
super->tagVal = tdDataRowDup(pCfg->tagValues);
|
||||
super->tagVal = NULL;
|
||||
super->name = strdup(pCfg->sname);
|
||||
|
||||
// index the first tag column
|
||||
|
|
|
@ -570,24 +570,14 @@ static int tsdbCheckAndDecodeColumnData(SDataCol *pDataCol, char *content, int32
|
|||
pDataCol->len = (*(tDataTypeDesc[pDataCol->type].decompFunc))(
|
||||
content, len - sizeof(TSCKSUM), numOfPoints, pDataCol->pData, pDataCol->spaceSize, comp, buffer, bufferSize);
|
||||
if (pDataCol->type == TSDB_DATA_TYPE_BINARY || pDataCol->type == TSDB_DATA_TYPE_NCHAR) {
|
||||
pDataCol->len += (sizeof(int32_t) * maxPoints);
|
||||
dataColSetOffset(pDataCol, numOfPoints);
|
||||
}
|
||||
} else {
|
||||
// No need to decompress, just memcpy it
|
||||
switch (pDataCol->type) {
|
||||
case TSDB_DATA_TYPE_BINARY:
|
||||
case TSDB_DATA_TYPE_NCHAR:
|
||||
pDataCol->len = sizeof(int32_t) * maxPoints;
|
||||
memcpy((char *)pDataCol->pData + pDataCol->len, content, len - sizeof(TSCKSUM));
|
||||
pDataCol->len += (len - sizeof(TSCKSUM));
|
||||
dataColSetOffset(pDataCol, numOfPoints);
|
||||
break;
|
||||
|
||||
default:
|
||||
pDataCol->len = len - sizeof(TSCKSUM);
|
||||
memcpy(pDataCol->pData, content, pDataCol->len);
|
||||
break;
|
||||
if (pDataCol->type == TSDB_DATA_TYPE_BINARY || pDataCol->type == TSDB_DATA_TYPE_NCHAR) {
|
||||
dataColSetOffset(pDataCol, numOfPoints);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -629,7 +619,11 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa
|
|||
|
||||
if (pCompCol->colId == pDataCol->colId) {
|
||||
if (pCompBlock->algorithm == TWO_STAGE_COMP) {
|
||||
pHelper->compBuffer = trealloc(pHelper->compBuffer, pCompCol->len + COMP_OVERFLOW_BYTES);
|
||||
int zsize = pDataCol->bytes * pCompBlock->numOfPoints + COMP_OVERFLOW_BYTES;
|
||||
if (pCompCol->type == TSDB_DATA_TYPE_BINARY || pCompCol->type == TSDB_DATA_TYPE_NCHAR) {
|
||||
zsize += (sizeof(VarDataLenT) * pCompBlock->numOfPoints);
|
||||
}
|
||||
pHelper->compBuffer = trealloc(pHelper->compBuffer, zsize);
|
||||
if (pHelper->compBuffer == NULL) goto _err;
|
||||
}
|
||||
if (tsdbCheckAndDecodeColumnData(pDataCol, (char *)pCompData + tsize + pCompCol->offset, pCompCol->len,
|
||||
|
|
|
@ -216,7 +216,7 @@ static bool hasMoreDataInCache(STsdbQueryHandle* pHandle) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (pCheckInfo->iter == NULL) {
|
||||
if (pCheckInfo->iter == NULL && pTable->mem) {
|
||||
pCheckInfo->iter = tSkipListCreateIterFromVal(pTable->mem->pData, (const char*) &pCheckInfo->lastKey,
|
||||
TSDB_DATA_TYPE_TIMESTAMP, pHandle->order);
|
||||
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define TAOS_QTYPE_RPC 0
|
||||
#define TAOS_QTYPE_FWD 1
|
||||
#define TAOS_QTYPE_WAL 2
|
||||
|
||||
typedef void* taos_queue;
|
||||
typedef void* taos_qset;
|
||||
typedef void* taos_qall;
|
||||
|
|
|
@ -32,6 +32,8 @@ int taosGetFqdn(char *fqdn) {
|
|||
uError("failed to get host name");
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(h);
|
||||
}
|
||||
|
||||
uint32_t taosGetIpFromFqdn(const char *fqdn) {
|
||||
|
|
|
@ -15,5 +15,5 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
|
|||
AUX_SOURCE_DIRECTORY(src SRC)
|
||||
|
||||
ADD_LIBRARY(vnode ${SRC})
|
||||
TARGET_LINK_LIBRARIES(vnode tsdb)
|
||||
TARGET_LINK_LIBRARIES(vnode tsdb tcq)
|
||||
ENDIF ()
|
|
@ -30,6 +30,8 @@
|
|||
#include "vnode.h"
|
||||
#include "vnodeInt.h"
|
||||
#include "vnodeLog.h"
|
||||
#include "tcq.h"
|
||||
//#include "tsync.h"
|
||||
|
||||
static int32_t tsOpennedVnodes;
|
||||
static void *tsDnodeVnodesHash;
|
||||
|
@ -192,8 +194,29 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
pVnode->wqueue = dnodeAllocateWqueue(pVnode);
|
||||
pVnode->rqueue = dnodeAllocateRqueue(pVnode);
|
||||
|
||||
SCqCfg cqCfg = {0};
|
||||
sprintf(cqCfg.user, "root");
|
||||
strcpy(cqCfg.pass, tsInternalPass);
|
||||
cqCfg.vgId = vnode;
|
||||
cqCfg.cqWrite = vnodeWriteToQueue;
|
||||
pVnode->cq = cqOpen(pVnode, &cqCfg);
|
||||
|
||||
STsdbAppH appH = {0};
|
||||
appH.appH = (void *)pVnode;
|
||||
appH.walCallBack = vnodeWalCallback;
|
||||
appH.cqH = pVnode->cq;
|
||||
|
||||
sprintf(temp, "%s/tsdb", rootDir);
|
||||
pVnode->tsdb = tsdbOpenRepo(temp, &appH);
|
||||
if (pVnode->tsdb == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to open tsdb at %s(%s)", pVnode, pVnode->vgId, temp, tstrerror(terrno));
|
||||
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
sprintf(temp, "%s/wal", rootDir);
|
||||
pVnode->wal = walOpen(temp, &pVnode->walCfg);
|
||||
walRestore(pVnode->wal, pVnode, vnodeWriteToQueue);
|
||||
|
||||
SSyncInfo syncInfo;
|
||||
syncInfo.vgId = pVnode->vgId;
|
||||
|
@ -208,24 +231,11 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
|||
syncInfo.notifyRole = vnodeNotifyRole;
|
||||
pVnode->sync = syncStart(&syncInfo);
|
||||
|
||||
// start continuous query
|
||||
if (pVnode->role == TAOS_SYNC_ROLE_MASTER)
|
||||
cqStart(pVnode->cq);
|
||||
|
||||
pVnode->events = NULL;
|
||||
pVnode->cq = NULL;
|
||||
|
||||
STsdbAppH appH = {0};
|
||||
appH.appH = (void *)pVnode;
|
||||
appH.walCallBack = vnodeWalCallback;
|
||||
|
||||
sprintf(temp, "%s/tsdb", rootDir);
|
||||
void *pTsdb = tsdbOpenRepo(temp, &appH);
|
||||
if (pTsdb == NULL) {
|
||||
dError("pVnode:%p vgId:%d, failed to open tsdb at %s(%s)", pVnode, pVnode->vgId, temp, tstrerror(terrno));
|
||||
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pVnode->tsdb = pTsdb;
|
||||
|
||||
walRestore(pVnode->wal, pVnode, vnodeWriteToQueue);
|
||||
|
||||
pVnode->status = TAOS_VN_STATUS_READY;
|
||||
dTrace("pVnode:%p vgId:%d, vnode is opened in %s", pVnode, pVnode->vgId, rootDir);
|
||||
|
@ -350,10 +360,16 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
|
|||
pVnode->sync = NULL;
|
||||
}
|
||||
|
||||
tsdbCloseRepo(pVnode->tsdb);
|
||||
walClose(pVnode->wal);
|
||||
vnodeSaveVersion(pVnode);
|
||||
cqClose(pVnode->cq);
|
||||
pVnode->cq = NULL;
|
||||
|
||||
tsdbCloseRepo(pVnode->tsdb);
|
||||
pVnode->tsdb = NULL;
|
||||
|
||||
walClose(pVnode->wal);
|
||||
pVnode->wal = NULL;
|
||||
|
||||
vnodeSaveVersion(pVnode);
|
||||
vnodeRelease(pVnode);
|
||||
}
|
||||
|
||||
|
@ -377,6 +393,11 @@ static int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index) {
|
|||
static void vnodeNotifyRole(void *ahandle, int8_t role) {
|
||||
SVnodeObj *pVnode = ahandle;
|
||||
pVnode->role = role;
|
||||
|
||||
if (pVnode->role == TAOS_SYNC_ROLE_MASTER)
|
||||
cqStart(pVnode->cq);
|
||||
else
|
||||
cqStop(pVnode->cq);
|
||||
}
|
||||
|
||||
static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) {
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "vnode.h"
|
||||
#include "vnodeInt.h"
|
||||
#include "vnodeLog.h"
|
||||
#include "tcq.h"
|
||||
|
||||
static int32_t (*vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *, SRspRet *);
|
||||
static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pMsg, SRspRet *);
|
||||
|
@ -141,7 +142,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
|
|||
SDataRow dataRow = tdNewDataRowFromSchema(pDestTagSchema);
|
||||
|
||||
for (int i = 0; i < numOfTags; i++) {
|
||||
STColumn *pTCol = schemaColAt(pDestSchema, i);
|
||||
STColumn *pTCol = schemaColAt(pDestTagSchema, i);
|
||||
tdAppendColVal(dataRow, pTagData + accumBytes, pTCol->type, pTCol->bytes, pTCol->offset);
|
||||
accumBytes += htons(pSchema[i + numOfColumns].bytes);
|
||||
}
|
||||
|
@ -149,7 +150,6 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
|
|||
}
|
||||
|
||||
code = tsdbCreateTable(pVnode->tsdb, &tCfg);
|
||||
|
||||
tfree(pDestSchema);
|
||||
|
||||
dTrace("pVnode:%p vgId:%d, table:%s is created, result:%x", pVnode, pVnode->vgId, pTable->tableId, code);
|
||||
|
|
|
@ -34,12 +34,12 @@ python3 ./test.py $1 -f table/db_table.py
|
|||
python3 ./test.py -s $1
|
||||
sleep 1
|
||||
|
||||
python3 ./test.py $1 -f import_merge/importDataLastTO.py
|
||||
python3 ./test.py -s $1
|
||||
sleep 1
|
||||
python3 ./test.py $1 -f import_merge/importDataLastT.py
|
||||
python3 ./test.py -s $1
|
||||
sleep 1
|
||||
#python3 ./test.py $1 -f import_merge/importDataLastTO.py
|
||||
#python3 ./test.py -s $1
|
||||
#sleep 1
|
||||
#python3 ./test.py $1 -f import_merge/importDataLastT.py
|
||||
#python3 ./test.py -s $1
|
||||
#sleep 1
|
||||
python3 ./test.py $1 -f import_merge/importDataTO.py
|
||||
python3 ./test.py -s $1
|
||||
sleep 1
|
||||
|
|
|
@ -83,11 +83,21 @@ if __name__ == "__main__":
|
|||
|
||||
tdLog.exit('stop All dnodes')
|
||||
|
||||
if masterIp == "":
|
||||
tdDnodes.init(deployPath)
|
||||
tdDnodes.setTestCluster(testCluster)
|
||||
tdDnodes.setValgrind(valgrind)
|
||||
|
||||
tdDnodes.stopAll()
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
if masterIp == "":
|
||||
host='127.0.0.1'
|
||||
else:
|
||||
host=masterIp
|
||||
|
||||
tdLog.notice("Procedures for tdengine deployed in %s" % (host))
|
||||
|
||||
if testCluster:
|
||||
tdLog.notice("Procedures for testing cluster")
|
||||
if fileName == "all":
|
||||
|
@ -96,23 +106,12 @@ if __name__ == "__main__":
|
|||
tdCases.runOneCluster(fileName)
|
||||
else:
|
||||
tdLog.notice("Procedures for testing self-deployment")
|
||||
tdDnodes.stopAll()
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
conn = taos.connect(
|
||||
host='127.0.0.1',
|
||||
host,
|
||||
config=tdDnodes.getSimCfgPath())
|
||||
if fileName == "all":
|
||||
tdCases.runAllLinux(conn)
|
||||
else:
|
||||
tdCases.runOneLinux(conn, fileName)
|
||||
conn.close()
|
||||
else:
|
||||
tdLog.notice("Procedures for tdengine deployed in %s" % (masterIp))
|
||||
cfgPath = "../../build/test/cfg" # was: tdDnodes.getSimCfgPath()
|
||||
conn = taos.connect(host=masterIp, config=cfgPath)
|
||||
if fileName == "all":
|
||||
tdCases.runAllWindows(conn)
|
||||
else:
|
||||
tdCases.runOneWindows(conn, fileName)
|
||||
|
||||
conn.close()
|
||||
|
|
|
@ -43,7 +43,7 @@ endw
|
|||
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
|
||||
sleep 20000
|
||||
sql select * from log.dn_192_168_0_1
|
||||
|
|
|
@ -21,7 +21,7 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sql connect
|
||||
|
||||
print ========= start other dnodes
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sql connect
|
||||
|
||||
print =============== unsupport
|
||||
sql_error create dnode 192.168.0.2
|
||||
sql_error drop dnode 192.168.0.2
|
||||
sql_error create dnode $hostname2
|
||||
sql_error drop dnode $hostname2
|
||||
|
||||
print =============== show dnodes
|
||||
sql show dnodes;
|
||||
|
|
|
@ -84,11 +84,11 @@ sql alter user read pass 'taosdata' -x step23
|
|||
return -1
|
||||
step23:
|
||||
|
||||
sql create dnode 192.168.0.2 -x step24
|
||||
sql create dnode $hostname2 -x step24
|
||||
return -1
|
||||
step24:
|
||||
|
||||
sql drop dnode 192.168.0.2 -x step25
|
||||
sql drop dnode $hostname2 -x step25
|
||||
return -1
|
||||
step25:
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ if $data00 != $totalNum then
|
|||
endi
|
||||
|
||||
print ========== step1
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -144,12 +144,12 @@ if $data00 != $totalNum then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 10000
|
||||
|
||||
print ========== step3
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show3:
|
||||
|
@ -206,7 +206,7 @@ if $data00 != $totalNum then
|
|||
endi
|
||||
|
||||
print ========== step4
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
|
||||
$x = 0
|
||||
show4:
|
||||
|
@ -260,7 +260,7 @@ endi
|
|||
|
||||
print ========== step5
|
||||
sql alter database db replica 2
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -48,7 +48,7 @@ system sh/cfg.sh -n dnode2 -c maxShellConns -v 100000
|
|||
system sh/cfg.sh -n dnode2 -c maxMgmtConnections -v 100000
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#run unique/big/balance.sim
|
||||
#run unique/big/maxvnodes.sim
|
||||
run unique/big/tcp.sim
|
||||
#run unique/big/tcp.sim
|
||||
|
|
|
@ -1,759 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sleep 1000
|
||||
|
||||
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/deploy.sh -n dnode8 -i 8
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode2 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode3 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode4 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode5 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode6 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode7 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode8 -c commitLog -v 0
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
|
||||
|
||||
print ============== step1
|
||||
print ========= start dnode1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
$x = 0
|
||||
connectTbase:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql connect -x connectTbase
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 4001
|
||||
|
||||
$x = 0
|
||||
created1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create database c_b4_d1 replica 4 -x created1
|
||||
sql use c_b4_d1
|
||||
|
||||
$x = 0
|
||||
create1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b4_t1 (t timestamp, i int) -x create1
|
||||
sql insert into c_b4_t1 values(now+1s, 15)
|
||||
sql insert into c_b4_t1 values(now+2s, 14)
|
||||
sql insert into c_b4_t1 values(now+2s, 13)
|
||||
sql insert into c_b4_t1 values(now+3s, 12)
|
||||
sql insert into c_b4_t1 values(now+4s, 11)
|
||||
|
||||
|
||||
sql create database c_b4_d2 replica 4
|
||||
sql use c_b4_d2
|
||||
$x = 0
|
||||
create2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b4_t2 (t timestamp, i int) -x create2
|
||||
sql insert into c_b4_t2 values(now+1s, 25)
|
||||
sql insert into c_b4_t2 values(now+2s, 24)
|
||||
sql insert into c_b4_t2 values(now+3s, 23)
|
||||
sql insert into c_b4_t2 values(now+4s, 22)
|
||||
sql insert into c_b4_t2 values(now+5s, 21)
|
||||
|
||||
sql create database c_b4_d3 replica 4
|
||||
sql use c_b4_d3
|
||||
$x = 0
|
||||
create3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b4_t3 (t timestamp, i int) -x create3
|
||||
sql insert into c_b4_t3 values(now+1s, 35)
|
||||
sql insert into c_b4_t3 values(now+2s, 34)
|
||||
sql insert into c_b4_t3 values(now+3s, 33)
|
||||
sql insert into c_b4_t3 values(now+4s, 32)
|
||||
sql insert into c_b4_t3 values(now+5s, 31)
|
||||
|
||||
$x = 0
|
||||
show1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show1
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 1 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode5Vnodes != null then
|
||||
goto show1
|
||||
endi
|
||||
|
||||
print ============================== step2
|
||||
print ========= start dnode5
|
||||
sql create dnode 192.168.0.5
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show2
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
|
||||
if $dnode5Vnodes != 2 then
|
||||
goto show2
|
||||
endi
|
||||
|
||||
print ============================== step3
|
||||
print ========= drop dnode2
|
||||
sql drop dnode 192.168.0.2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show3
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode2Vnodes != null then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
|
||||
print ============================== step4
|
||||
print ========= start dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 10000
|
||||
|
||||
$x = 0
|
||||
show4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show4
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode2Vnodes != 2 then
|
||||
goto show4
|
||||
endi
|
||||
|
||||
print ============================== step5
|
||||
print ========= drop dnode3
|
||||
sql drop dnode 192.168.0.3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show5:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show5
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 1 then
|
||||
goto show5
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show5
|
||||
endi
|
||||
if $dnode3Vnodes != null then
|
||||
goto show5
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show5
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show5
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode3 -s stop
|
||||
|
||||
print ============================== step6
|
||||
print ========= start dnode3
|
||||
sql create dnode 192.168.0.3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show6:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show6
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode3Vnodes != 2 then
|
||||
goto show6
|
||||
endi
|
||||
|
||||
print ============================== step7
|
||||
print ========= drop dnode4
|
||||
sql drop dnode 192.168.0.4
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show7:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show7
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 1 then
|
||||
goto show7
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show7
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show7
|
||||
endi
|
||||
if $dnode4Vnodes != null then
|
||||
goto show7
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show7
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
|
||||
print ============================== step8
|
||||
print ========= start dnode4
|
||||
sql create dnode 192.168.0.4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show8:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show8
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode4Vnodes != 2 then
|
||||
goto show8
|
||||
endi
|
||||
|
||||
print ============================== step9
|
||||
print ========= drop dnode5
|
||||
sql drop dnode 192.168.0.5
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show9:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show9
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 1 then
|
||||
goto show9
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show9
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show9
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show9
|
||||
endi
|
||||
if $dnode5Vnodes != null then
|
||||
goto show9
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode5 -s stop
|
||||
|
||||
print ============================== step10
|
||||
print ========= start dnode5
|
||||
sql create dnode 192.168.0.5
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show10:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show10
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode5Vnodes != 2 then
|
||||
goto show10
|
||||
endi
|
||||
|
||||
print ============================== step11
|
||||
print ========= drop dnode1
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
show11:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show11
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != null then
|
||||
goto show11
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show11
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show11
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show11
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show11
|
||||
endi
|
||||
|
||||
print ============================== step12
|
||||
print ========= start dnode1
|
||||
sql create dnode 192.168.0.1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 12000
|
||||
|
||||
$x = 0
|
||||
show12:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show12
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 2 then
|
||||
goto show12
|
||||
endi
|
||||
|
||||
print ============================== step13
|
||||
print ========= add db4
|
||||
|
||||
sql create database c_b4_d4 replica 4
|
||||
sql use c_b4_d4
|
||||
|
||||
$x = 0
|
||||
create4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b4_t4 (t timestamp, i int) -x create4
|
||||
sql insert into c_b4_t4 values(now+1s, 45)
|
||||
sql insert into c_b4_t4 values(now+2s, 44)
|
||||
sql insert into c_b4_t4 values(now+3s, 43)
|
||||
sql insert into c_b4_t4 values(now+4s, 42)
|
||||
sql insert into c_b4_t4 values(now+5s, 41)
|
||||
|
||||
sql create database c_b4_d5 replica 4
|
||||
sql use c_b4_d5;
|
||||
|
||||
$x = 0
|
||||
create5:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b4_t5 (t timestamp, i int) -x create5
|
||||
sql insert into c_b4_t5 values(now+1s, 55)
|
||||
sql insert into c_b4_t5 values(now+2s, 54)
|
||||
sql insert into c_b4_t5 values(now+3s, 53)
|
||||
sql insert into c_b4_t5 values(now+4s, 52)
|
||||
sql insert into c_b4_t5 values(now+5s, 51)
|
||||
|
||||
$x = 0
|
||||
show13:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show13
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 0 then
|
||||
goto show13
|
||||
endi
|
||||
if $dnode2Vnodes != 0 then
|
||||
goto show13
|
||||
endi
|
||||
if $dnode3Vnodes != 0 then
|
||||
goto show13
|
||||
endi
|
||||
if $dnode4Vnodes != 0 then
|
||||
goto show13
|
||||
endi
|
||||
if $dnode4Vnodes != 0 then
|
||||
goto show13
|
||||
endi
|
||||
|
||||
print ============================== step14
|
||||
print ========= check data
|
||||
|
||||
sql use c_b4_d1
|
||||
sql select * from c_b4_t1
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 11 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 12 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 13 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 14 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b4_d2
|
||||
sql select * from c_b4_t2
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
|
||||
if $data01 != 21 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 23 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 24 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 25 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b4_d3
|
||||
sql select * from c_b4_t3
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 31 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 32 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 33 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 34 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 35 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b4_d4
|
||||
sql select * from c_b4_t4
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 41 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 42 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 43 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 44 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 45 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b4_d5
|
||||
sql select * from c_b4_t5
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 51 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 52 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 53 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 54 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 55 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============================================ over
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
system sh/exec.sh -n dnode3 -s stop
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
system sh/exec.sh -n dnode5 -s stop
|
||||
system sh/exec.sh -n dnode6 -s stop
|
||||
system sh/exec.sh -n dnode7 -s stop
|
||||
system sh/exec.sh -n dnode8 -s stop
|
||||
|
||||
|
|
@ -1,413 +0,0 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sleep 1000
|
||||
|
||||
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/deploy.sh -n dnode8 -i 8
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode2 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode3 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode4 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode5 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode6 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode7 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode8 -c commitLog -v 0
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
|
||||
|
||||
print ============== step1
|
||||
print ========= start dnode1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
$x = 0
|
||||
connectTbase:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql connect -x connectTbase
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode 192.168.0.5
|
||||
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
|
||||
sleep 4001
|
||||
|
||||
$x = 0
|
||||
created1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create database c_b5_d1 replica 5 -x created1
|
||||
sql use c_b5_d1
|
||||
$x = 0
|
||||
create1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b5_t1 (t timestamp, i int) -x create1
|
||||
sql insert into c_b5_t1 values(now+1s, 15)
|
||||
sql insert into c_b5_t1 values(now+2s, 14)
|
||||
sql insert into c_b5_t1 values(now+2s, 13)
|
||||
sql insert into c_b5_t1 values(now+3s, 12)
|
||||
sql insert into c_b5_t1 values(now+4s, 11)
|
||||
|
||||
sql create database c_b5_d2 replica 5
|
||||
sql use c_b5_d2
|
||||
$x = 0
|
||||
create2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b5_t2 (t timestamp, i int) -x create2
|
||||
sql insert into c_b5_t2 values(now+1s, 25)
|
||||
sql insert into c_b5_t2 values(now+2s, 24)
|
||||
sql insert into c_b5_t2 values(now+3s, 23)
|
||||
sql insert into c_b5_t2 values(now+4s, 22)
|
||||
sql insert into c_b5_t2 values(now+5s, 21)
|
||||
|
||||
show1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show1
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
|
||||
if $dnode1Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode2Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode3Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode4Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode5Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
|
||||
print ============================== step2
|
||||
print ========= start dnode6
|
||||
|
||||
sql create dnode 192.168.0.6
|
||||
system sh/exec.sh -n dnode6 -s start
|
||||
|
||||
sql create database c_b5_d3 replica 5
|
||||
sql use c_b5_d3
|
||||
$x = 0
|
||||
create3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b5_t3 (t timestamp, i int) -x create3
|
||||
sql insert into c_b5_t3 values(now+1s, 35)
|
||||
sql insert into c_b5_t3 values(now+2s, 34)
|
||||
sql insert into c_b5_t3 values(now+3s, 33)
|
||||
sql insert into c_b5_t3 values(now+4s, 32)
|
||||
sql insert into c_b5_t3 values(now+5s, 31)
|
||||
|
||||
sleep 10000
|
||||
|
||||
show2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show2
|
||||
$dnode1Status = $data4_192.168.0.1
|
||||
print dnode1 $dnode1Status
|
||||
$dnode2Status = $data4_192.168.0.2
|
||||
print dnode2 $dnode2Status
|
||||
$dnode3Status = $data4_192.168.0.3
|
||||
print dnode3 $dnode3Status
|
||||
$dnode4Status = $data4_192.168.0.4
|
||||
print dnode4 $dnode4Status
|
||||
$dnode5Status = $data4_192.168.0.5
|
||||
print dnode5 $dnode5Status
|
||||
$dnode6Status = $data4_192.168.0.6
|
||||
print dnode6 $dnode6Status
|
||||
|
||||
if $dnode1Status != online then
|
||||
goto show2
|
||||
endi
|
||||
if $dnode2Status != online then
|
||||
goto show2
|
||||
endi
|
||||
if $dnode3Status != online then
|
||||
goto show2
|
||||
endi
|
||||
if $dnode4Status != online then
|
||||
goto show2
|
||||
endi
|
||||
if $dnode5Status != online then
|
||||
goto show2
|
||||
endi
|
||||
if $dnode6Status != online then
|
||||
goto show2
|
||||
endi
|
||||
|
||||
print ============================== step3
|
||||
print ========= drop dnode1
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
show3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show3
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
$dnode6Vnodes = $data3_192.168.0.6
|
||||
print dnode6 $dnode6Vnodes
|
||||
|
||||
if $dnode1Vnodes != null then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode6Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
|
||||
print ============================== step4
|
||||
print ========= add db, start dnode7
|
||||
|
||||
sql create database c_b5_d4 replica 5
|
||||
sql use c_b5_d4
|
||||
$x = 0
|
||||
create4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_b5_t4 (t timestamp, i int) -x create4
|
||||
|
||||
$x = 0
|
||||
insert4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into c_b5_t4 values(now+1s, 45) -x insert4
|
||||
sql insert into c_b5_t4 values(now+2s, 44)
|
||||
sql insert into c_b5_t4 values(now+3s, 43)
|
||||
sql insert into c_b5_t4 values(now+4s, 42)
|
||||
sql insert into c_b5_t4 values(now+5s, 41)
|
||||
|
||||
sql create dnode 192.168.0.1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 2000
|
||||
|
||||
sql create dnode 192.168.0.7
|
||||
system sh/exec.sh -n dnode7 -s start
|
||||
sql create dnode 192.168.0.8
|
||||
system sh/exec.sh -n dnode8 -s start
|
||||
sleep 9000
|
||||
|
||||
print ============================== step5
|
||||
print ========= check data
|
||||
|
||||
sql use c_b5_d1
|
||||
sql select * from c_b5_t1
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 11 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 12 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 13 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 14 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b5_d2
|
||||
sql select * from c_b5_t2
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
|
||||
if $data01 != 21 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 23 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 24 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 25 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b5_d3
|
||||
sql select * from c_b5_t3
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 31 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 32 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 33 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 34 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 35 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_b5_d4
|
||||
sql select * from c_b5_t4
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 41 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 42 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 43 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 44 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 45 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============================================ over
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
system sh/exec.sh -n dnode3 -s stop
|
||||
system sh/exec.sh -n dnode4 -s stop
|
||||
system sh/exec.sh -n dnode5 -s stop
|
||||
system sh/exec.sh -n dnode6 -s stop
|
||||
system sh/exec.sh -n dnode7 -s stop
|
||||
system sh/exec.sh -n dnode8 -s stop
|
||||
|
||||
|
|
@ -1,372 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sleep 1000
|
||||
|
||||
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/deploy.sh -n dnode8 -i 8
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
|
||||
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
|
||||
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
|
||||
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode2 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode3 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode4 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode5 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode6 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode7 -c commitLog -v 1
|
||||
system sh/cfg.sh -n dnode8 -c commitLog -v 1
|
||||
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
|
||||
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
|
||||
|
||||
print ============== step1
|
||||
print ========= start dnode1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
$x = 0
|
||||
connectTbase:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql connect -x connectTbase
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 4001
|
||||
sql connect
|
||||
|
||||
$x = 0
|
||||
created1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create database c_bx_d1 replica 4 -x created1
|
||||
sql use c_bx_d1
|
||||
|
||||
$x = 0
|
||||
create1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_bx_t1 (t timestamp, i int) -x create1
|
||||
sql insert into c_bx_t1 values(now+1s, 15)
|
||||
sql insert into c_bx_t1 values(now+2s, 14)
|
||||
sql insert into c_bx_t1 values(now+2s, 13)
|
||||
sql insert into c_bx_t1 values(now+3s, 12)
|
||||
sql insert into c_bx_t1 values(now+4s, 11)
|
||||
|
||||
sql create database c_bx_d2 replica 4
|
||||
sql use c_bx_d2
|
||||
|
||||
$x = 0
|
||||
create2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_bx_t2 (t timestamp, i int) -x create2
|
||||
sql insert into c_bx_t2 values(now+1s, 25)
|
||||
sql insert into c_bx_t2 values(now+2s, 24)
|
||||
sql insert into c_bx_t2 values(now+3s, 23)
|
||||
sql insert into c_bx_t2 values(now+4s, 22)
|
||||
sql insert into c_bx_t2 values(now+5s, 21)
|
||||
|
||||
show1:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show1
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
|
||||
if $dnode1Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode2Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode3Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
if $dnode4Vnodes != 2 then
|
||||
goto show1
|
||||
endi
|
||||
|
||||
print ============================== step2
|
||||
print ========= start dnode6
|
||||
|
||||
sql create database c_bx_d3 replica 4
|
||||
sql use c_bx_d3
|
||||
|
||||
$x = 0
|
||||
create3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_bx_t3 (t timestamp, i int) -x create3
|
||||
sql insert into c_bx_t3 values(now+1s, 35)
|
||||
sql insert into c_bx_t3 values(now+2s, 34)
|
||||
sql insert into c_bx_t3 values(now+3s, 33)
|
||||
sql insert into c_bx_t3 values(now+4s, 32)
|
||||
sql insert into c_bx_t3 values(now+5s, 31)
|
||||
|
||||
sql create dnode 192.168.0.5
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
sleep 9000
|
||||
|
||||
show2:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show2
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
$dnode6Vnodes = $data3_192.168.0.6
|
||||
print dnode6 $dnode6Vnodes
|
||||
|
||||
if $dnode5Vnodes != 2 then
|
||||
goto show2
|
||||
endi
|
||||
|
||||
print ============================== step3
|
||||
print ========= drop dnode1
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
show3:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes -x show3
|
||||
$dnode1Vnodes = $data3_192.168.0.1
|
||||
print dnode1 $dnode1Vnodes
|
||||
$dnode2Vnodes = $data3_192.168.0.2
|
||||
print dnode2 $dnode2Vnodes
|
||||
$dnode3Vnodes = $data3_192.168.0.3
|
||||
print dnode3 $dnode3Vnodes
|
||||
$dnode4Vnodes = $data3_192.168.0.4
|
||||
print dnode4 $dnode4Vnodes
|
||||
$dnode5Vnodes = $data3_192.168.0.5
|
||||
print dnode5 $dnode5Vnodes
|
||||
$dnode6Vnodes = $data3_192.168.0.6
|
||||
print dnode6 $dnode6Vnodes
|
||||
|
||||
if $dnode1Vnodes != null then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode2Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode3Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode4Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
if $dnode5Vnodes != 1 then
|
||||
goto show3
|
||||
endi
|
||||
|
||||
print ============================== step4
|
||||
print ========= add db, start dnode7
|
||||
|
||||
sql create database c_bx_d4 replica 4
|
||||
sql use c_bx_d4
|
||||
|
||||
$x = 0
|
||||
create4:
|
||||
$x = $x + 1
|
||||
sleep 1000
|
||||
if $x == 20 then
|
||||
return -1
|
||||
endi
|
||||
sql create table c_bx_t4 (t timestamp, i int) -x create4
|
||||
sql insert into c_bx_t4 values(now+1s, 45)
|
||||
sql insert into c_bx_t4 values(now+2s, 44)
|
||||
sql insert into c_bx_t4 values(now+3s, 43)
|
||||
sql insert into c_bx_t4 values(now+4s, 42)
|
||||
sql insert into c_bx_t4 values(now+5s, 41)
|
||||
|
||||
print ============================== step5
|
||||
print ========= check data
|
||||
|
||||
sql use c_bx_d1
|
||||
sql select * from c_bx_d1
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 11 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 12 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 13 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 14 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_bx_d2
|
||||
sql select * from c_bx_d2
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
|
||||
if $data01 != 21 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 23 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 24 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 25 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_bx_d3
|
||||
sql select * from c_bx_d3
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 31 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 32 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 33 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 34 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 35 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql use c_bx_d4
|
||||
sql select * from c_bx_d4
|
||||
print $data01 $data11 $data21 $data31 $data41
|
||||
if $data01 != 41 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 42 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 43 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 44 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 45 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ============================================ over
|
||||
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
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ endi
|
|||
print ============================== step2
|
||||
print ========= start dnode2
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 5000
|
||||
|
||||
|
@ -111,7 +111,7 @@ sql insert into c_b1_t3 values(1520000024031, 31)
|
|||
|
||||
print ============================== step4
|
||||
print ========= drop dnode2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -155,7 +155,7 @@ system sh/cfg.sh -n dnode2 -c clog -v 1
|
|||
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
|
||||
sleep 3000
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -194,7 +194,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode $hostname1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -230,7 +230,7 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ============================== step7
|
||||
print ========= add dnode1
|
||||
sql create dnode 192.168.0.1
|
||||
sql create dnode $hostname1
|
||||
sleep 3000
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 3
|
||||
|
@ -276,7 +276,7 @@ print ========= drop dnode2
|
|||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
print stop dnode2 and sleep 10000
|
||||
sleep 20000
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
print drop dnode2 and sleep 9000
|
||||
sleep 19000
|
||||
|
||||
|
@ -316,7 +316,7 @@ endi
|
|||
|
||||
print ============================== step9
|
||||
print ========= add dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
|
||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||
|
@ -406,7 +406,7 @@ endi
|
|||
print ============================== step11
|
||||
print ========= drop dnode2
|
||||
sleep 2000
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -452,7 +452,7 @@ error3:
|
|||
|
||||
print ============================== step13
|
||||
print ========= add dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
|
||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||
|
@ -516,7 +516,7 @@ print dnode3 ==> $dnode3Role
|
|||
print dnode4 ==> $dnode4Role
|
||||
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 15000
|
||||
|
||||
|
@ -586,8 +586,8 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ========== add dnode4
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.4
|
||||
print sql create dnode 192.168.0.4 over
|
||||
sql create dnode $hostname4
|
||||
print sql create dnode $hostname4 over
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
print sleep 12000
|
||||
sleep 12000
|
||||
|
@ -626,7 +626,7 @@ endi
|
|||
print ============================== step16
|
||||
print ========= drop dnode4, create db9
|
||||
|
||||
sql drop dnode 192.168.0.4
|
||||
sql drop dnode $hostname4
|
||||
sleep 10000
|
||||
sql create database c_b1_d9 tables 4
|
||||
sql use c_b1_d9
|
||||
|
|
|
@ -64,7 +64,7 @@ endi
|
|||
print ============================== step2
|
||||
print ========= start dnode2
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 5000
|
||||
|
||||
|
@ -111,7 +111,7 @@ sql insert into c_b1_t3 values(now+5s, 31)
|
|||
|
||||
print ============================== step4
|
||||
print ========= drop dnode2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -149,7 +149,7 @@ print ========= add dnode2
|
|||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -188,7 +188,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode $hostname1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -224,7 +224,7 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ============================== step7
|
||||
print ========= add dnode1
|
||||
sql create dnode 192.168.0.1
|
||||
sql create dnode $hostname1
|
||||
sleep 23000
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 14000
|
||||
|
@ -264,7 +264,7 @@ print ========= drop dnode2
|
|||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||
print stop dnode2 and sleep 10000
|
||||
sleep 20000
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
print drop dnode2 and sleep 9000
|
||||
sleep 19000
|
||||
|
||||
|
@ -304,7 +304,7 @@ endi
|
|||
|
||||
print ============================== step9
|
||||
print ========= add dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -388,7 +388,7 @@ endi
|
|||
print ============================== step11
|
||||
print ========= drop dnode2
|
||||
sleep 2000
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -434,7 +434,7 @@ error3:
|
|||
|
||||
print ============================== step13
|
||||
print ========= add dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -506,7 +506,7 @@ print dnode3 ==> $dnode3Role
|
|||
print dnode4 ==> $dnode4Role
|
||||
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 15000
|
||||
|
||||
|
@ -576,8 +576,8 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ========== add dnode4
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.4
|
||||
print sql create dnode 192.168.0.4 over
|
||||
sql create dnode $hostname4
|
||||
print sql create dnode $hostname4 over
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
print sleep 12000
|
||||
sleep 12000
|
||||
|
@ -616,7 +616,7 @@ endi
|
|||
print ============================== step16
|
||||
print ========= drop dnode4, create db9
|
||||
|
||||
sql drop dnode 192.168.0.4
|
||||
sql drop dnode $hostname4
|
||||
sleep 10000
|
||||
sql create database c_b1_d9 tables 4
|
||||
sql use c_b1_d9
|
||||
|
|
|
@ -34,7 +34,7 @@ print ========= start dnode1
|
|||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 3000
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -93,7 +93,7 @@ endi
|
|||
print ============================== step2
|
||||
print ========= start dnode3
|
||||
sleep 3000
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 8000
|
||||
|
||||
|
@ -141,7 +141,7 @@ sql insert into c_b1_t3 values(now+5s, 31)
|
|||
|
||||
print ============================== step4
|
||||
print ========= drop dnode3
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -179,7 +179,7 @@ print ========= add dnode3
|
|||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -208,7 +208,7 @@ system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|||
print stop dnode2 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
print drop dnode2 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -236,7 +236,7 @@ endi
|
|||
|
||||
print ============================== step7
|
||||
print ========= add dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -265,7 +265,7 @@ print ========= drop dnode3
|
|||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||
print stop dnode3 and sleep 10000
|
||||
sleep 10000
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
print drop dnode3 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -291,7 +291,7 @@ endi
|
|||
|
||||
print ============================== step9
|
||||
print ========= add dnode3
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -354,7 +354,7 @@ sql insert into c_b1_t2 values(now+1s, 25)
|
|||
|
||||
print ============================== step11
|
||||
print ========= drop dnode3
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -386,7 +386,7 @@ sql use c_b1_d5
|
|||
|
||||
print ============================== step13
|
||||
print ========= add dnode3
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -436,7 +436,7 @@ print dnode3 $dnode3Vnodes
|
|||
|
||||
print ============================== step14
|
||||
print ========= add dnode4
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 10000
|
||||
|
||||
|
@ -488,8 +488,8 @@ sql insert into c_b1_t8 values(now+5s, 81)
|
|||
|
||||
|
||||
print ========== add dnode5
|
||||
sql create dnode 192.168.0.5
|
||||
print sql create dnode 192.168.0.5 over
|
||||
sql create dnode $hostname5
|
||||
print sql create dnode $hostname5 over
|
||||
system sh/exec.sh -n dnode5 -s start
|
||||
print sleep 12000
|
||||
sleep 12000
|
||||
|
@ -528,7 +528,7 @@ endi
|
|||
print ============================== step16
|
||||
print ========= drop dnode5, create db9
|
||||
|
||||
sql drop dnode 192.168.0.5
|
||||
sql drop dnode $hostname5
|
||||
sleep 10000
|
||||
sql create database c_b1_d9 tables 4
|
||||
sql use c_b1_d9
|
||||
|
|
|
@ -50,8 +50,8 @@ system sh/exec.sh -n dnode1 -s start
|
|||
|
||||
sql connect
|
||||
sleep 4001
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 4001
|
||||
|
@ -110,7 +110,7 @@ endi
|
|||
|
||||
print ============================== step2
|
||||
print ========= drop dnode2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -152,7 +152,7 @@ system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|||
|
||||
print ============================== step3
|
||||
print ========= start dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
|
||||
sleep 3000
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
|
@ -202,7 +202,7 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ============================== step4
|
||||
print ========= drop dnode3
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -244,7 +244,7 @@ system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
|||
|
||||
print ============================== step5
|
||||
print ========= start dnode3
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
|
||||
sleep 3000
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -298,7 +298,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode $hostname1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -339,7 +339,7 @@ print dnode4 ==> $dnode4Role
|
|||
|
||||
print ============================== step7
|
||||
print ========= start dnode1
|
||||
sql create dnode 192.168.0.1
|
||||
sql create dnode $hostname1
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_192.168.0.1
|
||||
|
@ -410,7 +410,7 @@ sql insert into c_b2_t4 values(1520000022043, 43)
|
|||
sql insert into c_b2_t4 values(1520000023042, 42)
|
||||
sql insert into c_b2_t4 values(1520000024041, 41)
|
||||
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -456,8 +456,8 @@ endi
|
|||
|
||||
print ============================== step9
|
||||
print ========= drop dnode1.4
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode 192.168.0.4
|
||||
sql drop dnode $hostname1
|
||||
sql drop dnode $hostname4
|
||||
sleep 10000
|
||||
|
||||
sql show mnodes
|
||||
|
@ -505,8 +505,8 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
|||
|
||||
print ============================== step10
|
||||
print ========= start dnode1.4
|
||||
sql create dnode 192.168.0.1
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname1
|
||||
sql create dnode $hostname4
|
||||
|
||||
sleep 3000
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
|
|
|
@ -60,8 +60,8 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sql connect
|
||||
sleep 2001
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 3001
|
||||
|
@ -125,7 +125,7 @@ endi
|
|||
|
||||
print ============================== step2
|
||||
print ========= start dnode4
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -152,7 +152,7 @@ endi
|
|||
|
||||
print ============================== step3
|
||||
print ========= drop dnode2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -196,7 +196,7 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
|||
system sh/cfg.sh -n dnode2 -c clog -v 1
|
||||
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
|
||||
sleep 3000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 10000
|
||||
|
||||
|
@ -223,7 +223,7 @@ endi
|
|||
|
||||
print ============================== step5
|
||||
print ========= drop dnode3
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -268,7 +268,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
|||
system sh/cfg.sh -n dnode3 -c clog -v 1
|
||||
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
|
||||
sleep 3000
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -295,7 +295,7 @@ endi
|
|||
|
||||
print ============================== step7
|
||||
print ========= drop dnode4
|
||||
sql drop dnode 192.168.0.4
|
||||
sql drop dnode $hostname4
|
||||
sleep 9000
|
||||
|
||||
$x = 0
|
||||
|
@ -339,7 +339,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
|||
system sh/cfg.sh -n dnode4 -c clog -v 1
|
||||
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
|
||||
sleep 3000
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -370,7 +370,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|||
print stop dnode1 and sleep 10000
|
||||
sleep 10000
|
||||
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode $hostname1
|
||||
print drop dnode1 and sleep 9000
|
||||
sleep 9000
|
||||
|
||||
|
@ -413,7 +413,7 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
|
|||
system sh/cfg.sh -n dnode1 -c clog -v 1
|
||||
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
|
||||
sleep 3000
|
||||
sql create dnode 192.168.0.1
|
||||
sql create dnode $hostname1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -490,7 +490,7 @@ endi
|
|||
|
||||
print ============================== step12
|
||||
print ========= drop dnode1
|
||||
sql drop dnode 192.168.0.1
|
||||
sql drop dnode $hostname1
|
||||
sleep 10000
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
run unique/unique/balance1.sim
|
||||
run unique/unique/balance2.sim
|
||||
run unique/unique/balance3.sim
|
||||
run unique/unique/balance1_bug.sim
|
||||
run unique/unique/balance1_single.sim
|
||||
#run unique/unique/balance1.sim
|
||||
#run unique/unique/balance2.sim
|
||||
#run unique/unique/balance3.sim
|
||||
#run unique/unique/balance1_bug.sim
|
||||
#run unique/unique/balance1_single.sim
|
|
@ -1,39 +1,36 @@
|
|||
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/cfg.sh -n dnode1 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode2 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode3 -c commitLog -v 0
|
||||
system sh/cfg.sh -n dnode1 -c clog -v 2
|
||||
system sh/cfg.sh -n dnode2 -c clog -v 2
|
||||
system sh/cfg.sh -n dnode3 -c clog -v 2
|
||||
system sh/cfg.sh -n dnode1 -c numofMpeers -v 3
|
||||
system sh/cfg.sh -n dnode2 -c numofMpeers -v 3
|
||||
system sh/cfg.sh -n dnode3 -c numofMpeers -v 3
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
sql create database db replica 3
|
||||
sql use db
|
||||
sql create table mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int)
|
||||
sql create table tb1 using mt tags(1, 2)
|
||||
sql create table db.mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int)
|
||||
sql create table db.tb1 using db.mt tags(1, 2)
|
||||
sleep 3001
|
||||
|
||||
$x = 1000
|
||||
while $x < 2000
|
||||
while $x < 1010
|
||||
sql insert into tb1 values (now+1s , $x , $x , $x , $x , $x , $x , $x , $x , $x , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop
|
||||
system sh/exec.sh -n dnode2 -s stop
|
||||
system sh/exec.sh -n dnode3 -s stop
|
||||
system sh/exec_up.sh -n dnode1 -s stop
|
||||
system sh/exec_up.sh -n dnode2 -s stop
|
||||
system sh/exec_up.sh -n dnode3 -s stop
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
run unique/column/replica3.sim
|
||||
#run unique/column/replica3.sim
|
||||
|
|
|
@ -22,7 +22,7 @@ sql connect
|
|||
sleep 3000
|
||||
|
||||
print ========= start other dnodes
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ system sh/cfg.sh -n dnode3 -c cacheBlockSize -v 200
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ system sh/cfg.sh -n dnode4 -c tables -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -32,9 +28,9 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
||||
|
@ -77,19 +73,19 @@ endi
|
|||
sleep 2000
|
||||
|
||||
sql show dnodes
|
||||
print dnode192.168.0.1 ==> openVnodes: $data3_1
|
||||
print dnode192.168.0.2 ==> openVnodes: $data3_2
|
||||
print dnode192.168.0.3 ==> openVnodes: $data3_3
|
||||
print dnode1 ==> openVnodes: $data3_1
|
||||
print dnode2 ==> openVnodes: $data3_2
|
||||
print dnode3 ==> openVnodes: $data3_3
|
||||
|
||||
if $data3_1 != 0 then
|
||||
if $data2_1 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_2 != 2 then
|
||||
if $data2_2 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 2 then
|
||||
if $data2_3 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -103,19 +99,19 @@ sleep 10000
|
|||
print ======== step3
|
||||
|
||||
sql show dnodes
|
||||
print dnode192.168.0.1 ==> openVnodes: $data3_1
|
||||
print dnode192.168.0.2 ==> openVnodes: $data3_2
|
||||
print dnode192.168.0.3 ==> openVnodes: $data3_3
|
||||
print dnode1 ==> openVnodes: $data3_1
|
||||
print dnode2 ==> openVnodes: $data3_2
|
||||
print dnode3 ==> openVnodes: $data3_3
|
||||
|
||||
if $data3_1 != 0 then
|
||||
if $data2_1 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_2 != 4 then
|
||||
if $data2_2 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 4 then
|
||||
if $data2_3 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -174,15 +170,13 @@ endi
|
|||
|
||||
print ===== insert data
|
||||
|
||||
sql insert into d1.t1 values(now, 3)
|
||||
# no master
|
||||
sql_error insert into d1.t1 values(now, 3)
|
||||
sql_error insert into d2.t2 values(now, 3)
|
||||
sql insert into d3.t3 values(now, 3)
|
||||
# no master
|
||||
sql_error insert into d3.t3 values(now, 3)
|
||||
sql_error insert into d4.t4 values(now, 3)
|
||||
|
||||
sql select * from d1.t1
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -192,7 +186,7 @@ if $rows != 2 then
|
|||
endi
|
||||
|
||||
sql select * from d3.t3
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -205,8 +199,11 @@ print ========= step6
|
|||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 5000
|
||||
|
||||
sql insert into d1.t1 values(now, 3)
|
||||
sql insert into d2.t2 values(now, 3)
|
||||
sql insert into d3.t3 values(now, 3)
|
||||
sql insert into d4.t4 values(now, 3)
|
||||
|
||||
sql select * from d1.t1
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
|
@ -232,20 +229,28 @@ print ========= step61
|
|||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
|
||||
# no master
|
||||
sql_error insert into d1.t1 values(now, 4)
|
||||
sql insert into d2.t2 values(now, 4)
|
||||
# no master
|
||||
sql_error insert into d3.t3 values(now, 4)
|
||||
sql insert into d4.t4 values(now, 4)
|
||||
sql_error insert into d1.t1 values(now, 3)
|
||||
sql_error insert into d2.t2 values(now, 3)
|
||||
sql_error insert into d3.t3 values(now, 3)
|
||||
sql_error insert into d4.t4 values(now, 3)
|
||||
|
||||
sql select * from d1.t1
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.t2
|
||||
if $rows != 4 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.t3
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.t4
|
||||
if $rows != 4 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -264,7 +269,7 @@ if $rows != 4 then
|
|||
endi
|
||||
|
||||
sql select * from d2.t2
|
||||
if $rows != 5 then
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -274,6 +279,6 @@ if $rows != 4 then
|
|||
endi
|
||||
|
||||
sql select * from d4.t4
|
||||
if $rows != 5 then
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
|
@ -1,9 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -32,11 +28,11 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
sleep 3000
|
||||
|
||||
|
@ -93,24 +89,24 @@ show3:
|
|||
endi
|
||||
|
||||
sql show dnodes
|
||||
print dnode192.168.0.1 ==> openVnodes: $data3_1
|
||||
print dnode192.168.0.2 ==> openVnodes: $data3_2
|
||||
print dnode192.168.0.3 ==> openVnodes: $data3_3
|
||||
print dnode192.168.0.4 ==> openVnodes: $data3_4
|
||||
print dnode1 ==> openVnodes: $data2_1
|
||||
print dnode2 ==> openVnodes: $data2_2
|
||||
print dnode3 ==> openVnodes: $data2_3
|
||||
print dnode4 ==> openVnodes: $data2_4
|
||||
|
||||
if $data3_1 != 0 then
|
||||
if $data2_1 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_2 != 4 then
|
||||
if $data2_2 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 4 then
|
||||
if $data2_3 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 4 then
|
||||
if $data2_3 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -32,11 +28,11 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
sleep 3000
|
||||
|
||||
|
@ -93,24 +89,24 @@ show3:
|
|||
endi
|
||||
|
||||
sql show dnodes
|
||||
print dnode192.168.0.1 ==> openVnodes: $data3_1
|
||||
print dnode192.168.0.2 ==> openVnodes: $data3_2
|
||||
print dnode192.168.0.3 ==> openVnodes: $data3_3
|
||||
print dnode192.168.0.4 ==> openVnodes: $data3_4
|
||||
print dnode1 ==> openVnodes: $data2_1
|
||||
print dnode2 ==> openVnodes: $data2_2
|
||||
print dnode3 ==> openVnodes: $data2_3
|
||||
print dnode4 ==> openVnodes: $data2_4
|
||||
|
||||
if $data3_1 != 0 then
|
||||
if $data2_1 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_2 != 4 then
|
||||
if $data2_2 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 4 then
|
||||
if $data2_3 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data3_3 != 4 then
|
||||
if $data2_3 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -22,9 +20,9 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -22,7 +20,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -22,9 +20,9 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/deploy.sh -n dnode3 -i 3
|
||||
|
@ -22,9 +20,9 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
|||
print ========= start dnodes
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
||||
|
@ -97,34 +95,26 @@ if $rows != 2 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql reset query cache
|
||||
sleep 1000
|
||||
|
||||
print ========= step4
|
||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep 5000
|
||||
|
||||
sql insert into d1.t1 values(now, 3)
|
||||
sql insert into d2.t2 values(now, 3)
|
||||
sql insert into d3.t3 values(now, 3)
|
||||
sql insert into d4.t4 values(now, 3)
|
||||
sql insert into d1.t1 values(now, 3) -x step1
|
||||
step1:
|
||||
sql insert into d2.t2 values(now, 3) -x step2
|
||||
step2:
|
||||
sql insert into d3.t3 values(now, 3) -x step3
|
||||
step3:
|
||||
sql insert into d4.t4 values(now, 3) -x step4
|
||||
step4:
|
||||
|
||||
sql select * from d1.t1
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d2.t2
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d3.t3
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select * from d4.t4
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ========= step5
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
@ -136,16 +126,18 @@ sleep 5000
|
|||
sql reset query cache
|
||||
sleep 1000
|
||||
|
||||
sql_error insert into d1.t1 values(now, 4)
|
||||
sql_error insert into d2.t2 values(now, 4)
|
||||
sql_error insert into d3.t3 values(now, 4)
|
||||
sql_error insert into d4.t4 values(now, 4)
|
||||
sql insert into d1.t1 values(now, 3) -x step11
|
||||
step11:
|
||||
sql insert into d2.t2 values(now, 3) -x step21
|
||||
step21:
|
||||
sql insert into d3.t3 values(now, 3) -x step31
|
||||
step31:
|
||||
sql insert into d4.t4 values(now, 3) -x step41
|
||||
step41:
|
||||
|
||||
print ========= step6
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 5000
|
||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
sleep 3000
|
||||
|
||||
sql insert into d1.t1 values(now, 5)
|
||||
sql insert into d2.t2 values(now, 5)
|
||||
|
@ -153,21 +145,13 @@ sql insert into d3.t3 values(now, 5)
|
|||
sql insert into d4.t4 values(now, 5)
|
||||
|
||||
sql select * from d1.t1
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
print d1.t1 $rows
|
||||
|
||||
sql select * from d2.t2
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
print d2.t2 $rows
|
||||
|
||||
sql select * from d3.t3
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
print d3.t3 $rows
|
||||
|
||||
sql select * from d4.t4
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
print d4.t4 $rows
|
||||
|
|
|
@ -56,7 +56,7 @@ endi
|
|||
|
||||
print ========== step2
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -97,7 +97,7 @@ if $data3_2 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step4
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show4:
|
||||
|
@ -123,7 +123,7 @@ endi
|
|||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
|
||||
print ========== step5
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -173,7 +173,7 @@ if $data3_3 != 3 then
|
|||
endi
|
||||
|
||||
print ========== step7
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -231,7 +231,7 @@ if $data3_4 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step9
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
|
||||
$x = 0
|
||||
show9:
|
||||
|
|
|
@ -40,8 +40,8 @@ print ========== step1
|
|||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sleep 3000
|
||||
|
@ -77,7 +77,7 @@ if $data3_3 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
|
@ -104,7 +104,7 @@ endi
|
|||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
|
||||
print ========== step3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -161,7 +161,7 @@ if $data3_4 != 1 then
|
|||
endi
|
||||
|
||||
print ========== step5
|
||||
sql create dnode 192.168.0.5
|
||||
sql create dnode $hostname5
|
||||
system sh/exec_up.sh -n dnode5 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -195,7 +195,7 @@ if $data3_5 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step6
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
|
||||
$x = 0
|
||||
show6:
|
||||
|
|
|
@ -46,9 +46,9 @@ print ========== step1
|
|||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
|
@ -90,7 +90,7 @@ if $data3_4 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
|
@ -122,7 +122,7 @@ endi
|
|||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
|
||||
print ========== step
|
||||
sql create dnode 192.168.0.5
|
||||
sql create dnode $hostname5
|
||||
system sh/exec_up.sh -n dnode5 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -197,7 +197,7 @@ if $data3_5 != 1 then
|
|||
endi
|
||||
|
||||
print ========== step5
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -225,7 +225,7 @@ endi
|
|||
sleep 8000
|
||||
|
||||
print ========== step6
|
||||
sql drop dnode 192.168.0.3
|
||||
sql drop dnode $hostname3
|
||||
|
||||
$x = 0
|
||||
show6:
|
||||
|
|
|
@ -58,7 +58,7 @@ if $data3_1 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -106,7 +106,7 @@ if $data3_2 != 1 then
|
|||
endi
|
||||
|
||||
print ========== step3
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -131,7 +131,7 @@ if $data3_3 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step5
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show5:
|
||||
|
|
|
@ -33,7 +33,7 @@ if $data01 != 192.168.0.1 then
|
|||
endi
|
||||
|
||||
print =============== create dnodes
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
sql show dnodes;
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
|
|
|
@ -33,7 +33,7 @@ if $data3_1 != 3 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -31,7 +31,7 @@ system sh/cfg.sh -n dnode3 -c clog -v 1
|
|||
print ========== step1
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ system sh/cfg.sh -n dnode3 -c clog -v 1
|
|||
print ========== step1
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 3000
|
||||
|
||||
|
@ -71,9 +71,9 @@ if $data4_192.168.0.2 != offline then
|
|||
endi
|
||||
|
||||
print ========== step4
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
sleep 5000
|
||||
$x = 0
|
||||
|
|
|
@ -58,7 +58,7 @@ if $data3_1 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -89,7 +89,7 @@ if $data3_2 != 1 then
|
|||
endi
|
||||
|
||||
print ========== step3
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
sleep 7001
|
||||
$x = 0
|
||||
|
@ -105,7 +105,7 @@ print dnode1 openVnodes $data3_1
|
|||
print dnode2 openVnodes $data3_2 $data5_192.168.0.2
|
||||
|
||||
print ========== step4
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -127,7 +127,7 @@ endi
|
|||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
|
||||
print ========== step5
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname4
|
||||
system sh/exec_up.sh -n dnode4 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -58,7 +58,7 @@ if $data3_1 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 9000
|
||||
|
||||
|
@ -90,7 +90,7 @@ endi
|
|||
|
||||
print ========== step3
|
||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 7001
|
||||
|
||||
$x = 0
|
||||
|
@ -106,7 +106,7 @@ print dnode1 openVnodes $data3_1
|
|||
print dnode2 openVnodes $data3_2 $data5_192.168.0.2
|
||||
|
||||
print ========== step4
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -49,7 +49,7 @@ if $data3_1 != 3 then
|
|||
endi
|
||||
|
||||
print ========== step2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -91,7 +91,7 @@ if $data3_2 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step4
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show4:
|
||||
|
@ -117,7 +117,7 @@ system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
|||
|
||||
print ========== step5
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
|
||||
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
|
||||
|
@ -163,7 +163,7 @@ if $data3_2 != 1 then
|
|||
endi
|
||||
|
||||
print ========== step7
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
@ -219,7 +219,7 @@ if $data3_3 != 2 then
|
|||
endi
|
||||
|
||||
print ========== step9
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show9:
|
||||
|
|
|
@ -35,7 +35,7 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sleep 3000
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
sql create database ir2db replica 2 days 7
|
||||
|
|
|
@ -35,9 +35,9 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sleep 5000
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ if $dnode2Vnodes != null then
|
|||
goto show1
|
||||
endi
|
||||
print =============== step3 start dnode2
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sleep 8000
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ system sh/exec.sh -n dnode1 -s start
|
|||
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -13,7 +13,7 @@ system sh/cfg.sh -n dnode2 -c sessionsPerVnode -v 4
|
|||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -19,9 +19,9 @@ system sh/exec.sh -n dnode1 -s start
|
|||
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -24,9 +24,9 @@ system sh/exec.sh -n dnode1 -s start
|
|||
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
|
|
@ -13,7 +13,7 @@ system sh/cfg.sh -n dnode2 -c sessionsPerVnode -v 4
|
|||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sql connect
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
|
||||
$x = 0
|
||||
|
|
|
@ -38,11 +38,11 @@ system sh/cfg.sh -n dnode6 -c sessionsPerVnode -v 4
|
|||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode 192.168.0.5
|
||||
sql create dnode 192.168.0.6
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sql create dnode $hostname5
|
||||
sql create dnode $hostname6
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
|
|
@ -24,9 +24,9 @@ system sh/exec.sh -n dnode1 -s start
|
|||
|
||||
sql connect
|
||||
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode 192.168.0.4
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
run unique/metrics/disk.sim
|
||||
run unique/metrics/metrics.sim
|
||||
run unique/metrics/values.sim
|
||||
run unique/metrics/vnode3.sim
|
||||
#run unique/metrics/disk.sim
|
||||
#run unique/metrics/metrics.sim
|
||||
#run unique/metrics/values.sim
|
||||
#run unique/metrics/vnode3.sim
|
|
@ -41,7 +41,7 @@ if $data2_2 != slave then
|
|||
endi
|
||||
|
||||
print ============== step3
|
||||
sql_error drop dnode 192.168.0.1 -x error1
|
||||
sql_error drop dnode $hostname1 -x error1
|
||||
print should not drop master
|
||||
|
||||
print ============== step4
|
||||
|
@ -50,7 +50,7 @@ sql_error show mnodes
|
|||
print error of no master
|
||||
|
||||
print ============== step5
|
||||
sql_error drop dnode 192.168.0.1
|
||||
sql_error drop dnode $hostname1
|
||||
print error of no master
|
||||
|
||||
print ============== step6
|
||||
|
@ -79,7 +79,7 @@ endi
|
|||
|
||||
print ============== step7
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
sleep 5000
|
||||
|
||||
$x = 0
|
||||
|
@ -93,7 +93,7 @@ show7:
|
|||
sql show mnodes
|
||||
print dnode1 ==> $data2_1
|
||||
print dnode2 ==> $data2_2
|
||||
print dnode3 ==> $data3_3
|
||||
print dnode3 ==> $data2_3
|
||||
if $data2_1 != master then
|
||||
goto show7
|
||||
endi
|
||||
|
|
|
@ -20,7 +20,7 @@ endi
|
|||
|
||||
print ============== step2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
|
@ -42,13 +42,13 @@ endi
|
|||
|
||||
print ============== step3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
sleep 8000
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_1
|
||||
$dnode2Role = $data3_2
|
||||
$dnode3Role = $data3_3
|
||||
$dnode1Role = $data2_1
|
||||
$dnode2Role = $data2_2
|
||||
$dnode3Role = $data2_3
|
||||
print dnode1 ==> $dnode1Role
|
||||
print dnode2 ==> $dnode2Role
|
||||
print dnode3 ==> $dnode3Role
|
||||
|
@ -64,13 +64,13 @@ if $dnode3Role != null then
|
|||
endi
|
||||
|
||||
print ============== step4
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 8000
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_1
|
||||
$dnode2Role = $data3_2
|
||||
$dnode3Role = $data3_3
|
||||
$dnode1Role = $data2_1
|
||||
$dnode2Role = $data2_2
|
||||
$dnode3Role = $data2_3
|
||||
print dnode1 ==> $dnode1Role
|
||||
print dnode2 ==> $dnode2Role
|
||||
print dnode3 ==> $dnode3Role
|
||||
|
@ -89,16 +89,16 @@ system sh/exec_up.sh -n dnode2 -s stop
|
|||
|
||||
print ============== step5
|
||||
sleep 2000
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
system sh/deploy.sh -n dnode2 -i 2
|
||||
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sleep 8000
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_1
|
||||
$dnode2Role = $data3_2
|
||||
$dnode3Role = $data3_3
|
||||
$dnode1Role = $data2_1
|
||||
$dnode2Role = $data2_2
|
||||
$dnode3Role = $data2_3
|
||||
print dnode1 ==> $dnode1Role
|
||||
print dnode2 ==> $dnode2Role
|
||||
print dnode3 ==> $dnode3Role
|
||||
|
@ -120,7 +120,7 @@ sleep 10000
|
|||
sql_error show mnodes
|
||||
|
||||
print ============== step7
|
||||
sql_error drop dnode 192.168.0.1
|
||||
sql_error drop dnode $hostname1
|
||||
|
||||
system sh/exec_up.sh -n dnode1 -s stop
|
||||
system sh/exec_up.sh -n dnode2 -s stop
|
||||
|
|
|
@ -20,7 +20,7 @@ endi
|
|||
|
||||
print ============== step2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
|
@ -45,11 +45,11 @@ system sh/exec_up.sh -n dnode1 -s stop
|
|||
sql_error show mnodes
|
||||
|
||||
print ============== step4
|
||||
sql_error drop dnode 192.168.0.1
|
||||
sql_error drop dnode $hostname1
|
||||
|
||||
print ============== step5
|
||||
system sh/exec_up.sh -n dnode1 -s start
|
||||
sql_error create dnode 192.168.0.1
|
||||
sql_error create dnode $hostname1
|
||||
|
||||
sql close
|
||||
sql connect
|
||||
|
|
|
@ -20,7 +20,7 @@ endi
|
|||
|
||||
print ============== step2
|
||||
system sh/exec_up.sh -n dnode2 -s start
|
||||
sql create dnode 192.168.0.2
|
||||
sql create dnode $hostname2
|
||||
|
||||
$x = 0
|
||||
show2:
|
||||
|
@ -42,13 +42,13 @@ endi
|
|||
|
||||
print ============== step3
|
||||
system sh/exec_up.sh -n dnode3 -s start
|
||||
sql create dnode 192.168.0.3
|
||||
sql create dnode $hostname3
|
||||
sleep 6000
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_1
|
||||
$dnode2Role = $data3_2
|
||||
$dnode3Role = $data3_3
|
||||
$dnode1Role = $data2_1
|
||||
$dnode2Role = $data2_2
|
||||
$dnode3Role = $data2_3
|
||||
print dnode1 ==> $dnode1Role
|
||||
print dnode2 ==> $dnode2Role
|
||||
print dnode3 ==> $dnode3Role
|
||||
|
@ -64,13 +64,13 @@ if $dnode3Role != null then
|
|||
endi
|
||||
|
||||
print ============== step4
|
||||
sql drop dnode 192.168.0.2
|
||||
sql drop dnode $hostname2
|
||||
sleep 6000
|
||||
|
||||
sql show mnodes
|
||||
$dnode1Role = $data3_1
|
||||
$dnode2Role = $data3_2
|
||||
$dnode3Role = $data3_3
|
||||
$dnode1Role = $data2_1
|
||||
$dnode2Role = $data2_2
|
||||
$dnode3Role = $data2_3
|
||||
print dnode1 ==> $dnode1Role
|
||||
print dnode2 ==> $dnode2Role
|
||||
print dnode3 ==> $dnode3Role
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue