Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6708db1f
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6708db1f
编写于
5月 21, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
5月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6186 from taosdata/feature/m2d
Feature/m2d
上级
972a75c3
50ee6f10
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
122 addition
and
87 deletion
+122
-87
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+1
-1
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+4
-2
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+1
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+13
-15
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+10
-11
src/kit/taosdemo/subscribe.json
src/kit/taosdemo/subscribe.json
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+84
-52
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+5
-2
tests/perftest-scripts/perftest-query.sh
tests/perftest-scripts/perftest-query.sh
+1
-1
tests/pytest/tools/taosdemoPerformance.py
tests/pytest/tools/taosdemoPerformance.py
+1
-1
tests/script/general/parser/commit.sim
tests/script/general/parser/commit.sim
+1
-1
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
6708db1f
...
...
@@ -307,7 +307,7 @@ STableMeta* createSuperTableMeta(STableMetaMsg* pChild);
uint32_t
tscGetTableMetaSize
(
STableMeta
*
pTableMeta
);
CChildTableMeta
*
tscCreateChildMeta
(
STableMeta
*
pTableMeta
);
uint32_t
tscGetTableMetaMaxSize
();
int32_t
tscCreateTableMetaFrom
CChild
Meta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
);
int32_t
tscCreateTableMetaFrom
STable
Meta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
);
STableMeta
*
tscTableMetaDup
(
STableMeta
*
pTableMeta
);
int32_t
tscCreateQueryFromQueryInfo
(
SQueryInfo
*
pQueryInfo
,
SQueryAttr
*
pQueryAttr
,
void
*
addr
);
...
...
src/client/inc/tsclient.h
浏览文件 @
6708db1f
...
...
@@ -68,14 +68,16 @@ typedef struct CChildTableMeta {
int32_t
vgId
;
STableId
id
;
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
;
typedef
struct
STableMeta
{
int32_t
vgId
;
STableId
id
;
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
tversion
;
STableComInfo
tableInfo
;
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
6708db1f
...
...
@@ -94,6 +94,7 @@ STableMeta* tscCreateTableMetaFromMsg(STableMetaMsg* pTableMetaMsg) {
pTableMeta
->
tableType
=
pTableMetaMsg
->
tableType
;
pTableMeta
->
vgId
=
pTableMetaMsg
->
vgroup
.
vgId
;
pTableMeta
->
suid
=
pTableMetaMsg
->
suid
;
pTableMeta
->
tableInfo
=
(
STableComInfo
)
{
.
numOfTags
=
pTableMetaMsg
->
numOfTags
,
...
...
src/client/src/tscServer.c
浏览文件 @
6708db1f
...
...
@@ -1828,13 +1828,13 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int
tscProcessTableMetaRsp
(
SSqlObj
*
pSql
)
{
STableMetaMsg
*
pMetaMsg
=
(
STableMetaMsg
*
)
pSql
->
res
.
pRsp
;
pMetaMsg
->
tid
=
htonl
(
pMetaMsg
->
tid
);
pMetaMsg
->
sversion
=
htons
(
pMetaMsg
->
sversion
);
pMetaMsg
->
tversion
=
htons
(
pMetaMsg
->
tversion
);
pMetaMsg
->
tid
=
htonl
(
pMetaMsg
->
tid
);
pMetaMsg
->
sversion
=
htons
(
pMetaMsg
->
sversion
);
pMetaMsg
->
tversion
=
htons
(
pMetaMsg
->
tversion
);
pMetaMsg
->
vgroup
.
vgId
=
htonl
(
pMetaMsg
->
vgroup
.
vgId
);
pMetaMsg
->
uid
=
htobe64
(
pMetaMsg
->
uid
)
;
pMetaMsg
->
contLen
=
htons
(
pMetaMsg
->
contLen
);
pMetaMsg
->
uid
=
htobe64
(
pMetaMsg
->
uid
);
pMetaMsg
->
suid
=
pMetaMsg
->
suid
;
pMetaMsg
->
contLen
=
htons
(
pMetaMsg
->
contLen
);
pMetaMsg
->
numOfColumns
=
htons
(
pMetaMsg
->
numOfColumns
);
if
((
pMetaMsg
->
tableType
!=
TSDB_SUPER_TABLE
)
&&
...
...
@@ -2448,19 +2448,16 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
pTableMetaInfo
->
pTableMeta
=
calloc
(
1
,
size
);
pTableMetaInfo
->
tableMetaSize
=
size
;
}
else
if
(
pTableMetaInfo
->
tableMetaSize
<
size
)
{
char
*
tmp
=
realloc
(
pTableMetaInfo
->
pTableMeta
,
size
);
if
(
tmp
==
NULL
)
{
char
*
tmp
=
realloc
(
pTableMetaInfo
->
pTableMeta
,
size
);
if
(
tmp
==
NULL
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
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
->
tableInfo
.
numOfColumns
=
-
1
;
...
...
@@ -2476,8 +2473,9 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
STableMeta
*
pMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
pMeta
->
id
.
uid
>
0
)
{
// in case of child table, here only get the
if
(
pMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
int32_t
code
=
tscCreateTableMetaFrom
CChild
Meta
(
pTableMetaInfo
->
pTableMeta
,
name
,
buf
);
int32_t
code
=
tscCreateTableMetaFrom
STable
Meta
(
pTableMetaInfo
->
pTableMeta
,
name
,
buf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
getTableMetaFromMnode
(
pSql
,
pTableMetaInfo
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
6708db1f
...
...
@@ -3370,22 +3370,25 @@ CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta) {
assert
(
pTableMeta
!=
NULL
);
CChildTableMeta
*
cMeta
=
calloc
(
1
,
sizeof
(
CChildTableMeta
));
cMeta
->
tableType
=
TSDB_CHILD_TABLE
;
cMeta
->
vgId
=
pTableMeta
->
vgId
;
cMeta
->
id
=
pTableMeta
->
id
;
cMeta
->
vgId
=
pTableMeta
->
vgId
;
cMeta
->
id
=
pTableMeta
->
id
;
cMeta
->
suid
=
pTableMeta
->
suid
;
tstrncpy
(
cMeta
->
sTableName
,
pTableMeta
->
sTableName
,
TSDB_TABLE_FNAME_LEN
);
return
cMeta
;
}
int32_t
tscCreateTableMetaFrom
CChild
Meta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
)
{
int32_t
tscCreateTableMetaFrom
STable
Meta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
)
{
assert
(
pChild
!=
NULL
&&
buf
!=
NULL
);
// uint32_t size = tscGetTableMetaMaxSize();
STableMeta
*
p
=
buf
;
//calloc(1, size);
STableMeta
*
p
=
buf
;
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
->
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
;
memcpy
(
pChild
->
schema
,
p
->
schema
,
sizeof
(
SSchema
)
*
total
);
// tfree(p);
return
TSDB_CODE_SUCCESS
;
}
else
{
// super table has been removed, current tableMeta is also expired. remove it here
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
// tfree(p);
return
-
1
;
}
}
...
...
src/kit/taosdemo/subscribe.json
浏览文件 @
6708db1f
{
"filetype"
:
"subscribe"
,
"filetype"
:
"subscribe"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
6708db1f
...
...
@@ -247,7 +247,7 @@ typedef struct SColumn_S {
char
field
[
TSDB_COL_NAME_LEN
+
1
];
char
dataType
[
MAX_TB_NAME_SIZE
];
uint32_t
dataLen
;
char
note
[
128
];
char
note
[
128
];
}
StrColumn
;
typedef
struct
SSuperTable_S
{
...
...
@@ -380,7 +380,7 @@ typedef struct SpecifiedQueryInfo_S {
uint32_t
asyncMode
;
// 0: sync, 1: async
uint64_t
subscribeInterval
;
// ms
uint64_t
queryTimes
;
int
subscribeRestart
;
bool
subscribeRestart
;
int
subscribeKeepProgress
;
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
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
asyncMode
;
// 0: sync, 1: async
uint64_t
subscribeInterval
;
// ms
int
subscribeRestart
;
bool
subscribeRestart
;
int
subscribeKeepProgress
;
uint64_t
queryTimes
;
int64_t
childTblCount
;
...
...
@@ -545,8 +545,8 @@ static void prompt();
static
int
createDatabasesAndStables
();
static
void
createChildTables
();
static
int
queryDbExec
(
TAOS
*
taos
,
char
*
command
,
QUERY_TYPE
type
,
bool
quiet
);
static
int
postProceSql
(
char
*
host
,
struct
sockaddr_in
*
pServAddr
,
uint16_t
port
,
char
*
sqlstr
,
char
*
resultFile
);
static
int
postProceSql
(
char
*
host
,
struct
sockaddr_in
*
pServAddr
,
uint16_t
port
,
char
*
sqlstr
,
char
*
resultFile
);
/* ************ Global variables ************ */
...
...
@@ -1347,13 +1347,15 @@ static int printfInsertMeta() {
printf
(
"interface:
\033
[33m%s
\033
[0m
\n
"
,
(
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
(
"password:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
password
);
printf
(
"configDir:
\033
[33m%s
\033
[0m
\n
"
,
configDir
);
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 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
"
,
g_args
.
insert_interval
);
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
++
)
{
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
)
{
printf
(
" drop:
\033
[33mno
\033
[0m
\n
"
);
}
else
{
...
...
@@ -1373,40 +1376,51 @@ static int printfInsertMeta() {
}
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
)
{
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
)
{
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
)
{
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
)
{
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
)
{
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
)
{
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
)
{
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
)
{
printf
(
" comp:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
dbCfg
.
comp
);
}
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
)
{
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
)
{
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
((
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
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
"ms"
,
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
{
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
);
for
(
uint64_t
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
fprintf
(
fp
,
" super table[%"
PRIu64
"]:
\n
"
,
j
);
fprintf
(
fp
,
" super table count: %"
PRIu64
"
\n
"
,
g_Dbs
.
db
[
i
].
superTblCount
);
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
)
{
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"
);
}
else
{
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
)
{
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"
);
}
else
{
fprintf
(
fp
,
" childTblExists: %s
\n
"
,
"error"
);
...
...
@@ -1679,7 +1699,8 @@ static void printfInsertMetaToFile(FILE* fp) {
if
((
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
"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"
))))
{
fprintf
(
fp
,
"column[%d]:%s(%d) "
,
k
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
columns
[
k
].
dataType
,
...
...
@@ -1699,7 +1720,8 @@ static void printfInsertMetaToFile(FILE* fp) {
"binary"
,
strlen
(
"binary"
)))
||
(
0
==
strncasecmp
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tags
[
k
].
dataType
,
"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
);
}
else
{
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"
);
if
(
specifiedQueryTimes
&&
specifiedQueryTimes
->
type
==
cJSON_Number
)
{
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
);
goto
PARSE_OVER
;
...
...
@@ -4223,7 +4246,8 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
concurrent
=
cJSON_GetObjectItem
(
specifiedQuery
,
"concurrent"
);
if
(
concurrent
&&
concurrent
->
type
==
cJSON_Number
)
{
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__
,
g_queryInfo
.
specifiedQueryInfo
.
sqlCount
,
g_queryInfo
.
specifiedQueryInfo
.
concurrent
);
...
...
@@ -4262,15 +4286,15 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
restart
=
cJSON_GetObjectItem
(
specifiedQuery
,
"restart"
);
if
(
restart
&&
restart
->
type
==
cJSON_String
&&
restart
->
valuestring
!=
NULL
)
{
if
(
0
==
strcmp
(
"yes"
,
restart
->
valuestring
))
{
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
1
;
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
true
;
}
else
if
(
0
==
strcmp
(
"no"
,
restart
->
valuestring
))
{
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
0
;
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
false
;
}
else
{
printf
(
"ERROR: failed to read json, subscribe restart error
\n
"
);
goto
PARSE_OVER
;
}
}
else
{
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
1
;
g_queryInfo
.
specifiedQueryInfo
.
subscribeRestart
=
true
;
}
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
"
);
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_GetObjectItem
(
specifiedQuery
,
"resubAfterConsume"
);
...
...
@@ -4330,10 +4355,13 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
}
cJSON
*
result
=
cJSON_GetObjectItem
(
sql
,
"result"
);
if
(
NULL
!=
result
&&
result
->
type
==
cJSON_String
&&
result
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_queryInfo
.
specifiedQueryInfo
.
result
[
j
],
result
->
valuestring
,
MAX_FILE_NAME_LEN
);
if
((
NULL
!=
result
)
&&
(
result
->
type
==
cJSON_String
)
&&
(
result
->
valuestring
!=
NULL
))
{
tstrncpy
(
g_queryInfo
.
specifiedQueryInfo
.
result
[
j
],
result
->
valuestring
,
MAX_FILE_NAME_LEN
);
}
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
{
printf
(
"ERROR: failed to read json, super query result file not found
\n
"
);
goto
PARSE_OVER
;
...
...
@@ -4440,27 +4468,27 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
if
(
subrestart
&&
subrestart
->
type
==
cJSON_String
&&
subrestart
->
valuestring
!=
NULL
)
{
if
(
0
==
strcmp
(
"yes"
,
subrestart
->
valuestring
))
{
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
1
;
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
true
;
}
else
if
(
0
==
strcmp
(
"no"
,
subrestart
->
valuestring
))
{
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
0
;
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
false
;
}
else
{
printf
(
"ERROR: failed to read json, subscribe restart error
\n
"
);
goto
PARSE_OVER
;
}
}
else
{
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
1
;
g_queryInfo
.
superQueryInfo
.
subscribeRestart
=
true
;
}
cJSON
*
su
b
keepProgress
=
cJSON_GetObjectItem
(
superQuery
,
"keepProgress"
);
if
(
su
b
keepProgress
&&
su
b
keepProgress
->
type
==
cJSON_String
&&
su
b
keepProgress
->
valuestring
!=
NULL
)
{
if
(
0
==
strcmp
(
"yes"
,
su
b
keepProgress
->
valuestring
))
{
cJSON
*
su
per
keepProgress
=
cJSON_GetObjectItem
(
superQuery
,
"keepProgress"
);
if
(
su
per
keepProgress
&&
su
per
keepProgress
->
type
==
cJSON_String
&&
su
per
keepProgress
->
valuestring
!=
NULL
)
{
if
(
0
==
strcmp
(
"yes"
,
su
per
keepProgress
->
valuestring
))
{
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
=
1
;
}
else
if
(
0
==
strcmp
(
"no"
,
su
b
keepProgress
->
valuestring
))
{
}
else
if
(
0
==
strcmp
(
"no"
,
su
per
keepProgress
->
valuestring
))
{
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
=
0
;
}
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
;
}
}
else
{
...
...
@@ -7229,17 +7257,21 @@ static void setParaFromArg(){
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
;
}
else
{
for
(
int
i
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
;
i
<
g_args
.
num_of_CPR
;
i
++
)
{
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
"INT"
,
MAX_TB_NAME_SIZE
);
for
(
int
i
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
;
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
].
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
;
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
].
tagCount
=
2
;
}
else
{
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
6708db1f
...
...
@@ -340,8 +340,11 @@ static void vnodeFlowCtrlMsgToWQueue(void *param, void *tmrId) {
if
(
pWrite
->
processedCount
>=
100
)
{
vError
(
"vgId:%d, msg:%p, failed to process since %s, retry:%d"
,
pVnode
->
vgId
,
pWrite
,
tstrerror
(
code
),
pWrite
->
processedCount
);
pWrite
->
processedCount
=
1
;
dnodeSendRpcVWriteRsp
(
pWrite
->
pVnode
,
pWrite
,
code
);
void
*
handle
=
pWrite
->
rpcMsg
.
handle
;
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
SRpcMsg
rpcRsp
=
{.
handle
=
handle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
}
else
{
code
=
vnodePerformFlowCtrl
(
pWrite
);
if
(
code
==
0
)
{
...
...
tests/perftest-scripts/perftest-query.sh
浏览文件 @
6708db1f
...
...
@@ -74,7 +74,7 @@ function runQueryPerfTest {
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
}
...
...
tests/pytest/tools/taosdemoPerformance.py
浏览文件 @
6708db1f
...
...
@@ -104,7 +104,7 @@ class taosdemoPerformace:
return
output
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
.
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}'"
)
...
...
tests/script/general/parser/commit.sim
浏览文件 @
6708db1f
...
...
@@ -68,7 +68,7 @@ while $loop <= $loops
while $i < 10
sql select count(*) from $stb where t1 = $i
if $data00 != $rowNum then
print expect $rowNum, actual: $data00
print expect $rowNum
, actual: $data00
return -1
endi
$i = $i + 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录