Merge branch '3.0' into fix/TD-17934
This commit is contained in:
commit
cd0175ab27
|
@ -2,7 +2,7 @@
|
||||||
# zlib
|
# zlib
|
||||||
ExternalProject_Add(taos-tools
|
ExternalProject_Add(taos-tools
|
||||||
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
||||||
GIT_TAG 817cb6a
|
GIT_TAG 2.1.1
|
||||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
||||||
BINARY_DIR ""
|
BINARY_DIR ""
|
||||||
#BUILD_IN_SOURCE TRUE
|
#BUILD_IN_SOURCE TRUE
|
||||||
|
|
|
@ -1067,8 +1067,10 @@ SELECT DERIVATIVE(field_name, time_interval, ignore_negative) FROM tb_name [WHER
|
||||||
|
|
||||||
**适用于**:表和超级表。
|
**适用于**:表和超级表。
|
||||||
|
|
||||||
**使用说明**: DERIVATIVE 函数可以在由 PARTITION BY 划分出单独时间线的情况下用于超级表(也即 PARTITION BY tbname)。
|
**使用说明**:
|
||||||
|
|
||||||
|
- DERIVATIVE 函数可以在由 PARTITION BY 划分出单独时间线的情况下用于超级表(也即 PARTITION BY tbname)。
|
||||||
|
- 可以与选择相关联的列一起使用。 例如: select \_rowts, DERIVATIVE() from。
|
||||||
|
|
||||||
### DIFF
|
### DIFF
|
||||||
|
|
||||||
|
@ -1084,7 +1086,10 @@ SELECT {DIFF(field_name, ignore_negative) | DIFF(field_name)} FROM tb_name [WHER
|
||||||
|
|
||||||
**适用于**:表和超级表。
|
**适用于**:表和超级表。
|
||||||
|
|
||||||
**使用说明**: 输出结果行数是范围内总行数减一,第一行没有结果输出。
|
**使用说明**:
|
||||||
|
|
||||||
|
- 输出结果行数是范围内总行数减一,第一行没有结果输出。
|
||||||
|
- 可以与选择相关联的列一起使用。 例如: select \_rowts, DIFF() from。
|
||||||
|
|
||||||
|
|
||||||
### IRATE
|
### IRATE
|
||||||
|
|
|
@ -413,7 +413,7 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
SyncClientRequestBatch *pSyncMsg = syncClientRequestBatchFromRpcMsg(pMsg);
|
SyncClientRequestBatch *pSyncMsg = syncClientRequestBatchFromRpcMsg(pMsg);
|
||||||
ASSERT(pSyncMsg != NULL);
|
ASSERT(pSyncMsg != NULL);
|
||||||
code = syncNodeOnClientRequestBatchCb(pSyncNode, pSyncMsg);
|
code = syncNodeOnClientRequestBatchCb(pSyncNode, pSyncMsg);
|
||||||
syncClientRequestBatchDestroyDeep(pSyncMsg);
|
syncClientRequestBatchDestroy(pSyncMsg);
|
||||||
} else if (pMsg->msgType == TDMT_SYNC_REQUEST_VOTE) {
|
} else if (pMsg->msgType == TDMT_SYNC_REQUEST_VOTE) {
|
||||||
SyncRequestVote *pSyncMsg = syncRequestVoteFromRpcMsg2(pMsg);
|
SyncRequestVote *pSyncMsg = syncRequestVoteFromRpcMsg2(pMsg);
|
||||||
ASSERT(pSyncMsg != NULL);
|
ASSERT(pSyncMsg != NULL);
|
||||||
|
|
|
@ -2271,7 +2271,7 @@ static int32_t tagScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubp
|
||||||
FOREACH(pAggTarget, pAgg->pTargets) {
|
FOREACH(pAggTarget, pAgg->pTargets) {
|
||||||
SNode* pScanTarget = NULL;
|
SNode* pScanTarget = NULL;
|
||||||
FOREACH(pScanTarget, pScanNode->node.pTargets) {
|
FOREACH(pScanTarget, pScanNode->node.pTargets) {
|
||||||
if (0 == strcmp(((SColumnNode*)pAggTarget)->colName, ((SColumnNode*)pAggTarget)->colName)) {
|
if (0 == strcmp(((SColumnNode*)pAggTarget)->colName, ((SColumnNode*)pScanTarget)->colName)) {
|
||||||
nodesListAppend(pScanTargets, nodesCloneNode(pScanTarget));
|
nodesListAppend(pScanTargets, nodesCloneNode(pScanTarget));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -736,6 +736,13 @@ int32_t syncNodeProposeBatch(SSyncNode* pSyncNode, SRpcMsg** pMsgPArr, bool* pIs
|
||||||
|
|
||||||
SRaftMeta raftArr[SYNC_MAX_BATCH_SIZE];
|
SRaftMeta raftArr[SYNC_MAX_BATCH_SIZE];
|
||||||
for (int i = 0; i < arrSize; ++i) {
|
for (int i = 0; i < arrSize; ++i) {
|
||||||
|
do {
|
||||||
|
char eventLog[128];
|
||||||
|
snprintf(eventLog, sizeof(eventLog), "propose type:%s,%d, batch:%d", TMSG_INFO(pMsgPArr[i]->msgType),
|
||||||
|
pMsgPArr[i]->msgType, arrSize);
|
||||||
|
syncNodeEventLog(pSyncNode, eventLog);
|
||||||
|
} while (0);
|
||||||
|
|
||||||
SRespStub stub;
|
SRespStub stub;
|
||||||
stub.createTime = taosGetTimestampMs();
|
stub.createTime = taosGetTimestampMs();
|
||||||
stub.rpcMsg = *(pMsgPArr[i]);
|
stub.rpcMsg = *(pMsgPArr[i]);
|
||||||
|
@ -790,9 +797,11 @@ int32_t syncNodeProposeBatch(SSyncNode* pSyncNode, SRpcMsg** pMsgPArr, bool* pIs
|
||||||
int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) {
|
int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) {
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
char eventLog[128];
|
char eventLog[128];
|
||||||
snprintf(eventLog, sizeof(eventLog), "propose type:%s,%d", TMSG_INFO(pMsg->msgType), pMsg->msgType);
|
snprintf(eventLog, sizeof(eventLog), "propose type:%s,%d", TMSG_INFO(pMsg->msgType), pMsg->msgType);
|
||||||
syncNodeEventLog(pSyncNode, eventLog);
|
syncNodeEventLog(pSyncNode, eventLog);
|
||||||
|
} while (0);
|
||||||
|
|
||||||
if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) {
|
if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) {
|
||||||
if (pSyncNode->changing && pMsg->msgType != TDMT_SYNC_CONFIG_CHANGE_FINISH) {
|
if (pSyncNode->changing && pMsg->msgType != TDMT_SYNC_CONFIG_CHANGE_FINISH) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
add_executable(transportTest "")
|
add_executable(transportTest "")
|
||||||
add_executable(transUT "")
|
add_executable(transUT "")
|
||||||
add_executable(pushServer "")
|
add_executable(svrBench "")
|
||||||
|
add_executable(cliBench "")
|
||||||
|
|
||||||
target_sources(transUT
|
target_sources(transUT
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
@ -12,9 +13,13 @@ target_sources(transportTest
|
||||||
"transportTests.cpp"
|
"transportTests.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(pushServer
|
target_sources(svrBench
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"pushServer.c"
|
"svrBench.c"
|
||||||
|
)
|
||||||
|
target_sources(cliBench
|
||||||
|
PRIVATE
|
||||||
|
"cliBench.c"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(transportTest
|
target_include_directories(transportTest
|
||||||
|
@ -45,13 +50,37 @@ target_include_directories(transUT
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(pushServer
|
target_include_directories(svrBench
|
||||||
|
PUBLIC
|
||||||
|
"${TD_SOURCE_DIR}/include/libs/transport"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
||||||
|
)
|
||||||
|
target_include_directories(svrBench
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"${TD_SOURCE_DIR}/include/libs/transport"
|
"${TD_SOURCE_DIR}/include/libs/transport"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries (pushServer
|
target_link_libraries (svrBench
|
||||||
|
os
|
||||||
|
util
|
||||||
|
common
|
||||||
|
gtest_main
|
||||||
|
transport
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(cliBench
|
||||||
|
PUBLIC
|
||||||
|
"${TD_SOURCE_DIR}/include/libs/transport"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
||||||
|
)
|
||||||
|
target_include_directories(cliBench
|
||||||
|
PUBLIC
|
||||||
|
"${TD_SOURCE_DIR}/include/libs/transport"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries (cliBench
|
||||||
os
|
os
|
||||||
util
|
util
|
||||||
common
|
common
|
||||||
|
|
|
@ -0,0 +1,182 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can use, redistribute, and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License, version 3
|
||||||
|
* or later ("AGPL"), as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "os.h"
|
||||||
|
#include "taoserror.h"
|
||||||
|
#include "tglobal.h"
|
||||||
|
#include "transLog.h"
|
||||||
|
#include "trpc.h"
|
||||||
|
#include "tutil.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int index;
|
||||||
|
SEpSet epSet;
|
||||||
|
int num;
|
||||||
|
int numOfReqs;
|
||||||
|
int msgSize;
|
||||||
|
tsem_t rspSem;
|
||||||
|
tsem_t *pOverSem;
|
||||||
|
TdThread thread;
|
||||||
|
void *pRpc;
|
||||||
|
} SInfo;
|
||||||
|
|
||||||
|
static void processResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||||
|
SInfo *pInfo = (SInfo *)pMsg->info.ahandle;
|
||||||
|
tDebug("thread:%d, response is received, type:%d contLen:%d code:0x%x", pInfo->index, pMsg->msgType, pMsg->contLen,
|
||||||
|
pMsg->code);
|
||||||
|
|
||||||
|
if (pEpSet) pInfo->epSet = *pEpSet;
|
||||||
|
|
||||||
|
rpcFreeCont(pMsg->pCont);
|
||||||
|
tsem_post(&pInfo->rspSem);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tcount = 0;
|
||||||
|
|
||||||
|
static void *sendRequest(void *param) {
|
||||||
|
SInfo *pInfo = (SInfo *)param;
|
||||||
|
SRpcMsg rpcMsg = {0};
|
||||||
|
|
||||||
|
tDebug("thread:%d, start to send request", pInfo->index);
|
||||||
|
|
||||||
|
while (pInfo->numOfReqs == 0 || pInfo->num < pInfo->numOfReqs) {
|
||||||
|
pInfo->num++;
|
||||||
|
rpcMsg.pCont = rpcMallocCont(pInfo->msgSize);
|
||||||
|
rpcMsg.contLen = pInfo->msgSize;
|
||||||
|
rpcMsg.info.ahandle = pInfo;
|
||||||
|
rpcMsg.msgType = 1;
|
||||||
|
tDebug("thread:%d, send request, contLen:%d num:%d", pInfo->index, pInfo->msgSize, pInfo->num);
|
||||||
|
rpcSendRequest(pInfo->pRpc, &pInfo->epSet, &rpcMsg, NULL);
|
||||||
|
if (pInfo->num % 20000 == 0) tInfo("thread:%d, %d requests have been sent", pInfo->index, pInfo->num);
|
||||||
|
tsem_wait(&pInfo->rspSem);
|
||||||
|
}
|
||||||
|
|
||||||
|
tDebug("thread:%d, it is over", pInfo->index);
|
||||||
|
tcount++;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
SRpcInit rpcInit;
|
||||||
|
SEpSet epSet;
|
||||||
|
int msgSize = 128;
|
||||||
|
int numOfReqs = 0;
|
||||||
|
int appThreads = 1;
|
||||||
|
char serverIp[40] = "127.0.0.1";
|
||||||
|
struct timeval systemTime;
|
||||||
|
int64_t startTime, endTime;
|
||||||
|
|
||||||
|
// server info
|
||||||
|
epSet.numOfEps = 1;
|
||||||
|
epSet.inUse = 0;
|
||||||
|
epSet.eps[0].port = 7000;
|
||||||
|
epSet.eps[1].port = 7000;
|
||||||
|
strcpy(epSet.eps[0].fqdn, serverIp);
|
||||||
|
strcpy(epSet.eps[1].fqdn, "192.168.0.1");
|
||||||
|
|
||||||
|
// client info
|
||||||
|
memset(&rpcInit, 0, sizeof(rpcInit));
|
||||||
|
rpcInit.localPort = 0;
|
||||||
|
rpcInit.label = "APP";
|
||||||
|
rpcInit.numOfThreads = 1;
|
||||||
|
rpcInit.cfp = processResponse;
|
||||||
|
rpcInit.sessions = 100;
|
||||||
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
|
rpcInit.user = "michael";
|
||||||
|
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||||
|
|
||||||
|
rpcDebugFlag = 131;
|
||||||
|
for (int i = 1; i < argc; ++i) {
|
||||||
|
if (strcmp(argv[i], "-p") == 0 && i < argc - 1) {
|
||||||
|
} else if (strcmp(argv[i], "-i") == 0 && i < argc - 1) {
|
||||||
|
} else if (strcmp(argv[i], "-t") == 0 && i < argc - 1) {
|
||||||
|
rpcInit.numOfThreads = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-m") == 0 && i < argc - 1) {
|
||||||
|
msgSize = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-s") == 0 && i < argc - 1) {
|
||||||
|
rpcInit.sessions = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-n") == 0 && i < argc - 1) {
|
||||||
|
numOfReqs = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-a") == 0 && i < argc - 1) {
|
||||||
|
appThreads = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-o") == 0 && i < argc - 1) {
|
||||||
|
tsCompressMsgSize = atoi(argv[++i]);
|
||||||
|
} else if (strcmp(argv[i], "-u") == 0 && i < argc - 1) {
|
||||||
|
} else if (strcmp(argv[i], "-k") == 0 && i < argc - 1) {
|
||||||
|
} else if (strcmp(argv[i], "-spi") == 0 && i < argc - 1) {
|
||||||
|
} else if (strcmp(argv[i], "-d") == 0 && i < argc - 1) {
|
||||||
|
rpcDebugFlag = atoi(argv[++i]);
|
||||||
|
} else {
|
||||||
|
printf("\nusage: %s [options] \n", argv[0]);
|
||||||
|
printf(" [-i ip]: first server IP address, default is:%s\n", serverIp);
|
||||||
|
printf(" [-t threads]: number of rpc threads, default is:%d\n", rpcInit.numOfThreads);
|
||||||
|
printf(" [-m msgSize]: message body size, default is:%d\n", msgSize);
|
||||||
|
printf(" [-a threads]: number of app threads, default is:%d\n", appThreads);
|
||||||
|
printf(" [-n requests]: number of requests per thread, default is:%d\n", numOfReqs);
|
||||||
|
printf(" [-u user]: user name for the connection, default is:%s\n", rpcInit.user);
|
||||||
|
printf(" [-d debugFlag]: debug flag, default:%d\n", rpcDebugFlag);
|
||||||
|
printf(" [-h help]: print out this help\n\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
taosInitLog("client.log", 100000);
|
||||||
|
|
||||||
|
void *pRpc = rpcOpen(&rpcInit);
|
||||||
|
if (pRpc == NULL) {
|
||||||
|
tError("failed to initialize RPC");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tInfo("client is initialized");
|
||||||
|
tInfo("threads:%d msgSize:%d requests:%d", appThreads, msgSize, numOfReqs);
|
||||||
|
|
||||||
|
int64_t now = taosGetTimestampUs();
|
||||||
|
|
||||||
|
SInfo *pInfo = (SInfo *)taosMemoryCalloc(1, sizeof(SInfo) * appThreads);
|
||||||
|
SInfo *p = pInfo;
|
||||||
|
for (int i = 0; i < appThreads; ++i) {
|
||||||
|
pInfo->index = i;
|
||||||
|
pInfo->epSet = epSet;
|
||||||
|
pInfo->numOfReqs = numOfReqs;
|
||||||
|
pInfo->msgSize = msgSize;
|
||||||
|
tsem_init(&pInfo->rspSem, 0, 0);
|
||||||
|
pInfo->pRpc = pRpc;
|
||||||
|
|
||||||
|
taosThreadCreate(&pInfo->thread, NULL, sendRequest, pInfo);
|
||||||
|
pInfo++;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
taosUsleep(1);
|
||||||
|
} while (tcount < appThreads);
|
||||||
|
|
||||||
|
float usedTime = (taosGetTimestampUs() - now) / 1000.0f;
|
||||||
|
|
||||||
|
tInfo("it takes %.3f mseconds to send %d requests to server", usedTime, numOfReqs * appThreads);
|
||||||
|
tInfo("Performance: %.3f requests per second, msgSize:%d bytes", 1000.0 * numOfReqs * appThreads / usedTime, msgSize);
|
||||||
|
|
||||||
|
for (int i = 0; i < appThreads; i++) {
|
||||||
|
SInfo *pInfo = p;
|
||||||
|
taosThreadJoin(pInfo->thread, NULL);
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
int ch = getchar();
|
||||||
|
UNUSED(ch);
|
||||||
|
|
||||||
|
taosCloseLog();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -24,12 +24,12 @@ int msgSize = 128;
|
||||||
int commit = 0;
|
int commit = 0;
|
||||||
TdFilePtr pDataFile = NULL;
|
TdFilePtr pDataFile = NULL;
|
||||||
STaosQueue *qhandle = NULL;
|
STaosQueue *qhandle = NULL;
|
||||||
STaosQset * qset = NULL;
|
STaosQset *qset = NULL;
|
||||||
|
|
||||||
void processShellMsg() {
|
void processShellMsg() {
|
||||||
static int num = 0;
|
static int num = 0;
|
||||||
STaosQall *qall;
|
STaosQall *qall;
|
||||||
SRpcMsg * pRpcMsg, rpcMsg;
|
SRpcMsg *pRpcMsg, rpcMsg;
|
||||||
int type;
|
int type;
|
||||||
SQueueInfo qinfo = {0};
|
SQueueInfo qinfo = {0};
|
||||||
|
|
||||||
|
@ -77,7 +77,6 @@ void processShellMsg() {
|
||||||
taosFreeQitem(pRpcMsg);
|
taosFreeQitem(pRpcMsg);
|
||||||
|
|
||||||
{
|
{
|
||||||
// taosSsleep(1);
|
|
||||||
SRpcMsg nRpcMsg = {0};
|
SRpcMsg nRpcMsg = {0};
|
||||||
nRpcMsg.pCont = rpcMallocCont(msgSize);
|
nRpcMsg.pCont = rpcMallocCont(msgSize);
|
||||||
nRpcMsg.contLen = msgSize;
|
nRpcMsg.contLen = msgSize;
|
||||||
|
@ -93,26 +92,6 @@ void processShellMsg() {
|
||||||
taosFreeQall(qall);
|
taosFreeQall(qall);
|
||||||
}
|
}
|
||||||
|
|
||||||
int retrieveAuthInfo(void *parent, char *meterId, char *spi, char *encrypt, char *secret, char *ckey) {
|
|
||||||
// app shall retrieve the auth info based on meterID from DB or a data file
|
|
||||||
// demo code here only for simple demo
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (strcmp(meterId, "michael") == 0) {
|
|
||||||
*spi = 1;
|
|
||||||
*encrypt = 0;
|
|
||||||
strcpy(secret, "mypassword");
|
|
||||||
strcpy(ckey, "key");
|
|
||||||
} else if (strcmp(meterId, "jeff") == 0) {
|
|
||||||
*spi = 0;
|
|
||||||
*encrypt = 0;
|
|
||||||
} else {
|
|
||||||
ret = -1; // user not there
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void processRequestMsg(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
void processRequestMsg(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||||
SRpcMsg *pTemp;
|
SRpcMsg *pTemp;
|
||||||
|
|
||||||
|
@ -131,11 +110,12 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
memset(&rpcInit, 0, sizeof(rpcInit));
|
memset(&rpcInit, 0, sizeof(rpcInit));
|
||||||
rpcInit.localPort = 7000;
|
rpcInit.localPort = 7000;
|
||||||
|
memcpy(rpcInit.localFqdn, "localhost", strlen("localhost"));
|
||||||
rpcInit.label = "SER";
|
rpcInit.label = "SER";
|
||||||
rpcInit.numOfThreads = 1;
|
rpcInit.numOfThreads = 1;
|
||||||
rpcInit.cfp = processRequestMsg;
|
rpcInit.cfp = processRequestMsg;
|
||||||
rpcInit.sessions = 1000;
|
|
||||||
rpcInit.idleTime = 2 * 1500;
|
rpcInit.idleTime = 2 * 1500;
|
||||||
|
rpcDebugFlag = 131;
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
if (strcmp(argv[i], "-p") == 0 && i < argc - 1) {
|
if (strcmp(argv[i], "-p") == 0 && i < argc - 1) {
|
||||||
|
@ -170,7 +150,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
tsAsyncLog = 0;
|
tsAsyncLog = 0;
|
||||||
rpcInit.connType = TAOS_CONN_SERVER;
|
rpcInit.connType = TAOS_CONN_SERVER;
|
||||||
taosInitLog("server.log", 10);
|
taosInitLog("server.log", 100000);
|
||||||
|
|
||||||
void *pRpc = rpcOpen(&rpcInit);
|
void *pRpc = rpcOpen(&rpcInit);
|
||||||
if (pRpc == NULL) {
|
if (pRpc == NULL) {
|
|
@ -16,8 +16,8 @@
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "tlog.h"
|
#include "tlog.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "tutil.h"
|
|
||||||
#include "tconfig.h"
|
#include "tconfig.h"
|
||||||
|
#include "tutil.h"
|
||||||
|
|
||||||
#define LOG_MAX_LINE_SIZE (1024)
|
#define LOG_MAX_LINE_SIZE (1024)
|
||||||
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 3)
|
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 3)
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
#define LOG_BUF_MUTEX(x) ((x)->buffMutex)
|
#define LOG_BUF_MUTEX(x) ((x)->buffMutex)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char * buffer;
|
char *buffer;
|
||||||
int32_t buffStart;
|
int32_t buffStart;
|
||||||
int32_t buffEnd;
|
int32_t buffEnd;
|
||||||
int32_t buffSize;
|
int32_t buffSize;
|
||||||
|
@ -59,7 +59,7 @@ typedef struct {
|
||||||
int32_t openInProgress;
|
int32_t openInProgress;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
char logName[LOG_FILE_NAME_LEN];
|
char logName[LOG_FILE_NAME_LEN];
|
||||||
SLogBuff * logHandle;
|
SLogBuff *logHandle;
|
||||||
TdThreadMutex logMutex;
|
TdThreadMutex logMutex;
|
||||||
} SLogObj;
|
} SLogObj;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ int64_t dbgSmallWN = 0;
|
||||||
int64_t dbgBigWN = 0;
|
int64_t dbgBigWN = 0;
|
||||||
int64_t dbgWSize = 0;
|
int64_t dbgWSize = 0;
|
||||||
|
|
||||||
static void * taosAsyncOutputLog(void *param);
|
static void *taosAsyncOutputLog(void *param);
|
||||||
static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msgLen);
|
static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msgLen);
|
||||||
static SLogBuff *taosLogBuffNew(int32_t bufSize);
|
static SLogBuff *taosLogBuffNew(int32_t bufSize);
|
||||||
static void taosCloseLogByFd(TdFilePtr pFile);
|
static void taosCloseLogByFd(TdFilePtr pFile);
|
||||||
|
@ -128,7 +128,11 @@ int32_t taosInitLog(const char *logName, int32_t maxFiles) {
|
||||||
osUpdate();
|
osUpdate();
|
||||||
|
|
||||||
char fullName[PATH_MAX] = {0};
|
char fullName[PATH_MAX] = {0};
|
||||||
|
if (strlen(tsLogDir) != 0) {
|
||||||
snprintf(fullName, PATH_MAX, "%s" TD_DIRSEP "%s", tsLogDir, logName);
|
snprintf(fullName, PATH_MAX, "%s" TD_DIRSEP "%s", tsLogDir, logName);
|
||||||
|
} else {
|
||||||
|
snprintf(fullName, PATH_MAX, "%s", logName);
|
||||||
|
}
|
||||||
|
|
||||||
tsLogObj.logHandle = taosLogBuffNew(LOG_DEFAULT_BUF_SIZE);
|
tsLogObj.logHandle = taosLogBuffNew(LOG_DEFAULT_BUF_SIZE);
|
||||||
if (tsLogObj.logHandle == NULL) return -1;
|
if (tsLogObj.logHandle == NULL) return -1;
|
||||||
|
@ -704,7 +708,7 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
|
||||||
int32_t compressSize = 163840;
|
int32_t compressSize = 163840;
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
int32_t len = 0;
|
int32_t len = 0;
|
||||||
char * data = taosMemoryMalloc(compressSize);
|
char *data = taosMemoryMalloc(compressSize);
|
||||||
// gzFile dstFp = NULL;
|
// gzFile dstFp = NULL;
|
||||||
|
|
||||||
// srcFp = fopen(srcFileName, "r");
|
// srcFp = fopen(srcFileName, "r");
|
||||||
|
|
|
@ -489,7 +489,7 @@ class TDDnode:
|
||||||
onlyKillOnceWindows = 0
|
onlyKillOnceWindows = 0
|
||||||
while(processID):
|
while(processID):
|
||||||
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
|
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
|
||||||
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
|
killCmd = "kill -4 %s > /dev/null 2>&1" % processID
|
||||||
os.system(killCmd)
|
os.system(killCmd)
|
||||||
onlyKillOnceWindows = 1
|
onlyKillOnceWindows = 1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
@ -503,7 +503,7 @@ class TDDnode:
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
self.running = 0
|
self.running = 0
|
||||||
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
|
tdLog.debug("dnode:%d is stopped by kill -4" % (self.index))
|
||||||
|
|
||||||
|
|
||||||
def stoptaosd(self):
|
def stoptaosd(self):
|
||||||
|
@ -527,7 +527,7 @@ class TDDnode:
|
||||||
onlyKillOnceWindows = 0
|
onlyKillOnceWindows = 0
|
||||||
while(processID):
|
while(processID):
|
||||||
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
|
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
|
||||||
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
|
killCmd = "kill -4 %s > /dev/null 2>&1" % processID
|
||||||
os.system(killCmd)
|
os.system(killCmd)
|
||||||
onlyKillOnceWindows = 1
|
onlyKillOnceWindows = 1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
@ -537,7 +537,7 @@ class TDDnode:
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
self.running = 0
|
self.running = 0
|
||||||
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
|
tdLog.debug("dnode:%d is stopped by kill -4" % (self.index))
|
||||||
|
|
||||||
def forcestop(self):
|
def forcestop(self):
|
||||||
if (not self.remoteIP == ""):
|
if (not self.remoteIP == ""):
|
||||||
|
|
|
@ -325,7 +325,7 @@
|
||||||
|
|
||||||
# --- sync
|
# --- sync
|
||||||
./test.sh -f tsim/sync/3Replica1VgElect.sim
|
./test.sh -f tsim/sync/3Replica1VgElect.sim
|
||||||
./test.sh -f tsim/sync/3Replica5VgElect.sim
|
#./test.sh -f tsim/sync/3Replica5VgElect.sim
|
||||||
./test.sh -f tsim/sync/oneReplica1VgElect.sim
|
./test.sh -f tsim/sync/oneReplica1VgElect.sim
|
||||||
./test.sh -f tsim/sync/oneReplica5VgElect.sim
|
./test.sh -f tsim/sync/oneReplica5VgElect.sim
|
||||||
|
|
||||||
|
|
|
@ -360,8 +360,9 @@ endi
|
||||||
if $data04 != @abc0@ then
|
if $data04 != @abc0@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
print "really this line"
|
||||||
sql select distinct tbname,t1,t2 from select_tags_mt0;
|
sql select distinct tbname,t1,t2 from select_tags_mt0 order by tbname;
|
||||||
|
print $data00 $data01 $data02 $data10 $data111 $data12
|
||||||
if $row != 16 then
|
if $row != 16 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
@ -390,7 +391,7 @@ if $data12 != @abc1@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select tbname,ts from select_tags_mt0;
|
sql select tbname,ts from select_tags_mt0 order by ts;
|
||||||
if $row != 12800 then
|
if $row != 12800 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
|
@ -0,0 +1,246 @@
|
||||||
|
from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
|
||||||
|
from numpy import row_stack
|
||||||
|
import taos
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
from util.log import *
|
||||||
|
from util.sql import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.dnodes import TDDnodes
|
||||||
|
from util.dnodes import TDDnode
|
||||||
|
from util.cluster import *
|
||||||
|
sys.path.append("./6-cluster")
|
||||||
|
from clusterCommonCreate import *
|
||||||
|
from clusterCommonCheck import clusterComCheck
|
||||||
|
|
||||||
|
import time
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
from multiprocessing import Process
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
import inspect
|
||||||
|
import ctypes
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
|
||||||
|
def init(self,conn ,logSql):
|
||||||
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
self.TDDnodes = None
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
self.host = socket.gethostname()
|
||||||
|
|
||||||
|
|
||||||
|
def getBuildPath(self):
|
||||||
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
if ("community" in selfPath):
|
||||||
|
projPath = selfPath[:selfPath.find("community")]
|
||||||
|
else:
|
||||||
|
projPath = selfPath[:selfPath.find("tests")]
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(projPath):
|
||||||
|
if ("taosd" in files):
|
||||||
|
rootRealPath = os.path.dirname(os.path.realpath(root))
|
||||||
|
if ("packaging" not in rootRealPath):
|
||||||
|
buildPath = root[:len(root) - len("/build/bin")]
|
||||||
|
break
|
||||||
|
return buildPath
|
||||||
|
|
||||||
|
def _async_raise(self, tid, exctype):
|
||||||
|
"""raises the exception, performs cleanup if needed"""
|
||||||
|
if not inspect.isclass(exctype):
|
||||||
|
exctype = type(exctype)
|
||||||
|
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype))
|
||||||
|
if res == 0:
|
||||||
|
raise ValueError("invalid thread id")
|
||||||
|
elif res != 1:
|
||||||
|
# """if it returns a number greater than one, you're in trouble,
|
||||||
|
# and you should call it again with exc=NULL to revert the effect"""
|
||||||
|
ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None)
|
||||||
|
raise SystemError("PyThreadState_SetAsyncExc failed")
|
||||||
|
|
||||||
|
def stopThread(self,thread):
|
||||||
|
self._async_raise(thread.ident, SystemExit)
|
||||||
|
|
||||||
|
|
||||||
|
def insertData(self,countstart,countstop):
|
||||||
|
# fisrt add data : db\stable\childtable\general table
|
||||||
|
|
||||||
|
for couti in range(countstart,countstop):
|
||||||
|
tdLog.debug("drop database if exists db%d" %couti)
|
||||||
|
tdSql.execute("drop database if exists db%d" %couti)
|
||||||
|
print("create database if not exists db%d replica 1 duration 300" %couti)
|
||||||
|
tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti)
|
||||||
|
tdSql.execute("use db%d" %couti)
|
||||||
|
tdSql.execute(
|
||||||
|
'''create table stb1
|
||||||
|
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
|
||||||
|
tags (t1 int)
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
tdSql.execute(
|
||||||
|
'''
|
||||||
|
create table t1
|
||||||
|
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
for i in range(4):
|
||||||
|
tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )')
|
||||||
|
|
||||||
|
|
||||||
|
def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole):
|
||||||
|
tdLog.printNoPrefix("======== test case 1: ")
|
||||||
|
paraDict = {'dbName': 'db0_0',
|
||||||
|
'dropFlag': 1,
|
||||||
|
'event': '',
|
||||||
|
'vgroups': 4,
|
||||||
|
'replica': 1,
|
||||||
|
'stbName': 'stb',
|
||||||
|
'stbNumbers': 2,
|
||||||
|
'colPrefix': 'c',
|
||||||
|
'tagPrefix': 't',
|
||||||
|
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'ctbPrefix': 'ctb',
|
||||||
|
'ctbNum': 200,
|
||||||
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
|
"rowsPerTbl": 100,
|
||||||
|
"batchNum": 5000
|
||||||
|
}
|
||||||
|
username="user1"
|
||||||
|
passwd="123"
|
||||||
|
|
||||||
|
dnodeNumbers=int(dnodeNumbers)
|
||||||
|
mnodeNums=int(mnodeNums)
|
||||||
|
vnodeNumbers = int(dnodeNumbers-mnodeNums)
|
||||||
|
allctbNumbers=(paraDict['stbNumbers']*paraDict["ctbNum"])
|
||||||
|
rowsPerStb=paraDict["ctbNum"]*paraDict["rowsPerTbl"]
|
||||||
|
rowsall=rowsPerStb*paraDict['stbNumbers']
|
||||||
|
dbNumbers = 1
|
||||||
|
|
||||||
|
tdLog.info("first check dnode and mnode")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
tdSql.checkData(0,1,'%s:6030'%self.host)
|
||||||
|
tdSql.checkData(4,1,'%s:6430'%self.host)
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
clusterComCheck.checkMnodeStatus(1)
|
||||||
|
|
||||||
|
# fisr add three mnodes;
|
||||||
|
tdLog.info("fisr add three mnodes and check mnode status")
|
||||||
|
tdSql.execute("create mnode on dnode 2")
|
||||||
|
clusterComCheck.checkMnodeStatus(2)
|
||||||
|
tdSql.execute("create mnode on dnode 3")
|
||||||
|
clusterComCheck.checkMnodeStatus(3)
|
||||||
|
|
||||||
|
# add some error operations and
|
||||||
|
tdLog.info("Confirm the status of the dnode again")
|
||||||
|
tdSql.error("create mnode on dnode 2")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
print(tdSql.queryResult)
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
|
||||||
|
# recreate mnode
|
||||||
|
tdSql.execute("drop dnode 2;")
|
||||||
|
tdSql.execute('create dnode "%s:6130";'%self.host)
|
||||||
|
tdDnodes=cluster.dnodes
|
||||||
|
tdDnodes[1].stoptaosd()
|
||||||
|
tdDnodes[1].deploy()
|
||||||
|
|
||||||
|
tdDnodes[1].starttaosd()
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
|
||||||
|
tdSql.execute("create mnode on dnode 6")
|
||||||
|
tdSql.error("drop dnode 1;")
|
||||||
|
|
||||||
|
# check status of clusters
|
||||||
|
clusterComCheck.checkMnodeStatus(3)
|
||||||
|
tdSql.execute("create user %s pass '%s' ;"%(username,passwd))
|
||||||
|
tdSql.query("show users")
|
||||||
|
for i in range(tdSql.queryRows):
|
||||||
|
if tdSql.queryResult[i][0] == "%s"%username :
|
||||||
|
tdLog.info("create user:%s successfully"%username)
|
||||||
|
|
||||||
|
# # create database and stable
|
||||||
|
# clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica'])
|
||||||
|
# tdLog.info("Take turns stopping Mnodes ")
|
||||||
|
|
||||||
|
# tdDnodes=cluster.dnodes
|
||||||
|
# stopcount =0
|
||||||
|
# threads=[]
|
||||||
|
|
||||||
|
# # create stable:stb_0
|
||||||
|
# stableName= paraDict['stbName']
|
||||||
|
# newTdSql=tdCom.newTdSql()
|
||||||
|
# clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers'])
|
||||||
|
# #create child table:ctb_0
|
||||||
|
# for i in range(paraDict['stbNumbers']):
|
||||||
|
# stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
# newTdSql=tdCom.newTdSql()
|
||||||
|
# clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum'])
|
||||||
|
# #insert date
|
||||||
|
# for i in range(paraDict['stbNumbers']):
|
||||||
|
# stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
# newTdSql=tdCom.newTdSql()
|
||||||
|
# threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"])))
|
||||||
|
# for tr in threads:
|
||||||
|
# tr.start()
|
||||||
|
# for tr in threads:
|
||||||
|
# tr.join()
|
||||||
|
|
||||||
|
# while stopcount < restartNumbers:
|
||||||
|
# tdLog.info(" restart loop: %d"%stopcount )
|
||||||
|
# if stopRole == "mnode":
|
||||||
|
# for i in range(mnodeNums):
|
||||||
|
# tdDnodes[i].stoptaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
# tdDnodes[i].starttaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
# elif stopRole == "vnode":
|
||||||
|
# for i in range(vnodeNumbers):
|
||||||
|
# tdDnodes[i+mnodeNums].stoptaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
# tdDnodes[i+mnodeNums].starttaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
# elif stopRole == "dnode":
|
||||||
|
# for i in range(dnodeNumbers):
|
||||||
|
# tdDnodes[i].stoptaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
# tdDnodes[i].starttaosd()
|
||||||
|
# # sleep(10)
|
||||||
|
|
||||||
|
# # dnodeNumbers don't include database of schema
|
||||||
|
# if clusterComCheck.checkDnodes(dnodeNumbers):
|
||||||
|
# tdLog.info("dnode is ready")
|
||||||
|
# else:
|
||||||
|
# print("dnodes is not ready")
|
||||||
|
# self.stopThread(threads)
|
||||||
|
# tdLog.exit("one or more of dnodes failed to start ")
|
||||||
|
# # self.check3mnode()
|
||||||
|
# stopcount+=1
|
||||||
|
|
||||||
|
|
||||||
|
# clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
# clusterComCheck.checkDbRows(dbNumbers)
|
||||||
|
# # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"])
|
||||||
|
|
||||||
|
# tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||||
|
# tdSql.query("show stables")
|
||||||
|
# tdSql.checkRows(paraDict["stbNumbers"])
|
||||||
|
# # for i in range(paraDict['stbNumbers']):
|
||||||
|
# # stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
# # tdSql.query("select * from %s"%stableName)
|
||||||
|
# # tdSql.checkRows(rowsPerStb)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# print(self.master_dnode.cfgDict)
|
||||||
|
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=1,stopRole='dnode')
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -190,10 +190,9 @@ class TDTestCase:
|
||||||
|
|
||||||
# dnodeNumbers don't include database of schema
|
# dnodeNumbers don't include database of schema
|
||||||
if clusterComCheck.checkDnodes(dnodeNumbers):
|
if clusterComCheck.checkDnodes(dnodeNumbers):
|
||||||
tdLog.info("123")
|
tdLog.info("dnode is ready")
|
||||||
else:
|
else:
|
||||||
print("456")
|
print("dnodes is not ready")
|
||||||
|
|
||||||
self.stopThread(threads)
|
self.stopThread(threads)
|
||||||
tdLog.exit("one or more of dnodes failed to start ")
|
tdLog.exit("one or more of dnodes failed to start ")
|
||||||
# self.check3mnode()
|
# self.check3mnode()
|
||||||
|
@ -207,10 +206,11 @@ class TDTestCase:
|
||||||
tdSql.execute("use %s" %(paraDict["dbName"]))
|
tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||||
tdSql.query("show stables")
|
tdSql.query("show stables")
|
||||||
tdSql.checkRows(paraDict["stbNumbers"])
|
tdSql.checkRows(paraDict["stbNumbers"])
|
||||||
for i in range(paraDict['stbNumbers']):
|
# for i in range(paraDict['stbNumbers']):
|
||||||
stableName= '%s_%d'%(paraDict['stbName'],i)
|
# stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
tdSql.query("select * from %s"%stableName)
|
# tdSql.query("select * from %s"%stableName)
|
||||||
tdSql.checkRows(rowsPerStb)
|
# tdSql.checkRows(rowsPerStb)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# print(self.master_dnode.cfgDict)
|
# print(self.master_dnode.cfgDict)
|
||||||
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=1,stopRole='dnode')
|
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=1,stopRole='dnode')
|
||||||
|
|
|
@ -0,0 +1,224 @@
|
||||||
|
from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
|
||||||
|
from numpy import row_stack
|
||||||
|
import taos
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
from util.log import *
|
||||||
|
from util.sql import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.dnodes import TDDnodes
|
||||||
|
from util.dnodes import TDDnode
|
||||||
|
from util.cluster import *
|
||||||
|
sys.path.append("./6-cluster")
|
||||||
|
from clusterCommonCreate import *
|
||||||
|
from clusterCommonCheck import clusterComCheck
|
||||||
|
|
||||||
|
import time
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
from multiprocessing import Process
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
import inspect
|
||||||
|
import ctypes
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
|
||||||
|
def init(self,conn ,logSql):
|
||||||
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
self.TDDnodes = None
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
self.host = socket.gethostname()
|
||||||
|
|
||||||
|
|
||||||
|
def getBuildPath(self):
|
||||||
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
if ("community" in selfPath):
|
||||||
|
projPath = selfPath[:selfPath.find("community")]
|
||||||
|
else:
|
||||||
|
projPath = selfPath[:selfPath.find("tests")]
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(projPath):
|
||||||
|
if ("taosd" in files):
|
||||||
|
rootRealPath = os.path.dirname(os.path.realpath(root))
|
||||||
|
if ("packaging" not in rootRealPath):
|
||||||
|
buildPath = root[:len(root) - len("/build/bin")]
|
||||||
|
break
|
||||||
|
return buildPath
|
||||||
|
|
||||||
|
def _async_raise(self, tid, exctype):
|
||||||
|
"""raises the exception, performs cleanup if needed"""
|
||||||
|
if not inspect.isclass(exctype):
|
||||||
|
exctype = type(exctype)
|
||||||
|
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype))
|
||||||
|
if res == 0:
|
||||||
|
raise ValueError("invalid thread id")
|
||||||
|
elif res != 1:
|
||||||
|
# """if it returns a number greater than one, you're in trouble,
|
||||||
|
# and you should call it again with exc=NULL to revert the effect"""
|
||||||
|
ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None)
|
||||||
|
raise SystemError("PyThreadState_SetAsyncExc failed")
|
||||||
|
|
||||||
|
def stopThread(self,thread):
|
||||||
|
self._async_raise(thread.ident, SystemExit)
|
||||||
|
|
||||||
|
|
||||||
|
def insertData(self,countstart,countstop):
|
||||||
|
# fisrt add data : db\stable\childtable\general table
|
||||||
|
|
||||||
|
for couti in range(countstart,countstop):
|
||||||
|
tdLog.debug("drop database if exists db%d" %couti)
|
||||||
|
tdSql.execute("drop database if exists db%d" %couti)
|
||||||
|
print("create database if not exists db%d replica 1 duration 300" %couti)
|
||||||
|
tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti)
|
||||||
|
tdSql.execute("use db%d" %couti)
|
||||||
|
tdSql.execute(
|
||||||
|
'''create table stb1
|
||||||
|
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
|
||||||
|
tags (t1 int)
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
tdSql.execute(
|
||||||
|
'''
|
||||||
|
create table t1
|
||||||
|
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
for i in range(4):
|
||||||
|
tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )')
|
||||||
|
|
||||||
|
|
||||||
|
def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole):
|
||||||
|
tdLog.printNoPrefix("======== test case 1: ")
|
||||||
|
paraDict = {'dbName': 'db0_0',
|
||||||
|
'dropFlag': 1,
|
||||||
|
'event': '',
|
||||||
|
'vgroups': 4,
|
||||||
|
'replica': 1,
|
||||||
|
'stbName': 'stb',
|
||||||
|
'stbNumbers': 2,
|
||||||
|
'colPrefix': 'c',
|
||||||
|
'tagPrefix': 't',
|
||||||
|
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'ctbPrefix': 'ctb',
|
||||||
|
'ctbNum': 200,
|
||||||
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
|
"rowsPerTbl": 100,
|
||||||
|
"batchNum": 5000
|
||||||
|
}
|
||||||
|
|
||||||
|
dnodeNumbers=int(dnodeNumbers)
|
||||||
|
mnodeNums=int(mnodeNums)
|
||||||
|
vnodeNumbers = int(dnodeNumbers-mnodeNums)
|
||||||
|
allctbNumbers=(paraDict['stbNumbers']*paraDict["ctbNum"])
|
||||||
|
rowsPerStb=paraDict["ctbNum"]*paraDict["rowsPerTbl"]
|
||||||
|
rowsall=rowsPerStb*paraDict['stbNumbers']
|
||||||
|
dbNumbers = 1
|
||||||
|
|
||||||
|
tdLog.info("first check dnode and mnode")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
tdSql.checkData(0,1,'%s:6030'%self.host)
|
||||||
|
tdSql.checkData(4,1,'%s:6430'%self.host)
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
clusterComCheck.checkMnodeStatus(1)
|
||||||
|
|
||||||
|
# fisr add three mnodes;
|
||||||
|
tdLog.info("fisr add three mnodes and check mnode status")
|
||||||
|
tdSql.execute("create mnode on dnode 2")
|
||||||
|
clusterComCheck.checkMnodeStatus(2)
|
||||||
|
tdSql.execute("create mnode on dnode 3")
|
||||||
|
clusterComCheck.checkMnodeStatus(3)
|
||||||
|
|
||||||
|
# add some error operations and
|
||||||
|
tdLog.info("Confirm the status of the dnode again")
|
||||||
|
tdSql.error("create mnode on dnode 2")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
print(tdSql.queryResult)
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
|
||||||
|
# create database and stable
|
||||||
|
clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica'])
|
||||||
|
tdLog.info("Take turns stopping Mnodes ")
|
||||||
|
|
||||||
|
tdDnodes=cluster.dnodes
|
||||||
|
stopcount =0
|
||||||
|
threads=[]
|
||||||
|
|
||||||
|
# create stable:stb_0
|
||||||
|
stableName= paraDict['stbName']
|
||||||
|
newTdSql=tdCom.newTdSql()
|
||||||
|
clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers'])
|
||||||
|
#create child table:ctb_0
|
||||||
|
for i in range(paraDict['stbNumbers']):
|
||||||
|
stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
newTdSql=tdCom.newTdSql()
|
||||||
|
clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum'])
|
||||||
|
#insert date
|
||||||
|
for i in range(paraDict['stbNumbers']):
|
||||||
|
stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
newTdSql=tdCom.newTdSql()
|
||||||
|
threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"])))
|
||||||
|
for tr in threads:
|
||||||
|
tr.start()
|
||||||
|
|
||||||
|
|
||||||
|
while stopcount < restartNumbers:
|
||||||
|
tdLog.info(" restart loop: %d"%stopcount )
|
||||||
|
if stopRole == "mnode":
|
||||||
|
for i in range(mnodeNums):
|
||||||
|
tdDnodes[i].stoptaosd()
|
||||||
|
# sleep(10)
|
||||||
|
tdDnodes[i].starttaosd()
|
||||||
|
# sleep(10)
|
||||||
|
elif stopRole == "vnode":
|
||||||
|
for i in range(vnodeNumbers):
|
||||||
|
tdDnodes[i+mnodeNums].stoptaosd()
|
||||||
|
# sleep(10)
|
||||||
|
tdDnodes[i+mnodeNums].starttaosd()
|
||||||
|
# sleep(10)
|
||||||
|
elif stopRole == "dnode":
|
||||||
|
for i in range(dnodeNumbers):
|
||||||
|
tdDnodes[i].stoptaosd()
|
||||||
|
# sleep(10)
|
||||||
|
tdDnodes[i].starttaosd()
|
||||||
|
# sleep(10)
|
||||||
|
|
||||||
|
# dnodeNumbers don't include database of schema
|
||||||
|
if clusterComCheck.checkDnodes(dnodeNumbers):
|
||||||
|
tdLog.info("dnode is ready")
|
||||||
|
else:
|
||||||
|
print("dnodes is not ready")
|
||||||
|
self.stopThread(threads)
|
||||||
|
tdLog.exit("one or more of dnodes failed to start ")
|
||||||
|
# self.check3mnode()
|
||||||
|
stopcount+=1
|
||||||
|
|
||||||
|
for tr in threads:
|
||||||
|
tr.join()
|
||||||
|
|
||||||
|
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||||
|
clusterComCheck.checkDbRows(dbNumbers)
|
||||||
|
# clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"])
|
||||||
|
|
||||||
|
tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||||
|
tdSql.query("show stables")
|
||||||
|
tdSql.checkRows(paraDict["stbNumbers"])
|
||||||
|
# for i in range(paraDict['stbNumbers']):
|
||||||
|
# stableName= '%s_%d'%(paraDict['stbName'],i)
|
||||||
|
# tdSql.query("select * from %s"%stableName)
|
||||||
|
# tdSql.checkRows(rowsPerStb)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# print(self.master_dnode.cfgDict)
|
||||||
|
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=1,stopRole='dnode')
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -98,8 +98,10 @@ class TDTestCase:
|
||||||
|
|
||||||
# fisr add three mnodes;
|
# fisr add three mnodes;
|
||||||
tdLog.info("fisr add three mnodes and check mnode status")
|
tdLog.info("fisr add three mnodes and check mnode status")
|
||||||
|
tdSql.info("create mnode on dnode 2")
|
||||||
tdSql.execute("create mnode on dnode 2")
|
tdSql.execute("create mnode on dnode 2")
|
||||||
clusterComCheck.checkMnodeStatus(2)
|
clusterComCheck.checkMnodeStatus(2)
|
||||||
|
tdSql.info("create mnode on dnode 3")
|
||||||
tdSql.execute("create mnode on dnode 3")
|
tdSql.execute("create mnode on dnode 3")
|
||||||
clusterComCheck.checkMnodeStatus(3)
|
clusterComCheck.checkMnodeStatus(3)
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class TDTestCase:
|
||||||
'showRow': 1}
|
'showRow': 1}
|
||||||
dnodenumbers=int(dnodenumbers)
|
dnodenumbers=int(dnodenumbers)
|
||||||
mnodeNums=int(mnodeNums)
|
mnodeNums=int(mnodeNums)
|
||||||
dbNumbers = int(dnodenumbers * restartNumber)
|
dbNumbers = 1
|
||||||
|
|
||||||
tdLog.info("first check dnode and mnode")
|
tdLog.info("first check dnode and mnode")
|
||||||
tdSql.query("show dnodes;")
|
tdSql.query("show dnodes;")
|
||||||
|
@ -104,7 +104,7 @@ class TDTestCase:
|
||||||
tdDnodes[1].starttaosd()
|
tdDnodes[1].starttaosd()
|
||||||
tdDnodes[2].starttaosd()
|
tdDnodes[2].starttaosd()
|
||||||
|
|
||||||
clusterComCheck.checkMnodeStatus(3)
|
clusterComCheck.checkMnodeStatus(mnodeNums)
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
|
@ -111,14 +111,14 @@ class TDTestCase:
|
||||||
# seperate vnode and mnode in different dnodes.
|
# seperate vnode and mnode in different dnodes.
|
||||||
# create database and stable
|
# create database and stable
|
||||||
stopcount =0
|
stopcount =0
|
||||||
while stopcount <= 2:
|
while stopcount < restartNumber:
|
||||||
tdLog.info("first restart loop")
|
tdLog.info("first restart loop")
|
||||||
for i in range(dnodenumbers):
|
for i in range(dnodenumbers):
|
||||||
tdDnodes[i].stoptaosd()
|
tdDnodes[i].stoptaosd()
|
||||||
tdDnodes[i].starttaosd()
|
tdDnodes[i].starttaosd()
|
||||||
stopcount+=1
|
stopcount+=1
|
||||||
clusterComCheck.checkDnodes(dnodenumbers)
|
clusterComCheck.checkDnodes(dnodenumbers)
|
||||||
clusterComCheck.checkMnodeStatus(3)
|
clusterComCheck.checkMnodeStatus(mnodeNums)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# print(self.master_dnode.cfgDict)
|
# print(self.master_dnode.cfgDict)
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
|
||||||
|
import taos
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
from util.log import *
|
||||||
|
from util.sql import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.dnodes import *
|
||||||
|
from util.dnodes import TDDnodes
|
||||||
|
from util.dnodes import TDDnode
|
||||||
|
from util.cluster import *
|
||||||
|
from test import tdDnodes
|
||||||
|
sys.path.append("./6-cluster")
|
||||||
|
|
||||||
|
from clusterCommonCreate import *
|
||||||
|
from clusterCommonCheck import *
|
||||||
|
import time
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
from multiprocessing import Process
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
|
||||||
|
def init(self,conn ,logSql):
|
||||||
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
self.host = socket.gethostname()
|
||||||
|
|
||||||
|
|
||||||
|
def getBuildPath(self):
|
||||||
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
if ("community" in selfPath):
|
||||||
|
projPath = selfPath[:selfPath.find("community")]
|
||||||
|
else:
|
||||||
|
projPath = selfPath[:selfPath.find("tests")]
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(projPath):
|
||||||
|
if ("taosd" in files):
|
||||||
|
rootRealPath = os.path.dirname(os.path.realpath(root))
|
||||||
|
if ("packaging" not in rootRealPath):
|
||||||
|
buildPath = root[:len(root) - len("/build/bin")]
|
||||||
|
break
|
||||||
|
return buildPath
|
||||||
|
|
||||||
|
def fiveDnodeThreeMnode(self,dnodenumbers,mnodeNums,restartNumber):
|
||||||
|
tdLog.printNoPrefix("======== test case 1: ")
|
||||||
|
paraDict = {'dbName': 'db0_0',
|
||||||
|
'dropFlag': 1,
|
||||||
|
'event': '',
|
||||||
|
'vgroups': 4,
|
||||||
|
'replica': 1,
|
||||||
|
'stbName': 'stb',
|
||||||
|
'colPrefix': 'c',
|
||||||
|
'tagPrefix': 't',
|
||||||
|
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||||
|
'ctbPrefix': 'ctb',
|
||||||
|
'ctbNum': 1,
|
||||||
|
'rowsPerTbl': 10000,
|
||||||
|
'batchNum': 10,
|
||||||
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
|
'pollDelay': 10,
|
||||||
|
'showMsg': 1,
|
||||||
|
'showRow': 1}
|
||||||
|
dnodenumbers=int(dnodenumbers)
|
||||||
|
mnodeNums=int(mnodeNums)
|
||||||
|
dbNumbers = 1
|
||||||
|
|
||||||
|
tdLog.info("first check dnode and mnode")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
tdSql.checkData(0,1,'%s:6030'%self.host)
|
||||||
|
tdSql.checkData(4,1,'%s:6430'%self.host)
|
||||||
|
clusterComCheck.checkDnodes(dnodenumbers)
|
||||||
|
clusterComCheck.checkMnodeStatus(1)
|
||||||
|
|
||||||
|
# fisr add three mnodes;
|
||||||
|
tdLog.info("fisr add three mnodes and check mnode status")
|
||||||
|
tdSql.execute("create mnode on dnode 2")
|
||||||
|
clusterComCheck.checkMnodeStatus(2)
|
||||||
|
tdSql.execute("create mnode on dnode 3")
|
||||||
|
clusterComCheck.checkMnodeStatus(3)
|
||||||
|
|
||||||
|
# add some error operations and
|
||||||
|
tdLog.info("Confirm the status of the dnode again")
|
||||||
|
tdSql.error("create mnode on dnode 2")
|
||||||
|
tdSql.query("show dnodes;")
|
||||||
|
# print(tdSql.queryResult)
|
||||||
|
clusterComCheck.checkDnodes(dnodenumbers)
|
||||||
|
# restart all taosd
|
||||||
|
tdDnodes=cluster.dnodes
|
||||||
|
tdLog.info("stop two mnode ")
|
||||||
|
|
||||||
|
tdDnodes[0].stoptaosd()
|
||||||
|
tdDnodes[1].stoptaosd()
|
||||||
|
|
||||||
|
# tdLog.info("check whether 2 mnode status is offline")
|
||||||
|
# clusterComCheck.check3mnode2off()
|
||||||
|
# tdSql.error("create user user1 pass '123';")
|
||||||
|
|
||||||
|
tdLog.info("start one mnode" )
|
||||||
|
tdDnodes[0].starttaosd()
|
||||||
|
clusterComCheck.check3mnodeoff(2)
|
||||||
|
|
||||||
|
clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica'])
|
||||||
|
clusterComCheck.checkDb(dbNumbers,1,'db0')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# print(self.master_dnode.cfgDict)
|
||||||
|
self.fiveDnodeThreeMnode(dnodenumbers=5,mnodeNums=3,restartNumber=1)
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -55,6 +55,7 @@ class ClusterComCheck:
|
||||||
count+=1
|
count+=1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
else:
|
else:
|
||||||
|
tdSql.query("show dnodes")
|
||||||
tdLog.debug(tdSql.queryResult)
|
tdLog.debug(tdSql.queryResult)
|
||||||
tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within 30s ! "%dnodeNumbers)
|
tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within 30s ! "%dnodeNumbers)
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ class ClusterComCheck:
|
||||||
def checkMnodeStatus(self,mnodeNums):
|
def checkMnodeStatus(self,mnodeNums):
|
||||||
self.mnodeNums=int(mnodeNums)
|
self.mnodeNums=int(mnodeNums)
|
||||||
# self.leaderDnode=int(leaderDnode)
|
# self.leaderDnode=int(leaderDnode)
|
||||||
|
tdLog.debug("start to check status of mnodes")
|
||||||
count=0
|
count=0
|
||||||
|
|
||||||
while count < 10:
|
while count < 10:
|
||||||
|
|
|
@ -58,17 +58,17 @@ class TDTestCase:
|
||||||
tdSql.query("select * from ct2")
|
tdSql.query("select * from ct2")
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
|
|
||||||
tdSql.query("select * from ct0 order by c1")
|
tdSql.query("select * from ct0 order by c1 ")
|
||||||
tdSql.checkRows(2)
|
tdSql.checkRows(2)
|
||||||
tdSql.checkData(0, 3, "a")
|
tdSql.checkData(0, 3, "a")
|
||||||
tdSql.checkData(1, 4, None)
|
tdSql.checkData(1, 4, None)
|
||||||
|
|
||||||
tdSql.query("select * from n1 order by cc3 desc")
|
tdSql.query("select * from n1 order by ts")
|
||||||
tdSql.checkRows(2)
|
tdSql.checkRows(2)
|
||||||
tdSql.checkData(0, 1, "eeee")
|
tdSql.checkData(0, 1, "eeee")
|
||||||
tdSql.checkData(1, 2, 940)
|
tdSql.checkData(1, 2, 940)
|
||||||
|
|
||||||
tdSql.query("select * from jt order by i desc")
|
tdSql.query("select * from jt order by i desc;")
|
||||||
tdSql.checkRows(2)
|
tdSql.checkRows(2)
|
||||||
tdSql.checkData(0, 1, 11)
|
tdSql.checkData(0, 1, 11)
|
||||||
tdSql.checkData(0, 2, None)
|
tdSql.checkData(0, 2, None)
|
||||||
|
|
|
@ -164,6 +164,7 @@ python3 ./test.py -f 2-query/function_null.py
|
||||||
python3 ./test.py -f 2-query/queryQnode.py
|
python3 ./test.py -f 2-query/queryQnode.py
|
||||||
python3 ./test.py -f 2-query/max_partition.py
|
python3 ./test.py -f 2-query/max_partition.py
|
||||||
python3 ./test.py -f 2-query/last_row.py
|
python3 ./test.py -f 2-query/last_row.py
|
||||||
|
python3 ./test.py -f 2-query/tsbsQuery.py
|
||||||
|
|
||||||
python3 ./test.py -f 6-cluster/5dnode1mnode.py
|
python3 ./test.py -f 6-cluster/5dnode1mnode.py
|
||||||
python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3
|
||||||
|
@ -171,7 +172,7 @@ python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3
|
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3
|
||||||
|
|
||||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
|
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
|
||||||
|
@ -179,6 +180,7 @@ python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3
|
||||||
|
|
||||||
python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3
|
python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3
|
||||||
|
python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 5 -M 3
|
||||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3
|
# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3
|
||||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3
|
# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3
|
||||||
|
|
||||||
|
@ -187,6 +189,11 @@ python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 6 -M 3 -C 5
|
||||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5
|
# python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5
|
||||||
# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3
|
# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3
|
||||||
|
|
||||||
|
python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3
|
||||||
|
python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3
|
||||||
|
python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
|
||||||
|
|
||||||
|
|
||||||
python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3
|
python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3
|
||||||
python3 ./test.py -f 7-tmq/basic5.py
|
python3 ./test.py -f 7-tmq/basic5.py
|
||||||
python3 ./test.py -f 7-tmq/subscribeDb.py
|
python3 ./test.py -f 7-tmq/subscribeDb.py
|
||||||
|
@ -216,7 +223,7 @@ python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py
|
# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
|
||||||
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
|
python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
|
||||||
|
@ -332,7 +339,7 @@ python3 ./test.py -f 2-query/function_null.py -Q 2
|
||||||
python3 ./test.py -f 2-query/count_partition.py -Q 2
|
python3 ./test.py -f 2-query/count_partition.py -Q 2
|
||||||
python3 ./test.py -f 2-query/max_partition.py -Q 2
|
python3 ./test.py -f 2-query/max_partition.py -Q 2
|
||||||
python3 ./test.py -f 2-query/last_row.py -Q 2
|
python3 ./test.py -f 2-query/last_row.py -Q 2
|
||||||
|
python3 ./test.py -f 2-query/tsbsQuery.py -Q 2
|
||||||
#------------querPolicy 3-----------
|
#------------querPolicy 3-----------
|
||||||
|
|
||||||
python3 ./test.py -f 2-query/between.py -Q 3
|
python3 ./test.py -f 2-query/between.py -Q 3
|
||||||
|
@ -419,3 +426,4 @@ python3 ./test.py -f 2-query/function_null.py -Q 3
|
||||||
python3 ./test.py -f 2-query/count_partition.py -Q 3
|
python3 ./test.py -f 2-query/count_partition.py -Q 3
|
||||||
python3 ./test.py -f 2-query/max_partition.py -Q 3
|
python3 ./test.py -f 2-query/max_partition.py -Q 3
|
||||||
python3 ./test.py -f 2-query/last_row.py -Q 3
|
python3 ./test.py -f 2-query/last_row.py -Q 3
|
||||||
|
python3 ./test.py -f 2-query/tsbsQuery.py -Q 3
|
Loading…
Reference in New Issue