Merge from master
This commit is contained in:
commit
50ee6f1091
|
@ -307,7 +307,7 @@ STableMeta* createSuperTableMeta(STableMetaMsg* pChild);
|
||||||
uint32_t tscGetTableMetaSize(STableMeta* pTableMeta);
|
uint32_t tscGetTableMetaSize(STableMeta* pTableMeta);
|
||||||
CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta);
|
CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta);
|
||||||
uint32_t tscGetTableMetaMaxSize();
|
uint32_t tscGetTableMetaMaxSize();
|
||||||
int32_t tscCreateTableMetaFromCChildMeta(STableMeta* pChild, const char* name, void* buf);
|
int32_t tscCreateTableMetaFromSTableMeta(STableMeta* pChild, const char* name, void* buf);
|
||||||
STableMeta* tscTableMetaDup(STableMeta* pTableMeta);
|
STableMeta* tscTableMetaDup(STableMeta* pTableMeta);
|
||||||
int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr);
|
int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr);
|
||||||
|
|
||||||
|
|
|
@ -68,14 +68,16 @@ typedef struct CChildTableMeta {
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
STableId id;
|
STableId id;
|
||||||
uint8_t tableType;
|
uint8_t tableType;
|
||||||
char sTableName[TSDB_TABLE_FNAME_LEN]; //super table name, not full name
|
char sTableName[TSDB_TABLE_FNAME_LEN]; // TODO: refactor super table name, not full name
|
||||||
|
uint64_t suid; // super table id
|
||||||
} CChildTableMeta;
|
} CChildTableMeta;
|
||||||
|
|
||||||
typedef struct STableMeta {
|
typedef struct STableMeta {
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
STableId id;
|
STableId id;
|
||||||
uint8_t tableType;
|
uint8_t tableType;
|
||||||
char sTableName[TSDB_TABLE_FNAME_LEN];
|
char sTableName[TSDB_TABLE_FNAME_LEN]; // super table name
|
||||||
|
uint64_t suid; // super table id
|
||||||
int16_t sversion;
|
int16_t sversion;
|
||||||
int16_t tversion;
|
int16_t tversion;
|
||||||
STableComInfo tableInfo;
|
STableComInfo tableInfo;
|
||||||
|
|
|
@ -94,6 +94,7 @@ STableMeta* tscCreateTableMetaFromMsg(STableMetaMsg* pTableMetaMsg) {
|
||||||
|
|
||||||
pTableMeta->tableType = pTableMetaMsg->tableType;
|
pTableMeta->tableType = pTableMetaMsg->tableType;
|
||||||
pTableMeta->vgId = pTableMetaMsg->vgroup.vgId;
|
pTableMeta->vgId = pTableMetaMsg->vgroup.vgId;
|
||||||
|
pTableMeta->suid = pTableMetaMsg->suid;
|
||||||
|
|
||||||
pTableMeta->tableInfo = (STableComInfo) {
|
pTableMeta->tableInfo = (STableComInfo) {
|
||||||
.numOfTags = pTableMetaMsg->numOfTags,
|
.numOfTags = pTableMetaMsg->numOfTags,
|
||||||
|
|
|
@ -1832,8 +1832,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
|
||||||
pMetaMsg->sversion = htons(pMetaMsg->sversion);
|
pMetaMsg->sversion = htons(pMetaMsg->sversion);
|
||||||
pMetaMsg->tversion = htons(pMetaMsg->tversion);
|
pMetaMsg->tversion = htons(pMetaMsg->tversion);
|
||||||
pMetaMsg->vgroup.vgId = htonl(pMetaMsg->vgroup.vgId);
|
pMetaMsg->vgroup.vgId = htonl(pMetaMsg->vgroup.vgId);
|
||||||
|
|
||||||
pMetaMsg->uid = htobe64(pMetaMsg->uid);
|
pMetaMsg->uid = htobe64(pMetaMsg->uid);
|
||||||
|
pMetaMsg->suid = pMetaMsg->suid;
|
||||||
pMetaMsg->contLen = htons(pMetaMsg->contLen);
|
pMetaMsg->contLen = htons(pMetaMsg->contLen);
|
||||||
pMetaMsg->numOfColumns = htons(pMetaMsg->numOfColumns);
|
pMetaMsg->numOfColumns = htons(pMetaMsg->numOfColumns);
|
||||||
|
|
||||||
|
@ -2453,14 +2453,11 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
|
||||||
return TSDB_CODE_TSC_OUT_OF_MEMORY;
|
return TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
pTableMetaInfo->pTableMeta = (STableMeta *)tmp;
|
pTableMetaInfo->pTableMeta = (STableMeta *)tmp;
|
||||||
memset(pTableMetaInfo->pTableMeta, 0, size);
|
|
||||||
pTableMetaInfo->tableMetaSize = size;
|
|
||||||
} else {
|
|
||||||
//uint32_t s = tscGetTableMetaSize(pTableMetaInfo->pTableMeta);
|
|
||||||
memset(pTableMetaInfo->pTableMeta, 0, size);
|
|
||||||
pTableMetaInfo->tableMetaSize = size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(pTableMetaInfo->pTableMeta, 0, size);
|
||||||
|
pTableMetaInfo->tableMetaSize = size;
|
||||||
|
|
||||||
pTableMetaInfo->pTableMeta->tableType = -1;
|
pTableMetaInfo->pTableMeta->tableType = -1;
|
||||||
pTableMetaInfo->pTableMeta->tableInfo.numOfColumns = -1;
|
pTableMetaInfo->pTableMeta->tableInfo.numOfColumns = -1;
|
||||||
|
|
||||||
|
@ -2476,8 +2473,9 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
|
||||||
|
|
||||||
STableMeta* pMeta = pTableMetaInfo->pTableMeta;
|
STableMeta* pMeta = pTableMetaInfo->pTableMeta;
|
||||||
if (pMeta->id.uid > 0) {
|
if (pMeta->id.uid > 0) {
|
||||||
|
// in case of child table, here only get the
|
||||||
if (pMeta->tableType == TSDB_CHILD_TABLE) {
|
if (pMeta->tableType == TSDB_CHILD_TABLE) {
|
||||||
int32_t code = tscCreateTableMetaFromCChildMeta(pTableMetaInfo->pTableMeta, name, buf);
|
int32_t code = tscCreateTableMetaFromSTableMeta(pTableMetaInfo->pTableMeta, name, buf);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
return getTableMetaFromMnode(pSql, pTableMetaInfo);
|
return getTableMetaFromMnode(pSql, pTableMetaInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3370,22 +3370,25 @@ CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta) {
|
||||||
assert(pTableMeta != NULL);
|
assert(pTableMeta != NULL);
|
||||||
|
|
||||||
CChildTableMeta* cMeta = calloc(1, sizeof(CChildTableMeta));
|
CChildTableMeta* cMeta = calloc(1, sizeof(CChildTableMeta));
|
||||||
|
|
||||||
cMeta->tableType = TSDB_CHILD_TABLE;
|
cMeta->tableType = TSDB_CHILD_TABLE;
|
||||||
cMeta->vgId = pTableMeta->vgId;
|
cMeta->vgId = pTableMeta->vgId;
|
||||||
cMeta->id = pTableMeta->id;
|
cMeta->id = pTableMeta->id;
|
||||||
|
cMeta->suid = pTableMeta->suid;
|
||||||
tstrncpy(cMeta->sTableName, pTableMeta->sTableName, TSDB_TABLE_FNAME_LEN);
|
tstrncpy(cMeta->sTableName, pTableMeta->sTableName, TSDB_TABLE_FNAME_LEN);
|
||||||
|
|
||||||
return cMeta;
|
return cMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tscCreateTableMetaFromCChildMeta(STableMeta* pChild, const char* name, void* buf) {
|
int32_t tscCreateTableMetaFromSTableMeta(STableMeta* pChild, const char* name, void* buf) {
|
||||||
assert(pChild != NULL && buf != NULL);
|
assert(pChild != NULL && buf != NULL);
|
||||||
|
|
||||||
// uint32_t size = tscGetTableMetaMaxSize();
|
STableMeta* p = buf;
|
||||||
STableMeta* p = buf;//calloc(1, size);
|
|
||||||
|
|
||||||
taosHashGetClone(tscTableMetaInfo, pChild->sTableName, strnlen(pChild->sTableName, TSDB_TABLE_FNAME_LEN), NULL, p, -1);
|
taosHashGetClone(tscTableMetaInfo, pChild->sTableName, strnlen(pChild->sTableName, TSDB_TABLE_FNAME_LEN), NULL, p, -1);
|
||||||
if (p->id.uid > 0) { // tableMeta exists, build child table meta and return
|
|
||||||
|
// tableMeta exists, build child table meta according to the super table meta
|
||||||
|
// the uid need to be checked in addition to the general name of the super table.
|
||||||
|
if (p->id.uid > 0 && pChild->suid == p->id.uid) {
|
||||||
pChild->sversion = p->sversion;
|
pChild->sversion = p->sversion;
|
||||||
pChild->tversion = p->tversion;
|
pChild->tversion = p->tversion;
|
||||||
|
|
||||||
|
@ -3393,13 +3396,9 @@ int32_t tscCreateTableMetaFromCChildMeta(STableMeta* pChild, const char* name, v
|
||||||
int32_t total = pChild->tableInfo.numOfColumns + pChild->tableInfo.numOfTags;
|
int32_t total = pChild->tableInfo.numOfColumns + pChild->tableInfo.numOfTags;
|
||||||
|
|
||||||
memcpy(pChild->schema, p->schema, sizeof(SSchema) *total);
|
memcpy(pChild->schema, p->schema, sizeof(SSchema) *total);
|
||||||
|
|
||||||
// tfree(p);
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
} else { // super table has been removed, current tableMeta is also expired. remove it here
|
} else { // super table has been removed, current tableMeta is also expired. remove it here
|
||||||
taosHashRemove(tscTableMetaInfo, name, strnlen(name, TSDB_TABLE_FNAME_LEN));
|
taosHashRemove(tscTableMetaInfo, name, strnlen(name, TSDB_TABLE_FNAME_LEN));
|
||||||
|
|
||||||
// tfree(p);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"filetype":"subscribe",
|
"filetype": "subscribe",
|
||||||
"cfgdir": "/etc/taos",
|
"cfgdir": "/etc/taos",
|
||||||
"host": "127.0.0.1",
|
"host": "127.0.0.1",
|
||||||
"port": 6030,
|
"port": 6030,
|
||||||
|
|
|
@ -380,7 +380,7 @@ typedef struct SpecifiedQueryInfo_S {
|
||||||
uint32_t asyncMode; // 0: sync, 1: async
|
uint32_t asyncMode; // 0: sync, 1: async
|
||||||
uint64_t subscribeInterval; // ms
|
uint64_t subscribeInterval; // ms
|
||||||
uint64_t queryTimes;
|
uint64_t queryTimes;
|
||||||
int subscribeRestart;
|
bool subscribeRestart;
|
||||||
int subscribeKeepProgress;
|
int subscribeKeepProgress;
|
||||||
char sql[MAX_QUERY_SQL_COUNT][MAX_QUERY_SQL_LENGTH+1];
|
char sql[MAX_QUERY_SQL_COUNT][MAX_QUERY_SQL_LENGTH+1];
|
||||||
char result[MAX_QUERY_SQL_COUNT][MAX_FILE_NAME_LEN+1];
|
char result[MAX_QUERY_SQL_COUNT][MAX_FILE_NAME_LEN+1];
|
||||||
|
@ -395,7 +395,7 @@ typedef struct SuperQueryInfo_S {
|
||||||
uint32_t threadCnt;
|
uint32_t threadCnt;
|
||||||
uint32_t asyncMode; // 0: sync, 1: async
|
uint32_t asyncMode; // 0: sync, 1: async
|
||||||
uint64_t subscribeInterval; // ms
|
uint64_t subscribeInterval; // ms
|
||||||
int subscribeRestart;
|
bool subscribeRestart;
|
||||||
int subscribeKeepProgress;
|
int subscribeKeepProgress;
|
||||||
uint64_t queryTimes;
|
uint64_t queryTimes;
|
||||||
int64_t childTblCount;
|
int64_t childTblCount;
|
||||||
|
@ -545,8 +545,8 @@ static void prompt();
|
||||||
static int createDatabasesAndStables();
|
static int createDatabasesAndStables();
|
||||||
static void createChildTables();
|
static void createChildTables();
|
||||||
static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet);
|
static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet);
|
||||||
static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port,
|
static int postProceSql(char *host, struct sockaddr_in *pServAddr,
|
||||||
char* sqlstr, char *resultFile);
|
uint16_t port, char* sqlstr, char *resultFile);
|
||||||
|
|
||||||
/* ************ Global variables ************ */
|
/* ************ Global variables ************ */
|
||||||
|
|
||||||
|
@ -1347,13 +1347,15 @@ static int printfInsertMeta() {
|
||||||
|
|
||||||
printf("interface: \033[33m%s\033[0m\n",
|
printf("interface: \033[33m%s\033[0m\n",
|
||||||
(g_args.iface==TAOSC_IFACE)?"taosc":(g_args.iface==REST_IFACE)?"rest":"stmt");
|
(g_args.iface==TAOSC_IFACE)?"taosc":(g_args.iface==REST_IFACE)?"rest":"stmt");
|
||||||
printf("host: \033[33m%s:%u\033[0m\n", g_Dbs.host, g_Dbs.port);
|
printf("host: \033[33m%s:%u\033[0m\n",
|
||||||
|
g_Dbs.host, g_Dbs.port);
|
||||||
printf("user: \033[33m%s\033[0m\n", g_Dbs.user);
|
printf("user: \033[33m%s\033[0m\n", g_Dbs.user);
|
||||||
printf("password: \033[33m%s\033[0m\n", g_Dbs.password);
|
printf("password: \033[33m%s\033[0m\n", g_Dbs.password);
|
||||||
printf("configDir: \033[33m%s\033[0m\n", configDir);
|
printf("configDir: \033[33m%s\033[0m\n", configDir);
|
||||||
printf("resultFile: \033[33m%s\033[0m\n", g_Dbs.resultFile);
|
printf("resultFile: \033[33m%s\033[0m\n", g_Dbs.resultFile);
|
||||||
printf("thread num of insert data: \033[33m%d\033[0m\n", g_Dbs.threadCount);
|
printf("thread num of insert data: \033[33m%d\033[0m\n", g_Dbs.threadCount);
|
||||||
printf("thread num of create table: \033[33m%d\033[0m\n", g_Dbs.threadCountByCreateTbl);
|
printf("thread num of create table: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.threadCountByCreateTbl);
|
||||||
printf("top insert interval: \033[33m%"PRIu64"\033[0m\n",
|
printf("top insert interval: \033[33m%"PRIu64"\033[0m\n",
|
||||||
g_args.insert_interval);
|
g_args.insert_interval);
|
||||||
printf("number of records per req: \033[33m%"PRIu64"\033[0m\n",
|
printf("number of records per req: \033[33m%"PRIu64"\033[0m\n",
|
||||||
|
@ -1365,7 +1367,8 @@ static int printfInsertMeta() {
|
||||||
|
|
||||||
for (int i = 0; i < g_Dbs.dbCount; i++) {
|
for (int i = 0; i < g_Dbs.dbCount; i++) {
|
||||||
printf("database[\033[33m%d\033[0m]:\n", i);
|
printf("database[\033[33m%d\033[0m]:\n", i);
|
||||||
printf(" database[%d] name: \033[33m%s\033[0m\n", i, g_Dbs.db[i].dbName);
|
printf(" database[%d] name: \033[33m%s\033[0m\n",
|
||||||
|
i, g_Dbs.db[i].dbName);
|
||||||
if (0 == g_Dbs.db[i].drop) {
|
if (0 == g_Dbs.db[i].drop) {
|
||||||
printf(" drop: \033[33mno\033[0m\n");
|
printf(" drop: \033[33mno\033[0m\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1373,40 +1376,51 @@ static int printfInsertMeta() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Dbs.db[i].dbCfg.blocks > 0) {
|
if (g_Dbs.db[i].dbCfg.blocks > 0) {
|
||||||
printf(" blocks: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.blocks);
|
printf(" blocks: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.blocks);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.cache > 0) {
|
if (g_Dbs.db[i].dbCfg.cache > 0) {
|
||||||
printf(" cache: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.cache);
|
printf(" cache: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.cache);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.days > 0) {
|
if (g_Dbs.db[i].dbCfg.days > 0) {
|
||||||
printf(" days: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.days);
|
printf(" days: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.days);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.keep > 0) {
|
if (g_Dbs.db[i].dbCfg.keep > 0) {
|
||||||
printf(" keep: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.keep);
|
printf(" keep: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.keep);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.replica > 0) {
|
if (g_Dbs.db[i].dbCfg.replica > 0) {
|
||||||
printf(" replica: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.replica);
|
printf(" replica: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.replica);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.update > 0) {
|
if (g_Dbs.db[i].dbCfg.update > 0) {
|
||||||
printf(" update: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.update);
|
printf(" update: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.update);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.minRows > 0) {
|
if (g_Dbs.db[i].dbCfg.minRows > 0) {
|
||||||
printf(" minRows: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.minRows);
|
printf(" minRows: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.minRows);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.maxRows > 0) {
|
if (g_Dbs.db[i].dbCfg.maxRows > 0) {
|
||||||
printf(" maxRows: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.maxRows);
|
printf(" maxRows: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.maxRows);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.comp > 0) {
|
if (g_Dbs.db[i].dbCfg.comp > 0) {
|
||||||
printf(" comp: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.comp);
|
printf(" comp: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.comp);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.walLevel > 0) {
|
if (g_Dbs.db[i].dbCfg.walLevel > 0) {
|
||||||
printf(" walLevel: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.walLevel);
|
printf(" walLevel: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.walLevel);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.fsync > 0) {
|
if (g_Dbs.db[i].dbCfg.fsync > 0) {
|
||||||
printf(" fsync: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.fsync);
|
printf(" fsync: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.fsync);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.quorum > 0) {
|
if (g_Dbs.db[i].dbCfg.quorum > 0) {
|
||||||
printf(" quorum: \033[33m%d\033[0m\n", g_Dbs.db[i].dbCfg.quorum);
|
printf(" quorum: \033[33m%d\033[0m\n",
|
||||||
|
g_Dbs.db[i].dbCfg.quorum);
|
||||||
}
|
}
|
||||||
if (g_Dbs.db[i].dbCfg.precision[0] != 0) {
|
if (g_Dbs.db[i].dbCfg.precision[0] != 0) {
|
||||||
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", 2))
|
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", 2))
|
||||||
|
@ -1600,21 +1614,26 @@ static void printfInsertMetaToFile(FILE* fp) {
|
||||||
if (g_Dbs.db[i].dbCfg.precision[0] != 0) {
|
if (g_Dbs.db[i].dbCfg.precision[0] != 0) {
|
||||||
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", 2))
|
if ((0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "ms", 2))
|
||||||
|| (0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "us", 2))) {
|
|| (0 == strncasecmp(g_Dbs.db[i].dbCfg.precision, "us", 2))) {
|
||||||
fprintf(fp, " precision: %s\n", g_Dbs.db[i].dbCfg.precision);
|
fprintf(fp, " precision: %s\n",
|
||||||
|
g_Dbs.db[i].dbCfg.precision);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, " precision error: %s\n", g_Dbs.db[i].dbCfg.precision);
|
fprintf(fp, " precision error: %s\n",
|
||||||
|
g_Dbs.db[i].dbCfg.precision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp, " super table count: %"PRIu64"\n", g_Dbs.db[i].superTblCount);
|
fprintf(fp, " super table count: %"PRIu64"\n",
|
||||||
for (uint64_t j = 0; j < g_Dbs.db[i].superTblCount; j++) {
|
g_Dbs.db[i].superTblCount);
|
||||||
fprintf(fp, " super table[%"PRIu64"]:\n", j);
|
for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) {
|
||||||
|
fprintf(fp, " super table[%d]:\n", j);
|
||||||
|
|
||||||
fprintf(fp, " stbName: %s\n", g_Dbs.db[i].superTbls[j].sTblName);
|
fprintf(fp, " stbName: %s\n",
|
||||||
|
g_Dbs.db[i].superTbls[j].sTblName);
|
||||||
|
|
||||||
if (PRE_CREATE_SUBTBL == g_Dbs.db[i].superTbls[j].autoCreateTable) {
|
if (PRE_CREATE_SUBTBL == g_Dbs.db[i].superTbls[j].autoCreateTable) {
|
||||||
fprintf(fp, " autoCreateTable: %s\n", "no");
|
fprintf(fp, " autoCreateTable: %s\n", "no");
|
||||||
} else if (AUTO_CREATE_SUBTBL == g_Dbs.db[i].superTbls[j].autoCreateTable) {
|
} else if (AUTO_CREATE_SUBTBL
|
||||||
|
== g_Dbs.db[i].superTbls[j].autoCreateTable) {
|
||||||
fprintf(fp, " autoCreateTable: %s\n", "yes");
|
fprintf(fp, " autoCreateTable: %s\n", "yes");
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, " autoCreateTable: %s\n", "error");
|
fprintf(fp, " autoCreateTable: %s\n", "error");
|
||||||
|
@ -1622,7 +1641,8 @@ static void printfInsertMetaToFile(FILE* fp) {
|
||||||
|
|
||||||
if (TBL_NO_EXISTS == g_Dbs.db[i].superTbls[j].childTblExists) {
|
if (TBL_NO_EXISTS == g_Dbs.db[i].superTbls[j].childTblExists) {
|
||||||
fprintf(fp, " childTblExists: %s\n", "no");
|
fprintf(fp, " childTblExists: %s\n", "no");
|
||||||
} else if (TBL_ALREADY_EXISTS == g_Dbs.db[i].superTbls[j].childTblExists) {
|
} else if (TBL_ALREADY_EXISTS
|
||||||
|
== g_Dbs.db[i].superTbls[j].childTblExists) {
|
||||||
fprintf(fp, " childTblExists: %s\n", "yes");
|
fprintf(fp, " childTblExists: %s\n", "yes");
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, " childTblExists: %s\n", "error");
|
fprintf(fp, " childTblExists: %s\n", "error");
|
||||||
|
@ -1679,7 +1699,8 @@ static void printfInsertMetaToFile(FILE* fp) {
|
||||||
if ((0 == strncasecmp(
|
if ((0 == strncasecmp(
|
||||||
g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
||||||
"binary", strlen("binary")))
|
"binary", strlen("binary")))
|
||||||
|| (0 == strncasecmp(g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
|| (0 == strncasecmp(
|
||||||
|
g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
||||||
"nchar", strlen("nchar")))) {
|
"nchar", strlen("nchar")))) {
|
||||||
fprintf(fp, "column[%d]:%s(%d) ", k,
|
fprintf(fp, "column[%d]:%s(%d) ", k,
|
||||||
g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
g_Dbs.db[i].superTbls[j].columns[k].dataType,
|
||||||
|
@ -1699,7 +1720,8 @@ static void printfInsertMetaToFile(FILE* fp) {
|
||||||
"binary", strlen("binary")))
|
"binary", strlen("binary")))
|
||||||
|| (0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType,
|
|| (0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType,
|
||||||
"nchar", strlen("nchar")))) {
|
"nchar", strlen("nchar")))) {
|
||||||
fprintf(fp, "tag[%d]:%s(%d) ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType,
|
fprintf(fp, "tag[%d]:%s(%d) ",
|
||||||
|
k, g_Dbs.db[i].superTbls[j].tags[k].dataType,
|
||||||
g_Dbs.db[i].superTbls[j].tags[k].dataLen);
|
g_Dbs.db[i].superTbls[j].tags[k].dataLen);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, "tag[%d]:%s ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType);
|
fprintf(fp, "tag[%d]:%s ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType);
|
||||||
|
@ -4206,7 +4228,8 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
"query_times");
|
"query_times");
|
||||||
if (specifiedQueryTimes && specifiedQueryTimes->type == cJSON_Number) {
|
if (specifiedQueryTimes && specifiedQueryTimes->type == cJSON_Number) {
|
||||||
if (specifiedQueryTimes->valueint <= 0) {
|
if (specifiedQueryTimes->valueint <= 0) {
|
||||||
errorPrint("%s() LN%d, failed to read json, query_times: %"PRId64", need be a valid (>0) number\n",
|
errorPrint(
|
||||||
|
"%s() LN%d, failed to read json, query_times: %"PRId64", need be a valid (>0) number\n",
|
||||||
__func__, __LINE__, specifiedQueryTimes->valueint);
|
__func__, __LINE__, specifiedQueryTimes->valueint);
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
|
|
||||||
|
@ -4223,7 +4246,8 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
cJSON* concurrent = cJSON_GetObjectItem(specifiedQuery, "concurrent");
|
cJSON* concurrent = cJSON_GetObjectItem(specifiedQuery, "concurrent");
|
||||||
if (concurrent && concurrent->type == cJSON_Number) {
|
if (concurrent && concurrent->type == cJSON_Number) {
|
||||||
if (concurrent->valueint <= 0) {
|
if (concurrent->valueint <= 0) {
|
||||||
errorPrint("%s() LN%d, query sqlCount %"PRIu64" or concurrent %"PRIu64" is not correct.\n",
|
errorPrint(
|
||||||
|
"%s() LN%d, query sqlCount %"PRIu64" or concurrent %"PRIu64" is not correct.\n",
|
||||||
__func__, __LINE__,
|
__func__, __LINE__,
|
||||||
g_queryInfo.specifiedQueryInfo.sqlCount,
|
g_queryInfo.specifiedQueryInfo.sqlCount,
|
||||||
g_queryInfo.specifiedQueryInfo.concurrent);
|
g_queryInfo.specifiedQueryInfo.concurrent);
|
||||||
|
@ -4262,15 +4286,15 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
cJSON* restart = cJSON_GetObjectItem(specifiedQuery, "restart");
|
cJSON* restart = cJSON_GetObjectItem(specifiedQuery, "restart");
|
||||||
if (restart && restart->type == cJSON_String && restart->valuestring != NULL) {
|
if (restart && restart->type == cJSON_String && restart->valuestring != NULL) {
|
||||||
if (0 == strcmp("yes", restart->valuestring)) {
|
if (0 == strcmp("yes", restart->valuestring)) {
|
||||||
g_queryInfo.specifiedQueryInfo.subscribeRestart = 1;
|
g_queryInfo.specifiedQueryInfo.subscribeRestart = true;
|
||||||
} else if (0 == strcmp("no", restart->valuestring)) {
|
} else if (0 == strcmp("no", restart->valuestring)) {
|
||||||
g_queryInfo.specifiedQueryInfo.subscribeRestart = 0;
|
g_queryInfo.specifiedQueryInfo.subscribeRestart = false;
|
||||||
} else {
|
} else {
|
||||||
printf("ERROR: failed to read json, subscribe restart error\n");
|
printf("ERROR: failed to read json, subscribe restart error\n");
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_queryInfo.specifiedQueryInfo.subscribeRestart = 1;
|
g_queryInfo.specifiedQueryInfo.subscribeRestart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* keepProgress = cJSON_GetObjectItem(specifiedQuery, "keepProgress");
|
cJSON* keepProgress = cJSON_GetObjectItem(specifiedQuery, "keepProgress");
|
||||||
|
@ -4315,7 +4339,8 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
printf("ERROR: failed to read json, sql not found\n");
|
printf("ERROR: failed to read json, sql not found\n");
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
tstrncpy(g_queryInfo.specifiedQueryInfo.sql[j], sqlStr->valuestring, MAX_QUERY_SQL_LENGTH);
|
tstrncpy(g_queryInfo.specifiedQueryInfo.sql[j],
|
||||||
|
sqlStr->valuestring, MAX_QUERY_SQL_LENGTH);
|
||||||
|
|
||||||
cJSON* resubAfterConsume =
|
cJSON* resubAfterConsume =
|
||||||
cJSON_GetObjectItem(specifiedQuery, "resubAfterConsume");
|
cJSON_GetObjectItem(specifiedQuery, "resubAfterConsume");
|
||||||
|
@ -4330,10 +4355,13 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON *result = cJSON_GetObjectItem(sql, "result");
|
cJSON *result = cJSON_GetObjectItem(sql, "result");
|
||||||
if (NULL != result && result->type == cJSON_String && result->valuestring != NULL) {
|
if ((NULL != result) && (result->type == cJSON_String)
|
||||||
tstrncpy(g_queryInfo.specifiedQueryInfo.result[j], result->valuestring, MAX_FILE_NAME_LEN);
|
&& (result->valuestring != NULL)) {
|
||||||
|
tstrncpy(g_queryInfo.specifiedQueryInfo.result[j],
|
||||||
|
result->valuestring, MAX_FILE_NAME_LEN);
|
||||||
} else if (NULL == result) {
|
} else if (NULL == result) {
|
||||||
memset(g_queryInfo.specifiedQueryInfo.result[j], 0, MAX_FILE_NAME_LEN);
|
memset(g_queryInfo.specifiedQueryInfo.result[j],
|
||||||
|
0, MAX_FILE_NAME_LEN);
|
||||||
} else {
|
} else {
|
||||||
printf("ERROR: failed to read json, super query result file not found\n");
|
printf("ERROR: failed to read json, super query result file not found\n");
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
|
@ -4440,27 +4468,27 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
|
||||||
if (subrestart && subrestart->type == cJSON_String
|
if (subrestart && subrestart->type == cJSON_String
|
||||||
&& subrestart->valuestring != NULL) {
|
&& subrestart->valuestring != NULL) {
|
||||||
if (0 == strcmp("yes", subrestart->valuestring)) {
|
if (0 == strcmp("yes", subrestart->valuestring)) {
|
||||||
g_queryInfo.superQueryInfo.subscribeRestart = 1;
|
g_queryInfo.superQueryInfo.subscribeRestart = true;
|
||||||
} else if (0 == strcmp("no", subrestart->valuestring)) {
|
} else if (0 == strcmp("no", subrestart->valuestring)) {
|
||||||
g_queryInfo.superQueryInfo.subscribeRestart = 0;
|
g_queryInfo.superQueryInfo.subscribeRestart = false;
|
||||||
} else {
|
} else {
|
||||||
printf("ERROR: failed to read json, subscribe restart error\n");
|
printf("ERROR: failed to read json, subscribe restart error\n");
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_queryInfo.superQueryInfo.subscribeRestart = 1;
|
g_queryInfo.superQueryInfo.subscribeRestart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON* subkeepProgress = cJSON_GetObjectItem(superQuery, "keepProgress");
|
cJSON* superkeepProgress = cJSON_GetObjectItem(superQuery, "keepProgress");
|
||||||
if (subkeepProgress &&
|
if (superkeepProgress &&
|
||||||
subkeepProgress->type == cJSON_String
|
superkeepProgress->type == cJSON_String
|
||||||
&& subkeepProgress->valuestring != NULL) {
|
&& superkeepProgress->valuestring != NULL) {
|
||||||
if (0 == strcmp("yes", subkeepProgress->valuestring)) {
|
if (0 == strcmp("yes", superkeepProgress->valuestring)) {
|
||||||
g_queryInfo.superQueryInfo.subscribeKeepProgress = 1;
|
g_queryInfo.superQueryInfo.subscribeKeepProgress = 1;
|
||||||
} else if (0 == strcmp("no", subkeepProgress->valuestring)) {
|
} else if (0 == strcmp("no", superkeepProgress->valuestring)) {
|
||||||
g_queryInfo.superQueryInfo.subscribeKeepProgress = 0;
|
g_queryInfo.superQueryInfo.subscribeKeepProgress = 0;
|
||||||
} else {
|
} else {
|
||||||
printf("ERROR: failed to read json, subscribe keepProgress error\n");
|
printf("ERROR: failed to read json, subscribe super table keepProgress error\n");
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -7229,17 +7257,21 @@ static void setParaFromArg(){
|
||||||
if (g_Dbs.db[0].superTbls[0].columnCount > g_args.num_of_CPR) {
|
if (g_Dbs.db[0].superTbls[0].columnCount > g_args.num_of_CPR) {
|
||||||
g_Dbs.db[0].superTbls[0].columnCount = g_args.num_of_CPR;
|
g_Dbs.db[0].superTbls[0].columnCount = g_args.num_of_CPR;
|
||||||
} else {
|
} else {
|
||||||
for (int i = g_Dbs.db[0].superTbls[0].columnCount; i < g_args.num_of_CPR; i++) {
|
for (int i = g_Dbs.db[0].superTbls[0].columnCount;
|
||||||
tstrncpy(g_Dbs.db[0].superTbls[0].columns[i].dataType, "INT", MAX_TB_NAME_SIZE);
|
i < g_args.num_of_CPR; i++) {
|
||||||
|
tstrncpy(g_Dbs.db[0].superTbls[0].columns[i].dataType,
|
||||||
|
"INT", MAX_TB_NAME_SIZE);
|
||||||
g_Dbs.db[0].superTbls[0].columns[i].dataLen = 0;
|
g_Dbs.db[0].superTbls[0].columns[i].dataLen = 0;
|
||||||
g_Dbs.db[0].superTbls[0].columnCount++;
|
g_Dbs.db[0].superTbls[0].columnCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstrncpy(g_Dbs.db[0].superTbls[0].tags[0].dataType, "INT", MAX_TB_NAME_SIZE);
|
tstrncpy(g_Dbs.db[0].superTbls[0].tags[0].dataType,
|
||||||
|
"INT", MAX_TB_NAME_SIZE);
|
||||||
g_Dbs.db[0].superTbls[0].tags[0].dataLen = 0;
|
g_Dbs.db[0].superTbls[0].tags[0].dataLen = 0;
|
||||||
|
|
||||||
tstrncpy(g_Dbs.db[0].superTbls[0].tags[1].dataType, "BINARY", MAX_TB_NAME_SIZE);
|
tstrncpy(g_Dbs.db[0].superTbls[0].tags[1].dataType,
|
||||||
|
"BINARY", MAX_TB_NAME_SIZE);
|
||||||
g_Dbs.db[0].superTbls[0].tags[1].dataLen = g_args.len_of_binary;
|
g_Dbs.db[0].superTbls[0].tags[1].dataLen = g_args.len_of_binary;
|
||||||
g_Dbs.db[0].superTbls[0].tagCount = 2;
|
g_Dbs.db[0].superTbls[0].tagCount = 2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -340,8 +340,11 @@ static void vnodeFlowCtrlMsgToWQueue(void *param, void *tmrId) {
|
||||||
if (pWrite->processedCount >= 100) {
|
if (pWrite->processedCount >= 100) {
|
||||||
vError("vgId:%d, msg:%p, failed to process since %s, retry:%d", pVnode->vgId, pWrite, tstrerror(code),
|
vError("vgId:%d, msg:%p, failed to process since %s, retry:%d", pVnode->vgId, pWrite, tstrerror(code),
|
||||||
pWrite->processedCount);
|
pWrite->processedCount);
|
||||||
pWrite->processedCount = 1;
|
void *handle = pWrite->rpcMsg.handle;
|
||||||
dnodeSendRpcVWriteRsp(pWrite->pVnode, pWrite, code);
|
taosFreeQitem(pWrite);
|
||||||
|
vnodeRelease(pVnode);
|
||||||
|
SRpcMsg rpcRsp = {.handle = handle, .code = code};
|
||||||
|
rpcSendResponse(&rpcRsp);
|
||||||
} else {
|
} else {
|
||||||
code = vnodePerformFlowCtrl(pWrite);
|
code = vnodePerformFlowCtrl(pWrite);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ function runQueryPerfTest {
|
||||||
|
|
||||||
python3 tools/taosdemoPerformance.py -c $LOCAL_COMMIT | tee -a $PERFORMANCE_TEST_REPORT
|
python3 tools/taosdemoPerformance.py -c $LOCAL_COMMIT | tee -a $PERFORMANCE_TEST_REPORT
|
||||||
|
|
||||||
python3 perfbenchmark/joinPerformance.py | tee -a $PERFORMANCE_TEST_REPORT
|
#python3 perfbenchmark/joinPerformance.py | tee -a $PERFORMANCE_TEST_REPORT
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ class taosdemoPerformace:
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def insertData(self):
|
def insertData(self):
|
||||||
os.system("taosdemo -f %s > taosdemoperf.txt" % self.generateJson())
|
os.system("taosdemo -f %s > taosdemoperf.txt 2>&1" % self.generateJson())
|
||||||
self.createTableTime = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==1{print $2}'")
|
self.createTableTime = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==1{print $2}'")
|
||||||
self.insertRecordsTime = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $2}'")
|
self.insertRecordsTime = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $2}'")
|
||||||
self.recordsPerSecond = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $16}'")
|
self.recordsPerSecond = self.getCMDOutput("grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $16}'")
|
||||||
|
|
|
@ -68,7 +68,7 @@ while $loop <= $loops
|
||||||
while $i < 10
|
while $i < 10
|
||||||
sql select count(*) from $stb where t1 = $i
|
sql select count(*) from $stb where t1 = $i
|
||||||
if $data00 != $rowNum then
|
if $data00 != $rowNum then
|
||||||
print expect $rowNum, actual: $data00
|
print expect $rowNum , actual: $data00
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
|
|
Loading…
Reference in New Issue