Merge branch 'develop' into hotfix/crash
This commit is contained in:
commit
c0a727a7d3
|
@ -209,6 +209,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
|
||||||
tscError("%p sql is already released", pSql->signature);
|
tscError("%p sql is already released", pSql->signature);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSql->signature != pSql) {
|
if (pSql->signature != pSql) {
|
||||||
tscError("%p sql is already released, signature:%p", pSql, pSql->signature);
|
tscError("%p sql is already released, signature:%p", pSql, pSql->signature);
|
||||||
return;
|
return;
|
||||||
|
@ -217,10 +218,9 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
|
||||||
SSqlRes *pRes = &pSql->res;
|
SSqlRes *pRes = &pSql->res;
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
STscObj *pObj = pSql->pTscObj;
|
STscObj *pObj = pSql->pTscObj;
|
||||||
// tscTrace("%p msg:%s is received from server", pSql, taosMsg[rpcMsg->msgType]);
|
|
||||||
|
|
||||||
if (pObj->signature != pObj) {
|
if (pObj->signature != pObj || pSql->freed == 1) {
|
||||||
tscTrace("%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p", pSql, pSql->freed,
|
tscTrace("%p sqlObj needs to be released or DB connection is closed, freed:%d pObj:%p signature:%p", pSql, pSql->freed,
|
||||||
pObj, pObj->signature);
|
pObj, pObj->signature);
|
||||||
tscFreeSqlObj(pSql);
|
tscFreeSqlObj(pSql);
|
||||||
rpcFreeCont(rpcMsg->pCont);
|
rpcFreeCont(rpcMsg->pCont);
|
||||||
|
@ -375,7 +375,7 @@ int tscProcessSql(SSqlObj *pSql) {
|
||||||
|
|
||||||
SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
|
SQueryInfo * pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
|
||||||
STableMetaInfo *pTableMetaInfo = NULL;
|
STableMetaInfo *pTableMetaInfo = NULL;
|
||||||
uint16_t type = 0;
|
uint32_t type = 0;
|
||||||
|
|
||||||
if (pQueryInfo != NULL) {
|
if (pQueryInfo != NULL) {
|
||||||
pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
||||||
|
@ -424,7 +424,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
|
||||||
* sub-queries not correctly released and master sql object of super table query reaches an abnormal state.
|
* sub-queries not correctly released and master sql object of super table query reaches an abnormal state.
|
||||||
*/
|
*/
|
||||||
pSql->pSubs[i]->res.code = TSDB_CODE_TSC_QUERY_CANCELLED;
|
pSql->pSubs[i]->res.code = TSDB_CODE_TSC_QUERY_CANCELLED;
|
||||||
//taosStopRpcConn(pSql->pSubs[i]->thandle);
|
// taosStopRpcConn(pSql->pSubs[i]->);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -219,6 +219,11 @@ void waitForQueryRsp(void *param, TAOS_RES *tres, int code) {
|
||||||
sem_post(&pSql->rspSem);
|
sem_post(&pSql->rspSem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void waitForRetrieveRsp(void *param, TAOS_RES *tres, int numOfRows) {
|
||||||
|
SSqlObj* pSql = (SSqlObj*) tres;
|
||||||
|
sem_post(&pSql->rspSem);
|
||||||
|
}
|
||||||
|
|
||||||
TAOS_RES* taos_query(TAOS *taos, const char *sqlstr) {
|
TAOS_RES* taos_query(TAOS *taos, const char *sqlstr) {
|
||||||
STscObj *pObj = (STscObj *)taos;
|
STscObj *pObj = (STscObj *)taos;
|
||||||
if (pObj == NULL || pObj->signature != pObj) {
|
if (pObj == NULL || pObj->signature != pObj) {
|
||||||
|
@ -369,11 +374,6 @@ int taos_fetch_block_impl(TAOS_RES *res, TAOS_ROW *rows) {
|
||||||
return (pQueryInfo->order.order == TSDB_ORDER_DESC) ? pRes->numOfRows : -pRes->numOfRows;
|
return (pQueryInfo->order.order == TSDB_ORDER_DESC) ? pRes->numOfRows : -pRes->numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void waitForRetrieveRsp(void *param, TAOS_RES *tres, int numOfRows) {
|
|
||||||
SSqlObj* pSql = (SSqlObj*) tres;
|
|
||||||
sem_post(&pSql->rspSem);
|
|
||||||
}
|
|
||||||
|
|
||||||
TAOS_ROW taos_fetch_row(TAOS_RES *res) {
|
TAOS_ROW taos_fetch_row(TAOS_RES *res) {
|
||||||
SSqlObj *pSql = (SSqlObj *)res;
|
SSqlObj *pSql = (SSqlObj *)res;
|
||||||
if (pSql == NULL || pSql->signature != pSql) {
|
if (pSql == NULL || pSql->signature != pSql) {
|
||||||
|
@ -476,7 +476,7 @@ int taos_select_db(TAOS *taos, const char *db) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// send free message to vnode to free qhandle and corresponding resources in vnode
|
// send free message to vnode to free qhandle and corresponding resources in vnode
|
||||||
static void tscFreeQhandleInVnode(SSqlObj* pSql) {
|
static bool tscFreeQhandleInVnode(SSqlObj* pSql) {
|
||||||
SSqlCmd* pCmd = &pSql->cmd;
|
SSqlCmd* pCmd = &pSql->cmd;
|
||||||
SSqlRes* pRes = &pSql->res;
|
SSqlRes* pRes = &pSql->res;
|
||||||
|
|
||||||
|
@ -496,10 +496,19 @@ static void tscFreeQhandleInVnode(SSqlObj* pSql) {
|
||||||
tscProcessSql(pSql);
|
tscProcessSql(pSql);
|
||||||
|
|
||||||
// in case of sync model query, waits for response and then goes on
|
// in case of sync model query, waits for response and then goes on
|
||||||
if (pSql->fp == waitForQueryRsp || pSql->fp == waitForRetrieveRsp) {
|
// if (pSql->fp == waitForQueryRsp || pSql->fp == waitForRetrieveRsp) {
|
||||||
sem_wait(&pSql->rspSem);
|
// sem_wait(&pSql->rspSem);
|
||||||
}
|
|
||||||
|
// tscFreeSqlObj(pSql);
|
||||||
|
// tscTrace("%p sqlObj is freed by app", pSql);
|
||||||
|
// } else {
|
||||||
|
tscTrace("%p sqlObj will be freed while rsp received", pSql);
|
||||||
|
// }
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taos_free_result(TAOS_RES *res) {
|
void taos_free_result(TAOS_RES *res) {
|
||||||
|
@ -527,10 +536,10 @@ void taos_free_result(TAOS_RES *res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
|
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
|
||||||
tscFreeQhandleInVnode(pSql);
|
if (!tscFreeQhandleInVnode(pSql)) {
|
||||||
tscFreeSqlObj(pSql);
|
tscFreeSqlObj(pSql);
|
||||||
|
tscTrace("%p sqlObj is freed by app", pSql);
|
||||||
tscTrace("%p sql result is freed by app", pSql);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo should not be used in async query
|
// todo should not be used in async query
|
||||||
|
|
|
@ -134,24 +134,6 @@ void tscGetDBInfoFromMeterId(char* tableId, char* db) {
|
||||||
db[0] = 0;
|
db[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//STableIdInfo* tscGetMeterSidInfo(SVnodeSidList* pSidList, int32_t idx) {
|
|
||||||
// if (pSidList == NULL) {
|
|
||||||
// tscError("illegal sidlist");
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (idx < 0 || idx >= pSidList->numOfSids) {
|
|
||||||
// int32_t sidRange = (pSidList->numOfSids > 0) ? (pSidList->numOfSids - 1) : 0;
|
|
||||||
//
|
|
||||||
// tscError("illegal sidIdx:%d, reset to 0, sidIdx range:%d-%d", idx, 0, sidRange);
|
|
||||||
// idx = 0;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// assert(pSidList->pSidExtInfoList[idx] >= 0);
|
|
||||||
//
|
|
||||||
// return (STableIdInfo*)(pSidList->pSidExtInfoList[idx] + (char*)pSidList);
|
|
||||||
//}
|
|
||||||
|
|
||||||
bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
||||||
if (pQueryInfo == NULL) {
|
if (pQueryInfo == NULL) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -176,8 +158,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((pQueryInfo->type & TSDB_QUERY_TYPE_STABLE_SUBQUERY) != TSDB_QUERY_TYPE_STABLE_SUBQUERY) &&
|
if (!TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STABLE_SUBQUERY) && pQueryInfo->command == TSDB_SQL_SELECT) {
|
||||||
pQueryInfo->command == TSDB_SQL_SELECT) {
|
|
||||||
return UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo);
|
return UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1262,9 +1262,10 @@ bool taosCheckGlobalCfg() {
|
||||||
taosSetAllDebugFlag();
|
taosSetAllDebugFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsLocalFqdn[0] == 0)
|
if (tsLocalFqdn[0] == 0) {
|
||||||
taosGetFqdn(tsLocalEp);
|
taosGetFqdn(tsLocalFqdn);
|
||||||
else
|
}
|
||||||
|
|
||||||
strcpy(tsLocalEp, tsLocalFqdn);
|
strcpy(tsLocalEp, tsLocalFqdn);
|
||||||
|
|
||||||
snprintf(tsLocalEp + strlen(tsLocalEp), sizeof(tsLocalEp), ":%d", tsServerPort);
|
snprintf(tsLocalEp + strlen(tsLocalEp), sizeof(tsLocalEp), ":%d", tsServerPort);
|
||||||
|
|
|
@ -83,7 +83,7 @@ void rpcSendResponse(const SRpcMsg *pMsg);
|
||||||
void rpcSendRedirectRsp(void *pConn, const SRpcIpSet *pIpSet);
|
void rpcSendRedirectRsp(void *pConn, const SRpcIpSet *pIpSet);
|
||||||
int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo);
|
int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo);
|
||||||
void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pReq, SRpcMsg *pRsp);
|
void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pReq, SRpcMsg *pRsp);
|
||||||
void rpcReportProgress(void *pConn, char *pCont, int contLen);
|
int rpcReportProgress(void *pConn, char *pCont, int contLen);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -451,7 +451,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
|
||||||
|
|
||||||
pthread_mutex_unlock(&pTable->mutex);
|
pthread_mutex_unlock(&pTable->mutex);
|
||||||
|
|
||||||
sdbTrace("table:%s, insert record:%s to hash, rowSize:%d vnumOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName,
|
sdbTrace("table:%s, insert record:%s to hash, rowSize:%d numOfRows:%" PRId64 " version:%" PRIu64, pTable->tableName,
|
||||||
sdbGetKeyStrFromObj(pTable, pOper->pObj), pOper->rowSize, pTable->numOfRows, sdbGetVersion());
|
sdbGetKeyStrFromObj(pTable, pOper->pObj), pOper->rowSize, pTable->numOfRows, sdbGetVersion());
|
||||||
|
|
||||||
(*pTable->insertFp)(pOper);
|
(*pTable->insertFp)(pOper);
|
||||||
|
@ -475,7 +475,7 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
|
||||||
pTable->numOfRows--;
|
pTable->numOfRows--;
|
||||||
pthread_mutex_unlock(&pTable->mutex);
|
pthread_mutex_unlock(&pTable->mutex);
|
||||||
|
|
||||||
sdbTrace("table:%s, delete record:%s from hash, numOfRows:%d" PRId64 "version:%" PRIu64, pTable->tableName,
|
sdbTrace("table:%s, delete record:%s from hash, numOfRows:%" PRId64 "version:%" PRIu64, pTable->tableName,
|
||||||
sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion());
|
sdbGetKeyStrFromObj(pTable, pOper->pObj), pTable->numOfRows, sdbGetVersion());
|
||||||
|
|
||||||
int8_t *updateEnd = pOper->pObj + pTable->refCountPos - 1;
|
int8_t *updateEnd = pOper->pObj + pTable->refCountPos - 1;
|
||||||
|
|
|
@ -4470,7 +4470,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
|
||||||
|
|
||||||
// query error occurred or query is killed, abort current execution
|
// query error occurred or query is killed, abort current execution
|
||||||
if (pQInfo->code != TSDB_CODE_SUCCESS || isQueryKilled(pQInfo)) {
|
if (pQInfo->code != TSDB_CODE_SUCCESS || isQueryKilled(pQInfo)) {
|
||||||
qTrace("QInfo:%p query killed or error occurred, code:%d, abort", pQInfo, pQInfo->code);
|
qTrace("QInfo:%p query killed or error occurred, code:%s, abort", pQInfo, tstrerror(pQInfo->code));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4491,7 +4491,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
|
||||||
setQueryStatus(pQuery, QUERY_COMPLETED);
|
setQueryStatus(pQuery, QUERY_COMPLETED);
|
||||||
|
|
||||||
if (pQInfo->code != TSDB_CODE_SUCCESS || isQueryKilled(pQInfo)) {
|
if (pQInfo->code != TSDB_CODE_SUCCESS || isQueryKilled(pQInfo)) {
|
||||||
qTrace("QInfo:%p query killed or error occurred, code:%d, abort", pQInfo, pQInfo->code);
|
qTrace("QInfo:%p query killed or error occurred, code:%s, abort", pQInfo, tstrerror(pQInfo->code));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5851,6 +5851,8 @@ void qDestroyQueryInfo(qinfo_t qHandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t ref = T_REF_DEC(pQInfo);
|
int16_t ref = T_REF_DEC(pQInfo);
|
||||||
|
qTrace("QInfo:%p dec refCount, value:%d", pQInfo, ref);
|
||||||
|
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
doDestoryQueryInfo(pQInfo);
|
doDestoryQueryInfo(pQInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,7 +393,6 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
|
||||||
if ( pConn->inType == 0 || pConn->user[0] == 0 ) {
|
if ( pConn->inType == 0 || pConn->user[0] == 0 ) {
|
||||||
tTrace("%s, connection is already released, rsp wont be sent", pConn->info);
|
tTrace("%s, connection is already released, rsp wont be sent", pConn->info);
|
||||||
rpcUnlockConn(pConn);
|
rpcUnlockConn(pConn);
|
||||||
rpcDecRef(pRpc);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,12 +486,19 @@ void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pMsg, SRpcMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
// this API is used by server app to keep an APP context in case connection is broken
|
// this API is used by server app to keep an APP context in case connection is broken
|
||||||
void rpcReportProgress(void *handle, char *pCont, int contLen) {
|
int rpcReportProgress(void *handle, char *pCont, int contLen) {
|
||||||
SRpcConn *pConn = (SRpcConn *)handle;
|
SRpcConn *pConn = (SRpcConn *)handle;
|
||||||
|
|
||||||
|
if (pConn->user[0]) {
|
||||||
// pReqMsg and reqMsgLen is re-used to store the context from app server
|
// pReqMsg and reqMsgLen is re-used to store the context from app server
|
||||||
pConn->pReqMsg = pCont;
|
pConn->pReqMsg = pCont;
|
||||||
pConn->reqMsgLen = contLen;
|
pConn->reqMsgLen = contLen;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tTrace("%s, rpc connection is already released", pConn->info);
|
||||||
|
rpcFreeCont(pCont);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rpcFreeMsg(void *msg) {
|
static void rpcFreeMsg(void *msg) {
|
||||||
|
|
|
@ -68,6 +68,7 @@ static void vnodeNotifyCurrentQhandle(void* handle, void* qhandle, int32_t vgId)
|
||||||
killQueryMsg->header.vgId = htonl(vgId);
|
killQueryMsg->header.vgId = htonl(vgId);
|
||||||
killQueryMsg->header.contLen = htonl(sizeof(SRetrieveTableMsg));
|
killQueryMsg->header.contLen = htonl(sizeof(SRetrieveTableMsg));
|
||||||
|
|
||||||
|
vTrace("QInfo:%p register qhandle to connect:%p", qhandle, handle);
|
||||||
rpcReportProgress(handle, (char*) killQueryMsg, sizeof(SRetrieveTableMsg));
|
rpcReportProgress(handle, (char*) killQueryMsg, sizeof(SRetrieveTableMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,10 +86,11 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
|
||||||
killQueryMsg->free = htons(killQueryMsg->free);
|
killQueryMsg->free = htons(killQueryMsg->free);
|
||||||
killQueryMsg->qhandle = htobe64(killQueryMsg->qhandle);
|
killQueryMsg->qhandle = htobe64(killQueryMsg->qhandle);
|
||||||
|
|
||||||
|
vWarn("QInfo:%p connection %p broken, kill query", killQueryMsg->qhandle, pReadMsg->rpcMsg.handle);
|
||||||
assert(pReadMsg->rpcMsg.contLen > 0 && killQueryMsg->free == 1);
|
assert(pReadMsg->rpcMsg.contLen > 0 && killQueryMsg->free == 1);
|
||||||
qDestroyQueryInfo((qinfo_t) killQueryMsg->qhandle);
|
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
qKillQuery((qinfo_t) killQueryMsg->qhandle);
|
||||||
|
return TSDB_CODE_TSC_QUERY_CANCELLED; // todo change the error code
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -51,7 +51,7 @@ system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 10000
|
$totalTableNum = 10
|
||||||
$sleepTimer = 10000
|
$sleepTimer = 10000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -192,7 +192,7 @@ if $data00 != $totalRows then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
||||||
print ============== step4: stop dnode2 for checking if sync success
|
print ============== step4: stop dnode2 for checking if sync ok
|
||||||
system sh/exec.sh -n dnode2 -s stop
|
system sh/exec.sh -n dnode2 -s stop
|
||||||
sleep $sleepTimer
|
sleep $sleepTimer
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 1000
|
$totalTableNum = 10
|
||||||
$sleepTimer = 10000
|
$sleepTimer = 10000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -173,7 +173,7 @@ if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should success
|
print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should ok
|
||||||
system sh/exec.sh -n dnode4 -s stop
|
system sh/exec.sh -n dnode4 -s stop
|
||||||
system rm -rf ../../../sim/dnode4
|
system rm -rf ../../../sim/dnode4
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
#sql create dnode $hostname4
|
#sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -177,7 +177,7 @@ if $data00 != $totalRows then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step5: stop dnode2, and check if dnode3 sync success
|
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep $sleepTimer
|
sleep $sleepTimer
|
||||||
wait_dnode2_offline_0:
|
wait_dnode2_offline_0:
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
#sql create dnode $hostname4
|
#sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -105,7 +105,7 @@ if $data00 != $totalRows then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step5: stop dnode2, and check if dnode3 sync success
|
print ============== step5: stop dnode2, and check if dnode3 sync ok
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep $sleepTimer
|
sleep $sleepTimer
|
||||||
wait_dnode2_offline_0:
|
wait_dnode2_offline_0:
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -55,7 +55,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -152,7 +152,7 @@ print ============== step4: restart dnode2, then create database with replica 2,
|
||||||
system sh/exec.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db1
|
$db = db1
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname2
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -67,7 +67,7 @@ sql use $db
|
||||||
|
|
||||||
# create table , insert data
|
# create table , insert data
|
||||||
$stb = stb
|
$stb = stb
|
||||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
|
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int)
|
||||||
$rowNum = 500
|
$rowNum = 500
|
||||||
$tblNum = $totalTableNum
|
$tblNum = $totalTableNum
|
||||||
$totalRows = 0
|
$totalRows = 0
|
||||||
|
@ -77,7 +77,7 @@ $tsEnd = 0
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < $tblNum
|
while $i < $tblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql create table $tb using $stb tags( $i )
|
sql create table $tb using $stb tags( $i , $i )
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
|
@ -164,7 +164,7 @@ $totalRows = 0
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < $tblNum
|
while $i < $tblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql create table $tb using $stb tags( $i , $i )
|
sql create table $tb using $stb tags( $i , $i , $i )
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname2
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$maxTables = $totalTableNum * 2
|
$maxTables = $totalTableNum * 2
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname2
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname2
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -146,14 +146,14 @@ endi
|
||||||
|
|
||||||
print ============== step4: drop some tables
|
print ============== step4: drop some tables
|
||||||
$i = 1
|
$i = 1
|
||||||
$dropTblNum = 21
|
$dropTblNum = 6
|
||||||
|
|
||||||
while $i < $dropTblNum
|
while $i < $dropTblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql drop table if exists $tb
|
sql drop table if exists $tb
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
$tblNum = $tblNum - 20
|
$tblNum = $tblNum - 5
|
||||||
|
|
||||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||||
system sh/exec.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -67,7 +67,7 @@ sql use $db
|
||||||
|
|
||||||
# create table , insert data
|
# create table , insert data
|
||||||
$stb = stb
|
$stb = stb
|
||||||
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int)
|
sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int)
|
||||||
$rowNum = 500
|
$rowNum = 500
|
||||||
$tblNum = $totalTableNum
|
$tblNum = $totalTableNum
|
||||||
$totalRows = 0
|
$totalRows = 0
|
||||||
|
@ -77,7 +77,7 @@ $tsEnd = 0
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < $tblNum
|
while $i < $tblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql create table $tb using $stb tags( $i )
|
sql create table $tb using $stb tags( $i , $i )
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
|
@ -164,7 +164,7 @@ $totalRows = 0
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < $tblNum
|
while $i < $tblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql create table $tb using $stb tags( $i , $i )
|
sql create table $tb using $stb tags( $i , $i , $i )
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
$maxTables = $totalTableNum * 2
|
$maxTables = $totalTableNum * 2
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
|
|
@ -56,7 +56,7 @@ sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
$totalTableNum = 100
|
$totalTableNum = 10
|
||||||
$sleepTimer = 3000
|
$sleepTimer = 3000
|
||||||
|
|
||||||
$db = db
|
$db = db
|
||||||
|
@ -146,14 +146,14 @@ endi
|
||||||
|
|
||||||
print ============== step4: drop some tables
|
print ============== step4: drop some tables
|
||||||
$i = 1
|
$i = 1
|
||||||
$dropTblNum = 21
|
$dropTblNum = 6
|
||||||
|
|
||||||
while $i < $dropTblNum
|
while $i < $dropTblNum
|
||||||
$tb = tb . $i
|
$tb = tb . $i
|
||||||
sql drop table if exists $tb
|
sql drop table if exists $tb
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
$tblNum = $tblNum - 20
|
$tblNum = $tblNum - 5
|
||||||
|
|
||||||
print ============== step5: restart dnode4, waiting dnode4 synced
|
print ============== step5: restart dnode4, waiting dnode4 synced
|
||||||
system sh/exec.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
Loading…
Reference in New Issue