scripts
This commit is contained in:
parent
3f88174a8c
commit
aac2a25eb0
|
@ -1241,9 +1241,8 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
|
||||||
SCMSTableVgroupMsg *pInfo = pMsg->pCont;
|
SCMSTableVgroupMsg *pInfo = pMsg->pCont;
|
||||||
int32_t numOfTable = htonl(pInfo->numOfTables);
|
int32_t numOfTable = htonl(pInfo->numOfTables);
|
||||||
|
|
||||||
SCMSTableVgroupRspMsg *pRsp = NULL;
|
// reserve space
|
||||||
int32_t contLen = sizeof(SCMSTableVgroupRspMsg) + 32 * sizeof(SCMVgroupInfo) + sizeof(SVgroupsInfo);
|
int32_t contLen = sizeof(SCMSTableVgroupRspMsg) + 32 * sizeof(SCMVgroupInfo) + sizeof(SVgroupsInfo);
|
||||||
//reserve space
|
|
||||||
for (int32_t i = 0; i < numOfTable; ++i) {
|
for (int32_t i = 0; i < numOfTable; ++i) {
|
||||||
char *stableName = (char*)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN) * i;
|
char *stableName = (char*)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN) * i;
|
||||||
SSuperTableObj *pTable = mgmtGetSuperTable(stableName);
|
SSuperTableObj *pTable = mgmtGetSuperTable(stableName);
|
||||||
|
@ -1253,7 +1252,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
|
||||||
mgmtDecTableRef(pTable);
|
mgmtDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
pRsp = rpcMallocCont(contLen);
|
SCMSTableVgroupRspMsg *pRsp = rpcMallocCont(contLen);
|
||||||
if (pRsp == NULL) {
|
if (pRsp == NULL) {
|
||||||
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_SERV_OUT_OF_MEMORY);
|
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_SERV_OUT_OF_MEMORY);
|
||||||
return;
|
return;
|
||||||
|
@ -1265,32 +1264,31 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
|
||||||
for (int32_t i = 0; i < numOfTable; ++i) {
|
for (int32_t i = 0; i < numOfTable; ++i) {
|
||||||
char *stableName = (char*)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN) * i;
|
char *stableName = (char*)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN) * i;
|
||||||
SSuperTableObj *pTable = mgmtGetSuperTable(stableName);
|
SSuperTableObj *pTable = mgmtGetSuperTable(stableName);
|
||||||
SVgroupsInfo *pVgroup = (SVgroupsInfo *)msg;
|
SVgroupsInfo *pVgroupInfo = (SVgroupsInfo *)msg;
|
||||||
|
|
||||||
SHashMutableIterator *pIter = taosHashCreateIter(pTable->vgHash);
|
SHashMutableIterator *pIter = taosHashCreateIter(pTable->vgHash);
|
||||||
int32_t vgSize = 0;
|
int32_t vgSize = 0;
|
||||||
while (taosHashIterNext(pIter)) {
|
while (taosHashIterNext(pIter)) {
|
||||||
int32_t *pVgId = taosHashIterGet(pIter);
|
int32_t *pVgId = taosHashIterGet(pIter);
|
||||||
SVgObj * pVgItem = mgmtGetVgroup(*pVgId
|
SVgObj * pVgroup = mgmtGetVgroup(*pVgId);
|
||||||
);
|
if (pVgroup == NULL) continue;
|
||||||
if (pVgItem == NULL) continue;
|
|
||||||
|
|
||||||
pVgroup->vgroups[vgSize].vgId = htonl(pVgItem->vgId);
|
pVgroupInfo->vgroups[vgSize].vgId = htonl(pVgroup->vgId);
|
||||||
for (int32_t vn = 0; vn < pVgItem->numOfVnodes; ++vn) {
|
for (int32_t vn = 0; vn < pVgroup->numOfVnodes; ++vn) {
|
||||||
SDnodeObj *pDnode = pVgItem->vnodeGid[vn].pDnode;
|
SDnodeObj *pDnode = pVgroup->vnodeGid[vn].pDnode;
|
||||||
if (pDnode == NULL) break;
|
if (pDnode == NULL) break;
|
||||||
|
|
||||||
strncpy(pVgroup->vgroups[vgSize].ipAddr[vn].fqdn, pDnode->dnodeFqdn, tListLen(pDnode->dnodeFqdn));
|
strncpy(pVgroupInfo->vgroups[vgSize].ipAddr[vn].fqdn, pDnode->dnodeFqdn, tListLen(pDnode->dnodeFqdn));
|
||||||
pVgroup->vgroups[vgSize].ipAddr[vn].port = htons(tsDnodeShellPort);
|
pVgroupInfo->vgroups[vgSize].ipAddr[vn].port = htons(tsDnodeShellPort);
|
||||||
|
|
||||||
pVgroup->vgroups[vgSize].numOfIps++;
|
pVgroupInfo->vgroups[vgSize].numOfIps++;
|
||||||
}
|
}
|
||||||
|
|
||||||
vgSize++;
|
vgSize++;
|
||||||
mgmtDecVgroupRef(pVgItem);
|
mgmtDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
pVgroup->numOfVgroups = htonl(vgSize);
|
pVgroupInfo->numOfVgroups = htonl(vgSize);
|
||||||
|
|
||||||
// one table is done, try the next table
|
// one table is done, try the next table
|
||||||
msg += sizeof(SVgroupsInfo) + vgSize * sizeof(SCMVgroupInfo);
|
msg += sizeof(SVgroupsInfo) + vgSize * sizeof(SCMVgroupInfo);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
|
|
||||||
$totalVnodes = 100
|
$totalVnodes = 10
|
||||||
$maxTables = 4
|
$maxTables = 4
|
||||||
$totalRows = $totalVnodes * $maxTables
|
$totalRows = $totalVnodes * $maxTables
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ cd ../../../debug; make
|
||||||
#./test.sh -f general/stable/disk.sim
|
#./test.sh -f general/stable/disk.sim
|
||||||
#./test.sh -f general/stable/metrics.sim
|
#./test.sh -f general/stable/metrics.sim
|
||||||
#./test.sh -f general/stable/values.sim
|
#./test.sh -f general/stable/values.sim
|
||||||
#./test.sh -f general/stable/vnode3.sim
|
./test.sh -f general/stable/vnode3.sim
|
||||||
|
|
||||||
./test.sh -f general/table/autocreate.sim
|
./test.sh -f general/table/autocreate.sim
|
||||||
./test.sh -f general/table/basic1.sim
|
./test.sh -f general/table/basic1.sim
|
||||||
|
@ -244,7 +244,7 @@ cd ../../../debug; make
|
||||||
./test.sh -u -f unique/account/user_len.sim
|
./test.sh -u -f unique/account/user_len.sim
|
||||||
|
|
||||||
#./test.sh -u -f unique/big/balance.sim
|
#./test.sh -u -f unique/big/balance.sim
|
||||||
#./test.sh -u -f unique/big/maxvnodes.sim
|
#slguan ./test.sh -u -f unique/big/maxvnodes.sim
|
||||||
./test.sh -u -f unique/big/tcp.sim
|
./test.sh -u -f unique/big/tcp.sim
|
||||||
|
|
||||||
##./test.sh -u -f unique/cluster/balance1.sim
|
##./test.sh -u -f unique/cluster/balance1.sim
|
||||||
|
|
Loading…
Reference in New Issue