Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1cdacd2a
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
1cdacd2a
编写于
12月 13, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
12月 13, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9055 from taosdata/feature/dnode3
Feature/dnode3
上级
97344d84
0a810dd6
变更
44
展开全部
隐藏空白更改
内联
并排
Showing
44 changed file
with
1313 addition
and
198 deletion
+1313
-198
include/common/taosmsg.h
include/common/taosmsg.h
+27
-21
include/common/tglobal.h
include/common/tglobal.h
+0
-1
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+0
-1
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+0
-1
include/dnode/mnode/sdb/sdb.h
include/dnode/mnode/sdb/sdb.h
+2
-2
include/util/taoserror.h
include/util/taoserror.h
+24
-13
include/util/tdef.h
include/util/tdef.h
+2
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+2
-14
source/dnode/mgmt/daemon/src/daemon.c
source/dnode/mgmt/daemon/src/daemon.c
+0
-1
source/dnode/mgmt/impl/inc/dndDnode.h
source/dnode/mgmt/impl/inc/dndDnode.h
+1
-0
source/dnode/mgmt/impl/inc/dndInt.h
source/dnode/mgmt/impl/inc/dndInt.h
+2
-1
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+21
-11
source/dnode/mgmt/impl/src/dndMnode.c
source/dnode/mgmt/impl/src/dndMnode.c
+0
-1
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+13
-14
source/dnode/mgmt/impl/src/dnode.c
source/dnode/mgmt/impl/src/dnode.c
+3
-2
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+1
-0
source/dnode/mgmt/impl/test/cluster/cluster.cpp
source/dnode/mgmt/impl/test/cluster/cluster.cpp
+1
-1
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
+29
-0
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+370
-0
source/dnode/mgmt/impl/test/profile/profile.cpp
source/dnode/mgmt/impl/test/profile/profile.cpp
+3
-3
source/dnode/mgmt/impl/test/show/show.cpp
source/dnode/mgmt/impl/test/show/show.cpp
+1
-1
source/dnode/mgmt/impl/test/sut/deploy.cpp
source/dnode/mgmt/impl/test/sut/deploy.cpp
+9
-9
source/dnode/mgmt/impl/test/sut/deploy.h
source/dnode/mgmt/impl/test/sut/deploy.h
+4
-1
source/dnode/mgmt/impl/test/user/user.cpp
source/dnode/mgmt/impl/test/user/user.cpp
+3
-2
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+4
-5
source/dnode/mnode/impl/inc/mndInt.h
source/dnode/mnode/impl/inc/mndInt.h
+2
-0
source/dnode/mnode/impl/inc/mndStb.h
source/dnode/mnode/impl/inc/mndStb.h
+5
-5
source/dnode/mnode/impl/src/mndCluster.c
source/dnode/mnode/impl/src/mndCluster.c
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+1
-1
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+58
-51
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+1
-1
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+1
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+1
-1
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+675
-0
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+1
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+3
-3
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+10
-4
source/libs/parser/inc/astGenerator.h
source/libs/parser/inc/astGenerator.h
+1
-1
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+2
-2
source/libs/parser/src/astGenerator.c
source/libs/parser/src/astGenerator.c
+1
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+2
-2
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+13
-6
source/util/src/terror.c
source/util/src/terror.c
+12
-11
src/client/inc/tscParseLine.h
src/client/inc/tscParseLine.h
+1
-1
未找到文件。
include/common/taosmsg.h
浏览文件 @
1cdacd2a
...
...
@@ -74,10 +74,10 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_COMPACT_DB, "compact-db" )
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CREATE_FUNCTION
,
"create-function"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_RETRIEVE_FUNCTION
,
"retrieve-function"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DROP_FUNCTION
,
"drop-function"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CREATE_ST
ABLE
,
"create-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ALTER_ST
ABLE
,
"alter-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DROP_ST
ABLE
,
"drop-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ST
ABLE_VGROUP
,
"stable
-vgroup"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CREATE_ST
B
,
"create-stb
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ALTER_ST
B
,
"alter-stb
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DROP_ST
B
,
"drop-stb
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ST
B_VGROUP
,
"stb
-vgroup"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_KILL_QUERY
,
"kill-query"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_KILL_STREAM
,
"kill-stream"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_KILL_CONN
,
"kill-conn"
)
...
...
@@ -94,9 +94,9 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_NETWORK_TEST, "nettest" )
// message from vnode to dnode
// message from mnode to vnode
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CREATE_ST
ABLE_IN
,
"create-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ALTER_ST
ABLE_IN
,
"alter-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DROP_ST
ABLE_IN
,
"drop-stable
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_CREATE_ST
B_IN
,
"create-stb-in
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_ALTER_ST
B_IN
,
"alter-stb-in
"
)
TAOS_DEFINE_MESSAGE_TYPE
(
TSDB_MSG_TYPE_DROP_ST
B_IN
,
"drop-stb-in
"
)
// message from mnode to mnode
// message from mnode to qnode
// message from mnode to dnode
...
...
@@ -159,7 +159,7 @@ typedef enum _mgmt_table {
TSDB_MGMT_TABLE_DNODE
,
TSDB_MGMT_TABLE_MNODE
,
TSDB_MGMT_TABLE_VGROUP
,
TSDB_MGMT_TABLE_ST
ABLE
,
TSDB_MGMT_TABLE_ST
B
,
TSDB_MGMT_TABLE_MODULE
,
TSDB_MGMT_TABLE_QUERIES
,
TSDB_MGMT_TABLE_STREAMS
,
...
...
@@ -294,7 +294,7 @@ typedef struct {
uint64_t
superTableUid
;
uint64_t
createdTime
;
char
tableFname
[
TSDB_TABLE_FNAME_LEN
];
char
st
able
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
st
b
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
data
[];
}
SMDCreateTableMsg
;
...
...
@@ -311,16 +311,23 @@ typedef struct {
}
SCreateTableMsg
;
typedef
struct
{
int32_t
numOfTables
;
int32_t
contLen
;
}
SCMCreateTableMsg
;
char
name
[
TSDB_TABLE_FNAME_LEN
];
int8_t
igExists
;
int32_t
numOfTags
;
int32_t
numOfColumns
;
SSchema
pSchema
[];
}
SCreateStbMsg
;
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
// if user specify DROP STABLE, this flag will be set. And an error will be returned if it is not a super table
int8_t
supertable
;
int8_t
igNotExists
;
}
SCMDropTableMsg
;
}
SDropStbMsg
;
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
int8_t
alterType
;
SSchema
schema
;
}
SAlterStbMsg
;
typedef
struct
{
char
tableFname
[
TSDB_TABLE_FNAME_LEN
];
...
...
@@ -663,7 +670,6 @@ typedef struct {
typedef
struct
{
int32_t
statusInterval
;
int32_t
mnodeEqualVnodeNum
;
int64_t
checkTime
;
// 1970-01-01 00:00:00.000
char
timezone
[
TSDB_TIMEZONE_LEN
];
// tsTimezone
char
locale
[
TSDB_LOCALE_LEN
];
// tsLocale
...
...
@@ -689,7 +695,7 @@ typedef struct SStatusMsg {
int32_t
sver
;
int32_t
dnodeId
;
int32_t
clusterId
;
uint32_t
rebootTime
;
// time stamp for last reboot
int64_t
rebootTime
;
// time stamp for last reboot
int16_t
numOfCores
;
int16_t
numOfSupportMnodes
;
int16_t
numOfSupportVnodes
;
...
...
@@ -765,7 +771,7 @@ typedef struct {
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
}
SSt
able
InfoMsg
;
}
SSt
b
InfoMsg
;
typedef
struct
{
char
tableFname
[
TSDB_TABLE_FNAME_LEN
];
...
...
@@ -797,8 +803,8 @@ typedef struct {
}
SVgroupsMsg
,
SVgroupsInfo
;
typedef
struct
{
char
t
able
Fname
[
TSDB_TABLE_FNAME_LEN
];
// table id
char
st
able
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
t
b
Fname
[
TSDB_TABLE_FNAME_LEN
];
// table id
char
st
b
Fname
[
TSDB_TABLE_FNAME_LEN
];
int32_t
numOfTags
;
int32_t
numOfColumns
;
int8_t
precision
;
...
...
@@ -862,7 +868,7 @@ typedef struct {
typedef
struct
{
int32_t
dnodeId
;
char
config
[
128
];
char
config
[
TSDB_DNODE_CONFIG_LEN
];
}
SCfgDnodeMsg
;
typedef
struct
{
...
...
include/common/tglobal.h
浏览文件 @
1cdacd2a
...
...
@@ -108,7 +108,6 @@ extern int8_t tsEnableBalance;
extern
int8_t
tsAlternativeRole
;
extern
int32_t
tsBalanceInterval
;
extern
int32_t
tsOfflineThreshold
;
extern
int32_t
tsMnodeEqualVnodeNum
;
extern
int8_t
tsEnableFlowCtrl
;
extern
int8_t
tsEnableSlaveQuery
;
extern
int8_t
tsEnableAdjustMaster
;
...
...
include/dnode/mgmt/dnode.h
浏览文件 @
1cdacd2a
...
...
@@ -33,7 +33,6 @@ typedef struct {
int16_t
numOfSupportQnodes
;
int8_t
enableTelem
;
int32_t
statusInterval
;
int32_t
mnodeEqualVnodeNum
;
float
numOfThreadsPerCore
;
float
ratioOfQueryCores
;
int32_t
maxShellConns
;
...
...
include/dnode/mnode/mnode.h
浏览文件 @
1cdacd2a
...
...
@@ -47,7 +47,6 @@ typedef struct SMnodeCfg {
int32_t
sver
;
int8_t
enableTelem
;
int32_t
statusInterval
;
int32_t
mnodeEqualVnodeNum
;
int32_t
shellActivityTimer
;
char
*
timezone
;
char
*
locale
;
...
...
include/dnode/mnode/sdb/sdb.h
浏览文件 @
1cdacd2a
...
...
@@ -158,8 +158,8 @@ typedef enum {
SDB_USER
=
5
,
SDB_AUTH
=
6
,
SDB_ACCT
=
7
,
SDB_VGROUP
=
9
,
SDB_ST
ABLE
=
9
,
SDB_VGROUP
=
8
,
SDB_ST
B
=
9
,
SDB_DB
=
10
,
SDB_FUNC
=
11
,
SDB_MAX
=
12
...
...
include/util/taoserror.h
浏览文件 @
1cdacd2a
...
...
@@ -152,22 +152,23 @@ int32_t* taosGetErrno();
#define TSDB_CODE_SDB_INVALID_DATA_LEN TAOS_DEF_ERROR_CODE(0, 0x032A)
#define TSDB_CODE_SDB_INVALID_DATA_CONTENT TAOS_DEF_ERROR_CODE(0, 0x032B)
#define TSDB_CODE_MND_DNODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0330) //"DNode already exists")
#define TSDB_CODE_MND_DNODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0331) //"DNode does not exist")
// mnode-dnode
#define TSDB_CODE_MND_DNODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0330)
#define TSDB_CODE_MND_DNODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0331)
#define TSDB_CODE_MND_NO_ENOUGH_DNODES TAOS_DEF_ERROR_CODE(0, 0x0332)
#define TSDB_CODE_MND_INVALID_CLUSTER_CFG TAOS_DEF_ERROR_CODE(0, 0x0333)
#define TSDB_CODE_MND_INVALID_CLUSTER_ID TAOS_DEF_ERROR_CODE(0, 0x0334)
#define TSDB_CODE_MND_INVALID_DNODE_CFG TAOS_DEF_ERROR_CODE(0, 0x0335)
#define TSDB_CODE_MND_INVALID_DNODE_EP TAOS_DEF_ERROR_CODE(0, 0x0336)
#define TSDB_CODE_MND_INVALID_DNODE_ID TAOS_DEF_ERROR_CODE(0, 0x0337)
// mnode-vgroup
#define TSDB_CODE_MND_VGROUP_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0332) //"VGroup does not exist")
#define TSDB_CODE_MND_NO_REMOVE_MASTER TAOS_DEF_ERROR_CODE(0, 0x0333) //"Master DNode cannot be removed")
#define TSDB_CODE_MND_NO_ENOUGH_DNODES TAOS_DEF_ERROR_CODE(0, 0x0334) //"Out of DNodes")
#define TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT TAOS_DEF_ERROR_CODE(0, 0x0335) //"Cluster cfg inconsistent")
#define TSDB_CODE_MND_INVALID_DNODE_CFG_OPTION TAOS_DEF_ERROR_CODE(0, 0x0336) //"Invalid dnode cfg option")
#define TSDB_CODE_MND_BALANCE_ENABLED TAOS_DEF_ERROR_CODE(0, 0x0337) //"Balance already enabled")
#define TSDB_CODE_MND_VGROUP_NOT_IN_DNODE TAOS_DEF_ERROR_CODE(0, 0x0338) //"Vgroup not in dnode")
#define TSDB_CODE_MND_VGROUP_ALREADY_IN_DNODE TAOS_DEF_ERROR_CODE(0, 0x0339) //"Vgroup already in dnode")
#define TSDB_CODE_MND_DNODE_NOT_FREE TAOS_DEF_ERROR_CODE(0, 0x033A) //"Dnode not avaliable")
#define TSDB_CODE_MND_INVALID_CLUSTER_ID TAOS_DEF_ERROR_CODE(0, 0x033B) //"Cluster id not match")
#define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x033C) //"Cluster not ready")
#define TSDB_CODE_MND_DNODE_ID_NOT_CONFIGURED TAOS_DEF_ERROR_CODE(0, 0x033D) //"Dnode Id not configured")
#define TSDB_CODE_MND_DNODE_EP_NOT_CONFIGURED TAOS_DEF_ERROR_CODE(0, 0x033E) //"Dnode Ep not configured")
// mnode-acct
#define TSDB_CODE_MND_ACCT_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0340) //"Account already exists")
#define TSDB_CODE_MND_ACCT_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0341) //"Invalid account")
#define TSDB_CODE_MND_INVALID_ACCT_OPTION TAOS_DEF_ERROR_CODE(0, 0x0342) //"Invalid account options")
...
...
@@ -183,8 +184,18 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_MNODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0348) //"Mnode already exists")
#define TSDB_CODE_MND_MNODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0349) //"Mnode not there")
// mnode-table
#define TSDB_CODE_MND_TABLE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0360) //"Table already exists")
// mnode-stable
#define TSDB_CODE_MND_STB_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_IGEXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COLS_NUM TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_TAGS_NUM TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_TYPE TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_ID TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_BYTES TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_NAME TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0361) //"Table name too long")
#define TSDB_CODE_MND_INVALID_TABLE_NAME TAOS_DEF_ERROR_CODE(0, 0x0362) //"Table does not exist")
#define TSDB_CODE_MND_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0363) //"Invalid table type in tsdb")
...
...
include/util/tdef.h
浏览文件 @
1cdacd2a
...
...
@@ -209,6 +209,8 @@ do { \
#define TSDB_STEP_NAME_LEN 32
#define TSDB_STEP_DESC_LEN 128
#define TSDB_DNODE_CONFIG_LEN 128
#define TSDB_MQTT_HOSTNAME_LEN 64
#define TSDB_MQTT_PORT_LEN 8
#define TSDB_MQTT_USER_LEN 24
...
...
source/common/src/tglobal.c
浏览文件 @
1cdacd2a
...
...
@@ -46,7 +46,7 @@ int64_t tsDnodeStartTime = 0;
// common
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcForceTcp
=
0
;
//disable this, means query, show command use udp protocol as default
int32_t
tsRpcForceTcp
=
1
;
//disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxConnections
=
5000
;
int32_t
tsShellActivityTimer
=
3
;
// second
...
...
@@ -156,7 +156,6 @@ int8_t tsEnableBalance = 1;
int8_t
tsAlternativeRole
=
0
;
int32_t
tsBalanceInterval
=
300
;
// seconds
int32_t
tsOfflineThreshold
=
86400
*
10
;
// seconds of 10 days
int32_t
tsMnodeEqualVnodeNum
=
4
;
int8_t
tsEnableFlowCtrl
=
1
;
int8_t
tsEnableSlaveQuery
=
1
;
int8_t
tsEnableAdjustMaster
=
1
;
...
...
@@ -1072,17 +1071,6 @@ static void doInitGlobalConfig(void) {
cfg
.
maxValue
=
10000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_GB
;
taosInitConfigOption
(
cfg
);
// module configs
cfg
.
option
=
"mnodeEqualVnodeNum"
;
cfg
.
ptr
=
&
tsMnodeEqualVnodeNum
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
1000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// module configs
...
...
@@ -1595,7 +1583,7 @@ static void doInitGlobalConfig(void) {
taosInitConfigOption
(
cfg
);
assert
(
tsGlobalConfigNum
==
TSDB_CFG_MAX_NUM
);
#else
assert
(
tsGlobalConfigNum
==
TSDB_CFG_MAX_NUM
-
5
);
//
assert(tsGlobalConfigNum == TSDB_CFG_MAX_NUM - 5);
#endif
}
...
...
source/dnode/mgmt/daemon/src/daemon.c
浏览文件 @
1cdacd2a
...
...
@@ -142,7 +142,6 @@ void dmnInitOption(SDnodeOpt *pOption) {
pOption
->
numOfSupportVnodes
=
1
;
pOption
->
numOfSupportQnodes
=
1
;
pOption
->
statusInterval
=
tsStatusInterval
;
pOption
->
mnodeEqualVnodeNum
=
tsMnodeEqualVnodeNum
;
pOption
->
numOfThreadsPerCore
=
tsNumOfThreadsPerCore
;
pOption
->
ratioOfQueryCores
=
tsRatioOfQueryCores
;
pOption
->
maxShellConns
=
tsMaxShellConns
;
...
...
source/dnode/mgmt/impl/inc/dndDnode.h
浏览文件 @
1cdacd2a
...
...
@@ -31,6 +31,7 @@ int32_t dndGetClusterId(SDnode *pDnode);
void
dndGetDnodeEp
(
SDnode
*
pDnode
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dndGetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
);
void
dndSendRedirectMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dndSendStatusMsg
(
SDnode
*
pDnode
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/impl/inc/dndInt.h
浏览文件 @
1cdacd2a
...
...
@@ -58,7 +58,8 @@ typedef struct {
int32_t
dnodeId
;
int32_t
dropped
;
int32_t
clusterId
;
uint32_t
rebootTime
;
int64_t
rebootTime
;
int8_t
statusSent
;
SEpSet
mnodeEpSet
;
char
*
file
;
SHashObj
*
dnodeHash
;
...
...
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
1cdacd2a
...
...
@@ -335,7 +335,7 @@ static int32_t dndWriteDnodes(SDnode *pDnode) {
return
0
;
}
static
void
dndSendStatusMsg
(
SDnode
*
pDnode
)
{
void
dndSendStatusMsg
(
SDnode
*
pDnode
)
{
int32_t
contLen
=
sizeof
(
SStatusMsg
)
+
TSDB_MAX_VNODES
*
sizeof
(
SVnodeLoad
);
SStatusMsg
*
pStatus
=
rpcMallocCont
(
contLen
);
...
...
@@ -349,7 +349,7 @@ static void dndSendStatusMsg(SDnode *pDnode) {
pStatus
->
sver
=
htonl
(
pDnode
->
opt
.
sver
);
pStatus
->
dnodeId
=
htonl
(
pMgmt
->
dnodeId
);
pStatus
->
clusterId
=
htonl
(
pMgmt
->
clusterId
);
pStatus
->
rebootTime
=
hto
nl
(
pMgmt
->
rebootTime
);
pStatus
->
rebootTime
=
hto
be64
(
pMgmt
->
rebootTime
);
pStatus
->
numOfCores
=
htons
(
pDnode
->
opt
.
numOfCores
);
pStatus
->
numOfSupportMnodes
=
htons
(
pDnode
->
opt
.
numOfCores
);
pStatus
->
numOfSupportVnodes
=
htons
(
pDnode
->
opt
.
numOfCores
);
...
...
@@ -357,7 +357,6 @@ static void dndSendStatusMsg(SDnode *pDnode) {
tstrncpy
(
pStatus
->
dnodeEp
,
pDnode
->
opt
.
localEp
,
TSDB_EP_LEN
);
pStatus
->
clusterCfg
.
statusInterval
=
htonl
(
pDnode
->
opt
.
statusInterval
);
pStatus
->
clusterCfg
.
mnodeEqualVnodeNum
=
htonl
(
pDnode
->
opt
.
mnodeEqualVnodeNum
);
pStatus
->
clusterCfg
.
checkTime
=
0
;
char
timestr
[
32
]
=
"1970-01-01 00:00:00.00"
;
(
void
)
taosParseTime
(
timestr
,
&
pStatus
->
clusterCfg
.
checkTime
,
(
int32_t
)
strlen
(
timestr
),
TSDB_TIME_PRECISION_MILLI
,
0
);
...
...
@@ -371,6 +370,7 @@ static void dndSendStatusMsg(SDnode *pDnode) {
contLen
=
sizeof
(
SStatusMsg
)
+
pStatus
->
vnodeLoads
.
num
*
sizeof
(
SVnodeLoad
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pStatus
,
.
contLen
=
contLen
,
.
msgType
=
TSDB_MSG_TYPE_STATUS
};
pMgmt
->
statusSent
=
1
;
dndSendMsgToMnode
(
pDnode
,
&
rpcMsg
);
}
...
...
@@ -383,7 +383,7 @@ static void dndUpdateDnodeCfg(SDnode *pDnode, SDnodeCfg *pCfg) {
pMgmt
->
dnodeId
=
pCfg
->
dnodeId
;
pMgmt
->
clusterId
=
pCfg
->
clusterId
;
pMgmt
->
dropped
=
pCfg
->
dropped
;
(
void
)
dndWriteDnodes
(
pDnode
);
dndWriteDnodes
(
pDnode
);
taosWUnLockLatch
(
&
pMgmt
->
latch
);
}
}
...
...
@@ -409,11 +409,16 @@ static void dndUpdateDnodeEps(SDnode *pDnode, SDnodeEps *pDnodeEps) {
}
static
void
dndProcessStatusRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
if
(
pEpSet
&&
pEpSet
->
numOfEps
>
0
)
{
dndUpdateMnodeEpSet
(
pDnode
,
pEpSet
);
}
if
(
pMsg
->
code
!=
TSDB_CODE_SUCCESS
)
return
;
if
(
pMsg
->
code
!=
TSDB_CODE_SUCCESS
)
{
pMgmt
->
statusSent
=
0
;
return
;
}
SStatusRsp
*
pRsp
=
pMsg
->
pCont
;
SDnodeCfg
*
pCfg
=
&
pRsp
->
dnodeCfg
;
...
...
@@ -421,7 +426,10 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
pCfg
->
clusterId
=
htonl
(
pCfg
->
clusterId
);
dndUpdateDnodeCfg
(
pDnode
,
pCfg
);
if
(
pCfg
->
dropped
)
return
;
if
(
pCfg
->
dropped
)
{
pMgmt
->
statusSent
=
0
;
return
;
}
SDnodeEps
*
pDnodeEps
=
&
pRsp
->
dnodeEps
;
pDnodeEps
->
num
=
htonl
(
pDnodeEps
->
num
);
...
...
@@ -431,6 +439,7 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
}
dndUpdateDnodeEps
(
pDnode
,
pDnodeEps
);
pMgmt
->
statusSent
=
0
;
}
static
void
dndProcessAuthRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
assert
(
1
);
}
...
...
@@ -461,16 +470,17 @@ static void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg) {
}
static
void
*
dnodeThreadRoutine
(
void
*
param
)
{
SDnode
*
pDnode
=
param
;
int32_t
ms
=
pDnode
->
opt
.
statusInterval
*
1000
;
SDnode
*
pDnode
=
param
;
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
int32_t
ms
=
pDnode
->
opt
.
statusInterval
*
1000
;
while
(
true
)
{
taosMsleep
(
ms
);
pthread_testcancel
();
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_RUNNING
)
{
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_RUNNING
&&
!
pMgmt
->
statusSent
)
{
dndSendStatusMsg
(
pDnode
);
}
taosMsleep
(
ms
);
}
}
...
...
@@ -478,7 +488,7 @@ int32_t dndInitDnode(SDnode *pDnode) {
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
pMgmt
->
dnodeId
=
0
;
pMgmt
->
rebootTime
=
taosGetTimestamp
Sec
();
pMgmt
->
rebootTime
=
taosGetTimestamp
Ms
();
pMgmt
->
dropped
=
0
;
pMgmt
->
clusterId
=
0
;
...
...
source/dnode/mgmt/impl/src/dndMnode.c
浏览文件 @
1cdacd2a
...
...
@@ -334,7 +334,6 @@ static void dndInitMnodeOption(SDnode *pDnode, SMnodeOpt *pOption) {
pOption
->
cfg
.
sver
=
pDnode
->
opt
.
sver
;
pOption
->
cfg
.
enableTelem
=
pDnode
->
opt
.
enableTelem
;
pOption
->
cfg
.
statusInterval
=
pDnode
->
opt
.
statusInterval
;
pOption
->
cfg
.
mnodeEqualVnodeNum
=
pDnode
->
opt
.
mnodeEqualVnodeNum
;
pOption
->
cfg
.
shellActivityTimer
=
pDnode
->
opt
.
shellActivityTimer
;
pOption
->
cfg
.
timezone
=
pDnode
->
opt
.
timezone
;
pOption
->
cfg
.
charset
=
pDnode
->
opt
.
charset
;
...
...
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
1cdacd2a
...
...
@@ -69,10 +69,10 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_FUNCTION
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_RETRIEVE_FUNCTION
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_FUNCTION
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
ABLE
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
ABLE
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
ABLE
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ST
ABLE
_VGROUP
]
=
dndProcessMnodeReadMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
B
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
B
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
B
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ST
B
_VGROUP
]
=
dndProcessMnodeReadMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_KILL_QUERY
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_KILL_STREAM
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_KILL_CONN
]
=
dndProcessMnodeWriteMsg
;
...
...
@@ -84,12 +84,12 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_NETWORK_TEST
]
=
dndProcessDnodeReq
;
// message from mnode to vnode
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
ABLE
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
ABLE
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
ABLE
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
ABLE
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
ABLE
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
ABLE
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
B
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_ST
B
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
B
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_ALTER_ST
B
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
B
_IN
]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_DROP_ST
B
_IN_RSP
]
=
dndProcessMnodeWriteMsg
;
// message from mnode to dnode
pMgmt
->
msgFp
[
TSDB_MSG_TYPE_CREATE_VNODE_IN
]
=
dndProcessVnodeMgmtMsg
;
...
...
@@ -130,7 +130,7 @@ static void dndProcessResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
pMsg
==
NULL
||
pMsg
->
pCont
==
NULL
)
return
;
dTrace
(
"RPC %p, rsp:%s
app:%p is ignored since dnode is stopping"
,
pMsg
->
handle
,
taosMsg
[
msgType
],
pMsg
->
ahandle
);
dTrace
(
"RPC %p, rsp:%s
is ignored since dnode is stopping"
,
pMsg
->
handle
,
taosMsg
[
msgType
]
);
rpcFreeCont
(
pMsg
->
pCont
);
return
;
}
...
...
@@ -138,10 +138,9 @@ static void dndProcessResponse(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
DndMsgFp
fp
=
pMgmt
->
msgFp
[
msgType
];
if
(
fp
!=
NULL
)
{
(
*
fp
)(
pDnode
,
pMsg
,
pEpSet
);
dTrace
(
"RPC %p, rsp:%s app:%p is processed, code:0x%0X"
,
pMsg
->
handle
,
taosMsg
[
msgType
],
pMsg
->
ahandle
,
pMsg
->
code
&
0XFFFF
);
dTrace
(
"RPC %p, rsp:%s is processed, code:0x%0X"
,
pMsg
->
handle
,
taosMsg
[
msgType
],
pMsg
->
code
&
0XFFFF
);
}
else
{
dError
(
"RPC %p, rsp:%s
app:%p not processed"
,
pMsg
->
handle
,
taosMsg
[
msgType
],
pMsg
->
ahandle
);
dError
(
"RPC %p, rsp:%s
not processed"
,
pMsg
->
handle
,
taosMsg
[
msgType
]
);
}
rpcFreeCont
(
pMsg
->
pCont
);
}
...
...
source/dnode/mgmt/impl/src/dnode.c
浏览文件 @
1cdacd2a
...
...
@@ -61,15 +61,15 @@ static int32_t dndCheckRunning(char *dataDir) {
FileFd
fd
=
taosOpenFileCreateWriteTrunc
(
filepath
);
if
(
fd
<
0
)
{
dError
(
"failed to lock file:%s since %s, quit"
,
filepath
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to lock file:%s since %s, quit"
,
filepath
,
terrstr
());
return
-
1
;
}
int32_t
ret
=
taosLockFile
(
fd
);
if
(
ret
!=
0
)
{
dError
(
"failed to lock file:%s since %s, quit"
,
filepath
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to lock file:%s since %s, quit"
,
filepath
,
terrstr
());
taosCloseFile
(
fd
);
return
-
1
;
}
...
...
@@ -194,6 +194,7 @@ SDnode *dndInit(SDnodeOpt *pOption) {
}
dndSetStat
(
pDnode
,
DND_STAT_RUNNING
);
dndSendStatusMsg
(
pDnode
);
dndReportStartup
(
pDnode
,
"TDengine"
,
"initialized successfully"
);
dInfo
(
"TDengine is initialized successfully"
);
...
...
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
1cdacd2a
# add_subdirectory(acct)
# add_subdirectory(cluster)
add_subdirectory
(
dnode
)
# add_subdirectory(profile)
# add_subdirectory(show)
add_subdirectory
(
user
)
source/dnode/mgmt/impl/test/cluster/cluster.cpp
浏览文件 @
1cdacd2a
...
...
@@ -80,7 +80,7 @@ TEST_F(DndTestCluster, ShowCluster) {
EXPECT_NE
(
pRsp
->
showId
,
0
);
EXPECT_EQ
(
pMeta
->
contLen
,
0
);
EXPECT_STREQ
(
pMeta
->
t
able
Fname
,
"show cluster"
);
EXPECT_STREQ
(
pMeta
->
t
b
Fname
,
"show cluster"
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
...
...
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
0 → 100644
浏览文件 @
1cdacd2a
add_executable
(
dndTestDnode
""
)
target_sources
(
dndTestDnode
PRIVATE
"dnode.cpp"
"../sut/deploy.cpp"
)
target_link_libraries
(
dndTestDnode
PUBLIC dnode
PUBLIC util
PUBLIC os
PUBLIC gtest_main
)
target_include_directories
(
dndTestDnode
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../sut"
)
enable_testing
()
add_test
(
NAME dndTestDnode
COMMAND dndTestDnode
)
source/dnode/mgmt/impl/test/dnode/dnode.cpp
0 → 100644
浏览文件 @
1cdacd2a
/*
* 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 "deploy.h"
class
DndTestDnode
:
public
::
testing
::
Test
{
public:
static
SServer
*
CreateServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
SServer
*
pServer
=
createServer
(
path
,
fqdn
,
port
,
firstEp
);
ASSERT
(
pServer
);
return
pServer
;
}
static
void
SetUpTestSuite
()
{
initLog
(
"/tmp/dndTestDnode1"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9521"
;
pServer1
=
CreateServer
(
"/tmp/dndTestDnode1"
,
fqdn
,
9521
,
firstEp
);
pServer2
=
CreateServer
(
"/tmp/dndTestDnode2"
,
fqdn
,
9522
,
firstEp
);
// pServer3 = CreateServer("/tmp/dndTestDnode3", fqdn, 9523, firstEp);
// pServer4 = CreateServer("/tmp/dndTestDnode4", fqdn, 9524, firstEp);
// pServer5 = CreateServer("/tmp/dndTestDnode5", fqdn, 9525, firstEp);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9521
);
taosMsleep
(
300
);
}
static
void
TearDownTestSuite
()
{
dropServer
(
pServer1
);
dropServer
(
pServer2
);
dropServer
(
pServer3
);
dropServer
(
pServer4
);
dropServer
(
pServer5
);
dropClient
(
pClient
);
}
static
SServer
*
pServer1
;
static
SServer
*
pServer2
;
static
SServer
*
pServer3
;
static
SServer
*
pServer4
;
static
SServer
*
pServer5
;
static
SClient
*
pClient
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
void
SendTheCheckShowMetaMsg
(
int8_t
showType
,
const
char
*
showName
,
int32_t
columns
)
{
//--- meta ---
SShowMsg
*
pShow
=
(
SShowMsg
*
)
rpcMallocCont
(
sizeof
(
SShowMsg
));
pShow
->
type
=
showType
;
strcpy
(
pShow
->
db
,
""
);
SRpcMsg
showRpcMsg
=
{
0
};
showRpcMsg
.
pCont
=
pShow
;
showRpcMsg
.
contLen
=
sizeof
(
SShowMsg
);
showRpcMsg
.
msgType
=
TSDB_MSG_TYPE_SHOW
;
sendMsg
(
pClient
,
&
showRpcMsg
);
ASSERT_NE
(
pClient
->
pRsp
,
nullptr
);
ASSERT_EQ
(
pClient
->
pRsp
->
code
,
0
);
ASSERT_NE
(
pClient
->
pRsp
->
pCont
,
nullptr
);
SShowRsp
*
pShowRsp
=
(
SShowRsp
*
)
pClient
->
pRsp
->
pCont
;
ASSERT_NE
(
pShowRsp
,
nullptr
);
pShowRsp
->
showId
=
htonl
(
pShowRsp
->
showId
);
pMeta
=
&
pShowRsp
->
tableMeta
;
pMeta
->
numOfTags
=
htons
(
pMeta
->
numOfTags
);
pMeta
->
numOfColumns
=
htons
(
pMeta
->
numOfColumns
);
pMeta
->
sversion
=
htons
(
pMeta
->
sversion
);
pMeta
->
tversion
=
htons
(
pMeta
->
tversion
);
pMeta
->
tuid
=
htobe64
(
pMeta
->
tuid
);
pMeta
->
suid
=
htobe64
(
pMeta
->
suid
);
showId
=
pShowRsp
->
showId
;
EXPECT_NE
(
pShowRsp
->
showId
,
0
);
EXPECT_STREQ
(
pMeta
->
tbFname
,
showName
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
numOfColumns
,
columns
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
EXPECT_EQ
(
pMeta
->
update
,
0
);
EXPECT_EQ
(
pMeta
->
sversion
,
0
);
EXPECT_EQ
(
pMeta
->
tversion
,
0
);
EXPECT_EQ
(
pMeta
->
tuid
,
0
);
EXPECT_EQ
(
pMeta
->
suid
,
0
);
}
void
CheckSchema
(
int32_t
index
,
int8_t
type
,
int32_t
bytes
,
const
char
*
name
)
{
SSchema
*
pSchema
=
&
pMeta
->
pSchema
[
index
];
pSchema
->
bytes
=
htons
(
pSchema
->
bytes
);
EXPECT_EQ
(
pSchema
->
colId
,
0
);
EXPECT_EQ
(
pSchema
->
type
,
type
);
EXPECT_EQ
(
pSchema
->
bytes
,
bytes
);
EXPECT_STREQ
(
pSchema
->
name
,
name
);
}
void
SendThenCheckShowRetrieveMsg
(
int32_t
rows
)
{
SRetrieveTableMsg
*
pRetrieve
=
(
SRetrieveTableMsg
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableMsg
));
pRetrieve
->
showId
=
htonl
(
showId
);
pRetrieve
->
free
=
0
;
SRpcMsg
retrieveRpcMsg
=
{
0
};
retrieveRpcMsg
.
pCont
=
pRetrieve
;
retrieveRpcMsg
.
contLen
=
sizeof
(
SRetrieveTableMsg
);
retrieveRpcMsg
.
msgType
=
TSDB_MSG_TYPE_SHOW_RETRIEVE
;
sendMsg
(
pClient
,
&
retrieveRpcMsg
);
ASSERT_NE
(
pClient
->
pRsp
,
nullptr
);
ASSERT_EQ
(
pClient
->
pRsp
->
code
,
0
);
ASSERT_NE
(
pClient
->
pRsp
->
pCont
,
nullptr
);
pRetrieveRsp
=
(
SRetrieveTableRsp
*
)
pClient
->
pRsp
->
pCont
;
ASSERT_NE
(
pRetrieveRsp
,
nullptr
);
pRetrieveRsp
->
numOfRows
=
htonl
(
pRetrieveRsp
->
numOfRows
);
pRetrieveRsp
->
offset
=
htobe64
(
pRetrieveRsp
->
offset
);
pRetrieveRsp
->
useconds
=
htobe64
(
pRetrieveRsp
->
useconds
);
pRetrieveRsp
->
compLen
=
htonl
(
pRetrieveRsp
->
compLen
);
EXPECT_EQ
(
pRetrieveRsp
->
numOfRows
,
rows
);
EXPECT_EQ
(
pRetrieveRsp
->
offset
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
useconds
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
completed
,
1
);
EXPECT_EQ
(
pRetrieveRsp
->
precision
,
TSDB_TIME_PRECISION_MILLI
);
EXPECT_EQ
(
pRetrieveRsp
->
compressed
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
reserved
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
compLen
,
0
);
pData
=
pRetrieveRsp
->
data
;
pos
=
0
;
}
void
CheckInt16
(
int16_t
val
)
{
int16_t
data
=
*
((
int16_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int16_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckInt64
(
int64_t
val
)
{
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int64_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckTimestamp
()
{
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int64_t
);
EXPECT_GT
(
data
,
0
);
}
void
CheckBinary
(
const
char
*
val
,
int32_t
len
)
{
pos
+=
sizeof
(
VarDataLenT
);
char
*
data
=
(
char
*
)(
pData
+
pos
);
pos
+=
len
;
EXPECT_STREQ
(
data
,
val
);
}
int32_t
showId
;
STableMetaMsg
*
pMeta
;
SRetrieveTableRsp
*
pRetrieveRsp
;
char
*
pData
;
int32_t
pos
;
};
SServer
*
DndTestDnode
::
pServer1
;
SServer
*
DndTestDnode
::
pServer2
;
SServer
*
DndTestDnode
::
pServer3
;
SServer
*
DndTestDnode
::
pServer4
;
SServer
*
DndTestDnode
::
pServer5
;
SClient
*
DndTestDnode
::
pClient
;
TEST_F
(
DndTestDnode
,
ShowDnode
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"end point"
);
CheckSchema
(
2
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"vnodes"
);
CheckSchema
(
3
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"max vnodes"
);
CheckSchema
(
4
,
TSDB_DATA_TYPE_BINARY
,
10
+
VARSTR_HEADER_SIZE
,
"status"
);
CheckSchema
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
CheckSchema
(
6
,
TSDB_DATA_TYPE_BINARY
,
24
+
VARSTR_HEADER_SIZE
,
"offline reason"
);
SendThenCheckShowRetrieveMsg
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:9521"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
1
);
CheckBinary
(
"ready"
,
10
);
CheckTimestamp
();
CheckBinary
(
""
,
24
);
}
TEST_F
(
DndTestDnode
,
CreateDnode_01
)
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9522"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SCreateDnodeMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_DNODE
;
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
taosMsleep
(
1300
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
SendThenCheckShowRetrieveMsg
(
2
);
CheckInt16
(
1
);
CheckInt16
(
2
);
CheckBinary
(
"localhost:9521"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9522"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"ready"
,
10
);
CheckBinary
(
"ready"
,
10
);
CheckTimestamp
();
CheckTimestamp
();
CheckBinary
(
""
,
24
);
CheckBinary
(
""
,
24
);
}
#if 0
TEST_F(DndTestDnode, AlterUser_01) {
ASSERT_NE(pClient, nullptr);
//--- drop user ---
SAlterUserMsg* pReq = (SAlterUserMsg*)rpcMallocCont(sizeof(SAlterUserMsg));
strcpy(pReq->user, "u1");
strcpy(pReq->pass, "p2");
SRpcMsg rpcMsg = {0};
rpcMsg.pCont = pReq;
rpcMsg.contLen = sizeof(SAlterUserMsg);
rpcMsg.msgType = TSDB_MSG_TYPE_ALTER_USER;
sendMsg(pClient, &rpcMsg);
SRpcMsg* pMsg = pClient->pRsp;
ASSERT_NE(pMsg, nullptr);
ASSERT_EQ(pMsg->code, 0);
//--- meta ---
SShowMsg* pShow = (SShowMsg*)rpcMallocCont(sizeof(SShowMsg));
pShow->type = TSDB_MGMT_TABLE_USER;
SRpcMsg showRpcMsg = {0};
showRpcMsg.pCont = pShow;
showRpcMsg.contLen = sizeof(SShowMsg);
showRpcMsg.msgType = TSDB_MSG_TYPE_SHOW;
sendMsg(pClient, &showRpcMsg);
SShowRsp* pShowRsp = (SShowRsp*)pClient->pRsp->pCont;
STableMetaMsg* pMeta = &pShowRsp->tableMeta;
pMeta->numOfColumns = htons(pMeta->numOfColumns);
EXPECT_EQ(pMeta->numOfColumns, 4);
//--- retrieve ---
SRetrieveTableMsg* pRetrieve = (SRetrieveTableMsg*)rpcMallocCont(sizeof(SRetrieveTableMsg));
pRetrieve->showId = pShowRsp->showId;
SRpcMsg retrieveRpcMsg = {0};
retrieveRpcMsg.pCont = pRetrieve;
retrieveRpcMsg.contLen = sizeof(SRetrieveTableMsg);
retrieveRpcMsg.msgType = TSDB_MSG_TYPE_SHOW_RETRIEVE;
sendMsg(pClient, &retrieveRpcMsg);
SRetrieveTableRsp* pRetrieveRsp = (SRetrieveTableRsp*)pClient->pRsp->pCont;
pRetrieveRsp->numOfRows = htonl(pRetrieveRsp->numOfRows);
EXPECT_EQ(pRetrieveRsp->numOfRows, 3);
char* pData = pRetrieveRsp->data;
int32_t pos = 0;
char* strVal = NULL;
//--- name ---
{
pos += sizeof(VarDataLenT);
strVal = (char*)(pData + pos);
pos += TSDB_USER_LEN;
EXPECT_STREQ(strVal, "u1");
pos += sizeof(VarDataLenT);
strVal = (char*)(pData + pos);
pos += TSDB_USER_LEN;
EXPECT_STREQ(strVal, "root");
pos += sizeof(VarDataLenT);
strVal = (char*)(pData + pos);
pos += TSDB_USER_LEN;
EXPECT_STREQ(strVal, "_root");
}
}
TEST_F(DndTestDnode, DropUser_01) {
ASSERT_NE(pClient, nullptr);
//--- drop user ---
SDropUserMsg* pReq = (SDropUserMsg*)rpcMallocCont(sizeof(SDropUserMsg));
strcpy(pReq->user, "u1");
SRpcMsg rpcMsg = {0};
rpcMsg.pCont = pReq;
rpcMsg.contLen = sizeof(SDropUserMsg);
rpcMsg.msgType = TSDB_MSG_TYPE_DROP_USER;
sendMsg(pClient, &rpcMsg);
SRpcMsg* pMsg = pClient->pRsp;
ASSERT_NE(pMsg, nullptr);
ASSERT_EQ(pMsg->code, 0);
//--- meta ---
SShowMsg* pShow = (SShowMsg*)rpcMallocCont(sizeof(SShowMsg));
pShow->type = TSDB_MGMT_TABLE_USER;
SRpcMsg showRpcMsg = {0};
showRpcMsg.pCont = pShow;
showRpcMsg.contLen = sizeof(SShowMsg);
showRpcMsg.msgType = TSDB_MSG_TYPE_SHOW;
sendMsg(pClient, &showRpcMsg);
SShowRsp* pShowRsp = (SShowRsp*)pClient->pRsp->pCont;
STableMetaMsg* pMeta = &pShowRsp->tableMeta;
pMeta->numOfColumns = htons(pMeta->numOfColumns);
EXPECT_EQ(pMeta->numOfColumns, 4);
//--- retrieve ---
SRetrieveTableMsg* pRetrieve = (SRetrieveTableMsg*)rpcMallocCont(sizeof(SRetrieveTableMsg));
pRetrieve->showId = pShowRsp->showId;
SRpcMsg retrieveRpcMsg = {0};
retrieveRpcMsg.pCont = pRetrieve;
retrieveRpcMsg.contLen = sizeof(SRetrieveTableMsg);
retrieveRpcMsg.msgType = TSDB_MSG_TYPE_SHOW_RETRIEVE;
sendMsg(pClient, &retrieveRpcMsg);
SRetrieveTableRsp* pRetrieveRsp = (SRetrieveTableRsp*)pClient->pRsp->pCont;
pRetrieveRsp->numOfRows = htonl(pRetrieveRsp->numOfRows);
EXPECT_EQ(pRetrieveRsp->numOfRows, 2);
char* pData = pRetrieveRsp->data;
int32_t pos = 0;
char* strVal = NULL;
//--- name ---
{
pos += sizeof(VarDataLenT);
strVal = (char*)(pData + pos);
pos += TSDB_USER_LEN;
EXPECT_STREQ(strVal, "root");
pos += sizeof(VarDataLenT);
strVal = (char*)(pData + pos);
pos += TSDB_USER_LEN;
EXPECT_STREQ(strVal, "_root");
}
}
#endif
\ No newline at end of file
source/dnode/mgmt/impl/test/profile/profile.cpp
浏览文件 @
1cdacd2a
...
...
@@ -139,7 +139,7 @@ TEST_F(DndTestProfile, SConnectMsg_03) {
EXPECT_NE
(
pRsp
->
showId
,
0
);
EXPECT_EQ
(
pMeta
->
contLen
,
0
);
EXPECT_STREQ
(
pMeta
->
t
able
Fname
,
""
);
EXPECT_STREQ
(
pMeta
->
t
b
Fname
,
""
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
...
...
@@ -480,7 +480,7 @@ TEST_F(DndTestProfile, SKillQueryMsg_03) {
EXPECT_NE
(
pRsp
->
showId
,
0
);
EXPECT_EQ
(
pMeta
->
contLen
,
0
);
EXPECT_STREQ
(
pMeta
->
t
able
Fname
,
""
);
EXPECT_STREQ
(
pMeta
->
t
b
Fname
,
""
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
...
...
@@ -667,7 +667,7 @@ TEST_F(DndTestProfile, SKillStreamMsg_03) {
EXPECT_NE
(
pRsp
->
showId
,
0
);
EXPECT_EQ
(
pMeta
->
contLen
,
0
);
EXPECT_STREQ
(
pMeta
->
t
able
Fname
,
""
);
EXPECT_STREQ
(
pMeta
->
t
b
Fname
,
""
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
...
...
source/dnode/mgmt/impl/test/show/show.cpp
浏览文件 @
1cdacd2a
...
...
@@ -141,7 +141,7 @@ TEST_F(DndTestShow, SShowMsg_04) {
EXPECT_NE
(
pRsp
->
showId
,
0
);
EXPECT_EQ
(
pMeta
->
contLen
,
0
);
EXPECT_STREQ
(
pMeta
->
t
able
Fname
,
""
);
EXPECT_STREQ
(
pMeta
->
t
b
Fname
,
""
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
...
...
source/dnode/mgmt/impl/test/sut/deploy.cpp
浏览文件 @
1cdacd2a
...
...
@@ -16,7 +16,7 @@
#include "deploy.h"
void
initLog
(
const
char
*
path
)
{
dDebugFlag
=
0
;
dDebugFlag
=
207
;
vDebugFlag
=
0
;
mDebugFlag
=
207
;
cDebugFlag
=
0
;
...
...
@@ -50,14 +50,13 @@ void* runServer(void* param) {
}
}
void
initOption
(
SDnodeOpt
*
pOption
,
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
)
{
void
initOption
(
SDnodeOpt
*
pOption
,
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
pOption
->
sver
=
1
;
pOption
->
numOfCores
=
1
;
pOption
->
numOfSupportMnodes
=
1
;
pOption
->
numOfSupportVnodes
=
1
;
pOption
->
numOfSupportQnodes
=
1
;
pOption
->
statusInterval
=
1
;
pOption
->
mnodeEqualVnodeNum
=
1
;
pOption
->
numOfThreadsPerCore
=
1
;
pOption
->
ratioOfQueryCores
=
1
;
pOption
->
maxShellConns
=
1000
;
...
...
@@ -66,16 +65,15 @@ void initOption(SDnodeOpt* pOption, const char* path, const char* fqdn, uint16_t
strcpy
(
pOption
->
dataDir
,
path
);
snprintf
(
pOption
->
localEp
,
TSDB_EP_LEN
,
"%s:%u"
,
fqdn
,
port
);
snprintf
(
pOption
->
localFqdn
,
TSDB_FQDN_LEN
,
"%s"
,
fqdn
);
snprintf
(
pOption
->
firstEp
,
TSDB_EP_LEN
,
"%s
:%u"
,
fqdn
,
port
);
snprintf
(
pOption
->
firstEp
,
TSDB_EP_LEN
,
"%s
"
,
firstEp
);
}
SServer
*
createServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
)
{
SServer
*
createServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
taosRemoveDir
(
path
);
taosMkDir
(
path
);
initLog
(
path
);
SDnodeOpt
option
=
{
0
};
initOption
(
&
option
,
path
,
fqdn
,
port
);
initOption
(
&
option
,
path
,
fqdn
,
port
,
firstEp
);
SDnode
*
pDnode
=
dndInit
(
&
option
);
ASSERT
(
pDnode
);
...
...
@@ -91,6 +89,7 @@ SServer* createServer(const char* path, const char* fqdn, uint16_t port) {
}
void
dropServer
(
SServer
*
pServer
)
{
if
(
pServer
==
NULL
)
return
;
if
(
pServer
->
threadId
!=
NULL
)
{
taosDestoryThread
(
pServer
->
threadId
);
}
...
...
@@ -99,7 +98,8 @@ void dropServer(SServer* pServer) {
void
processClientRsp
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SClient
*
pClient
=
(
SClient
*
)
parent
;
pClient
->
pRsp
=
pMsg
;
// taosMsleep(1000000);
uInfo
(
"response:%s from dnode, pCont:%p contLen:%d code:0x%X"
,
taosMsg
[
pMsg
->
msgType
],
pMsg
->
pCont
,
pMsg
->
contLen
,
pMsg
->
code
);
tsem_post
(
&
pClient
->
sem
);
}
...
...
@@ -145,7 +145,7 @@ void sendMsg(SClient* pClient, SRpcMsg* pMsg) {
epSet
.
inUse
=
0
;
epSet
.
numOfEps
=
1
;
epSet
.
port
[
0
]
=
pClient
->
port
;
strcpy
(
epSet
.
fqdn
[
0
],
pClient
->
fqdn
);
memcpy
(
epSet
.
fqdn
[
0
],
pClient
->
fqdn
,
TSDB_FQDN_LEN
);
rpcSendRequest
(
pClient
->
clientRpc
,
&
epSet
,
pMsg
,
NULL
);
tsem_wait
(
&
pClient
->
sem
);
...
...
source/dnode/mgmt/impl/test/sut/deploy.h
浏览文件 @
1cdacd2a
...
...
@@ -39,8 +39,11 @@ typedef struct {
tsem_t
sem
;
}
SClient
;
SServer
*
createServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
);
void
initLog
(
const
char
*
path
);
SServer
*
createServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
);
void
dropServer
(
SServer
*
pServer
);
SClient
*
createClient
(
const
char
*
user
,
const
char
*
pass
,
const
char
*
fqdn
,
uint16_t
port
);
void
dropClient
(
SClient
*
pClient
);
void
sendMsg
(
SClient
*
pClient
,
SRpcMsg
*
pMsg
);
// class DndTest
\ No newline at end of file
source/dnode/mgmt/impl/test/user/user.cpp
浏览文件 @
1cdacd2a
...
...
@@ -26,8 +26,9 @@ class DndTestUser : public ::testing::Test {
const
char
*
path
=
"/tmp/dndTestUser"
;
const
char
*
fqdn
=
"localhost"
;
uint16_t
port
=
9524
;
const
char
*
firstEp
=
"localhost:9524"
;
pServer
=
createServer
(
path
,
fqdn
,
port
);
pServer
=
createServer
(
path
,
fqdn
,
port
,
firstEp
);
ASSERT
(
pServer
);
pClient
=
createClient
(
user
,
pass
,
fqdn
,
port
);
}
...
...
@@ -79,7 +80,7 @@ TEST_F(DndTestUser, ShowUser) {
EXPECT_NE(pShowRsp->showId, 0);
EXPECT_EQ(pMeta->contLen, 0);
EXPECT_STREQ(pMeta->t
able
Fname, "show users");
EXPECT_STREQ(pMeta->t
b
Fname, "show users");
EXPECT_EQ(pMeta->numOfTags, 0);
EXPECT_EQ(pMeta->precision, 0);
EXPECT_EQ(pMeta->tableType, 0);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
1cdacd2a
...
...
@@ -92,7 +92,6 @@ typedef enum {
DND_REASON_VERSION_NOT_MATCH
,
DND_REASON_DNODE_ID_NOT_MATCH
,
DND_REASON_CLUSTER_ID_NOT_MATCH
,
DND_REASON_MN_EQUAL_VN_NOT_MATCH
,
DND_REASON_STATUS_INTERVAL_NOT_MATCH
,
DND_REASON_TIME_ZONE_NOT_MATCH
,
DND_REASON_LOCALE_NOT_MATCH
,
...
...
@@ -125,6 +124,7 @@ typedef struct SDnodeObj {
int64_t
createdTime
;
int64_t
updateTime
;
int64_t
rebootTime
;
int64_t
lastAccessTime
;
int32_t
accessTimes
;
int16_t
numOfMnodes
;
int16_t
numOfVnodes
;
...
...
@@ -241,7 +241,7 @@ typedef struct SVgObj {
SVnodeGid
vnodeGid
[
TSDB_MAX_REPLICA
];
}
SVgObj
;
typedef
struct
SStableObj
{
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_FULL_DB_NAME_LEN
];
int64_t
createdTime
;
...
...
@@ -251,9 +251,8 @@ typedef struct SStableObj {
int32_t
numOfColumns
;
int32_t
numOfTags
;
SRWLatch
lock
;
SSchema
*
columnSchema
;
SSchema
*
tagSchema
;
}
SStableObj
;
SSchema
*
pSchema
;
}
SStbObj
;
typedef
struct
SFuncObj
{
char
name
[
TSDB_FUNC_NAME_LEN
];
...
...
source/dnode/mnode/impl/inc/mndInt.h
浏览文件 @
1cdacd2a
...
...
@@ -88,6 +88,8 @@ void mndSendMsgToMnode(SMnode *pMnode, SRpcMsg *pMsg);
void
mndSendRedirectMsg
(
SMnode
*
pMnode
,
SRpcMsg
*
pMsg
);
void
mndSetMsgHandle
(
SMnode
*
pMnode
,
int32_t
msgType
,
MndMsgFp
fp
);
uint64_t
mndGenerateUid
(
char
*
name
,
int32_t
len
)
;
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/inc/mndSt
able
.h
→
source/dnode/mnode/impl/inc/mndSt
b
.h
浏览文件 @
1cdacd2a
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_MND_ST
ABLE
_H_
#define _TD_MND_ST
ABLE
_H_
#ifndef _TD_MND_ST
B
_H_
#define _TD_MND_ST
B
_H_
#include "mndInt.h"
...
...
@@ -22,11 +22,11 @@
extern
"C"
{
#endif
int32_t
mndInitSt
able
(
SMnode
*
pMnode
);
void
mndCleanupSt
able
(
SMnode
*
pMnode
);
int32_t
mndInitSt
b
(
SMnode
*
pMnode
);
void
mndCleanupSt
b
(
SMnode
*
pMnode
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_MND_ST
ABLE
_H_*/
#endif
/*_TD_MND_ST
B
_H_*/
source/dnode/mnode/impl/src/mndCluster.c
浏览文件 @
1cdacd2a
...
...
@@ -159,7 +159,7 @@ static int32_t mndGetClusterMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg
cols
++
;
pMeta
->
numOfColumns
=
htons
(
cols
);
strcpy
(
pMeta
->
t
ableFname
,
"show cluster"
);
strcpy
(
pMeta
->
t
bFname
,
mndShowStr
(
pShow
->
type
)
);
pShow
->
numOfColumns
=
cols
;
pShow
->
offset
[
0
]
=
0
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
1cdacd2a
...
...
@@ -767,7 +767,7 @@ static int32_t mndGetDbMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *pMe
pShow
->
numOfRows
=
sdbGetSize
(
pSdb
,
SDB_DB
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
1cdacd2a
...
...
@@ -22,10 +22,13 @@
#include "tutil.h"
#define TSDB_DNODE_VER 1
#define TSDB_DNODE_RESERVE_SIZE 64
#define TSDB_CONFIG_OPTION_LEN 16
#define TSDB_CONIIG_VALUE_LEN 48
#define TSDB_CONFIG_NUMBER 8
static
int32_t
id
=
2
;
static
const
char
*
offlineReason
[]
=
{
""
,
"status msg timeout"
,
...
...
@@ -33,7 +36,6 @@ static const char *offlineReason[] = {
"version not match"
,
"dnodeId not match"
,
"clusterId not match"
,
"mnEqualVn not match"
,
"interval not match"
,
"timezone not match"
,
"locale not match"
,
...
...
@@ -117,6 +119,7 @@ static SSdbRaw *mndDnodeActionEncode(SDnodeObj *pDnode) {
SDB_SET_INT64
(
pRaw
,
dataPos
,
pDnode
->
updateTime
)
SDB_SET_INT16
(
pRaw
,
dataPos
,
pDnode
->
port
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pDnode
->
fqdn
,
TSDB_FQDN_LEN
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
TSDB_DNODE_RESERVE_SIZE
)
SDB_SET_DATALEN
(
pRaw
,
dataPos
);
return
pRaw
;
...
...
@@ -142,28 +145,28 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pDnode
->
updateTime
)
SDB_GET_INT16
(
pRaw
,
pRow
,
dataPos
,
&
pDnode
->
port
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pDnode
->
fqdn
,
TSDB_FQDN_LEN
)
SDB_GET_RESERVE
(
pRaw
,
pRow
,
dataPos
,
TSDB_DNODE_RESERVE_SIZE
)
return
pRow
;
}
static
void
mnodeResetDnode
(
SDnodeObj
*
pDnode
)
{
static
int32_t
mndDnodeActionInsert
(
SSdb
*
pSdb
,
SDnodeObj
*
pDnode
)
{
mTrace
(
"dnode:%d, perform insert action"
,
pDnode
->
id
);
pDnode
->
rebootTime
=
0
;
pDnode
->
lastAccessTime
=
0
;
pDnode
->
accessTimes
=
0
;
pDnode
->
numOfCores
=
0
;
pDnode
->
numOfMnodes
=
0
;
pDnode
->
numOfVnodes
=
0
;
pDnode
->
numOfQnodes
=
0
;
pDnode
->
numOfSupportMnodes
=
0
;
pDnode
->
numOfSupportVnodes
=
0
;
pDnode
->
numOfSupportQnodes
=
0
;
pDnode
->
numOfCores
=
0
;
pDnode
->
status
=
DND_STATUS_OFFLINE
;
pDnode
->
offlineReason
=
DND_REASON_STATUS_NOT_RECEIVED
;
snprintf
(
pDnode
->
ep
,
TSDB_EP_LEN
,
"%s:%u"
,
pDnode
->
fqdn
,
pDnode
->
port
);
}
static
int32_t
mndDnodeActionInsert
(
SSdb
*
pSdb
,
SDnodeObj
*
pDnode
)
{
mTrace
(
"dnode:%d, perform insert action"
,
pDnode
->
id
);
mnodeResetDnode
(
pDnode
);
return
0
;
}
...
...
@@ -174,11 +177,6 @@ static int32_t mndDnodeActionDelete(SSdb *pSdb, SDnodeObj *pDnode) {
static
int32_t
mndDnodeActionUpdate
(
SSdb
*
pSdb
,
SDnodeObj
*
pOldDnode
,
SDnodeObj
*
pNewDnode
)
{
mTrace
(
"dnode:%d, perform update action"
,
pOldDnode
->
id
);
pOldDnode
->
id
=
pNewDnode
->
id
;
pOldDnode
->
createdTime
=
pNewDnode
->
createdTime
;
pOldDnode
->
updateTime
=
pNewDnode
->
updateTime
;
pOldDnode
->
port
=
pNewDnode
->
port
;
memcpy
(
pOldDnode
->
fqdn
,
pNewDnode
->
fqdn
,
TSDB_FQDN_LEN
);
return
0
;
}
...
...
@@ -232,6 +230,7 @@ static void mndGetDnodeData(SMnode *pMnode, SDnodeEps *pEps, int32_t numOfEps) {
if
(
pIter
==
NULL
)
break
;
if
(
i
>=
numOfEps
)
{
sdbCancelFetch
(
pSdb
,
pIter
);
sdbRelease
(
pSdb
,
pDnode
);
break
;
}
...
...
@@ -244,20 +243,15 @@ static void mndGetDnodeData(SMnode *pMnode, SDnodeEps *pEps, int32_t numOfEps) {
pEp
->
isMnode
=
1
;
}
i
++
;
sdbRelease
(
pSdb
,
pDnode
);
}
pEps
->
num
=
htonl
(
i
);
}
static
int32_t
mndCheckClusterCfgPara
(
SMnode
*
pMnode
,
const
SClusterCfg
*
pCfg
)
{
if
(
pCfg
->
mnodeEqualVnodeNum
!=
pMnode
->
cfg
.
mnodeEqualVnodeNum
)
{
mError
(
"
\"
mnodeEqualVnodeNum
\"
[%d - %d] cfg inconsistent"
,
pCfg
->
mnodeEqualVnodeNum
,
pMnode
->
cfg
.
mnodeEqualVnodeNum
);
return
DND_REASON_MN_EQUAL_VN_NOT_MATCH
;
}
if
(
pCfg
->
statusInterval
!=
pMnode
->
cfg
.
statusInterval
)
{
mError
(
"
\"
statusInterval
\"
[%d - %d] cfg inconsistent"
,
pCfg
->
statusInterval
,
pMnode
->
cfg
.
statusInterval
);
mError
(
"
statusInterval
[%d - %d] cfg inconsistent"
,
pCfg
->
statusInterval
,
pMnode
->
cfg
.
statusInterval
);
return
DND_REASON_STATUS_INTERVAL_NOT_MATCH
;
}
...
...
@@ -265,18 +259,18 @@ static int32_t mndCheckClusterCfgPara(SMnode *pMnode, const SClusterCfg *pCfg) {
char
timestr
[
32
]
=
"1970-01-01 00:00:00.00"
;
(
void
)
taosParseTime
(
timestr
,
&
checkTime
,
(
int32_t
)
strlen
(
timestr
),
TSDB_TIME_PRECISION_MILLI
,
0
);
if
((
0
!=
strcasecmp
(
pCfg
->
timezone
,
pMnode
->
cfg
.
timezone
))
&&
(
checkTime
!=
pCfg
->
checkTime
))
{
mError
(
"
\"
timezone
\"
[%s - %s] [%"
PRId64
" - %"
PRId64
"] cfg inconsistent"
,
pCfg
->
timezone
,
pMnode
->
cfg
.
timezone
,
mError
(
"
timezone
[%s - %s] [%"
PRId64
" - %"
PRId64
"] cfg inconsistent"
,
pCfg
->
timezone
,
pMnode
->
cfg
.
timezone
,
pCfg
->
checkTime
,
checkTime
);
return
DND_REASON_TIME_ZONE_NOT_MATCH
;
}
if
(
0
!=
strcasecmp
(
pCfg
->
locale
,
pMnode
->
cfg
.
locale
))
{
mError
(
"
\"
locale
\"
[%s - %s] cfg parameters
inconsistent"
,
pCfg
->
locale
,
pMnode
->
cfg
.
locale
);
mError
(
"
locale [%s - %s] cfg
inconsistent"
,
pCfg
->
locale
,
pMnode
->
cfg
.
locale
);
return
DND_REASON_LOCALE_NOT_MATCH
;
}
if
(
0
!=
strcasecmp
(
pCfg
->
charset
,
pMnode
->
cfg
.
charset
))
{
mError
(
"
\"
charset
\"
[%s - %s] cfg parameters
inconsistent."
,
pCfg
->
charset
,
pMnode
->
cfg
.
charset
);
mError
(
"
charset [%s - %s] cfg
inconsistent."
,
pCfg
->
charset
,
pMnode
->
cfg
.
charset
);
return
DND_REASON_CHARSET_NOT_MATCH
;
}
...
...
@@ -287,14 +281,12 @@ static void mndParseStatusMsg(SStatusMsg *pStatus) {
pStatus
->
sver
=
htonl
(
pStatus
->
sver
);
pStatus
->
dnodeId
=
htonl
(
pStatus
->
dnodeId
);
pStatus
->
clusterId
=
htonl
(
pStatus
->
clusterId
);
pStatus
->
rebootTime
=
hto
nl
(
pStatus
->
rebootTime
);
pStatus
->
rebootTime
=
hto
be64
(
pStatus
->
rebootTime
);
pStatus
->
numOfCores
=
htons
(
pStatus
->
numOfCores
);
pStatus
->
numOfSupportMnodes
=
htons
(
pStatus
->
numOfSupportMnodes
);
pStatus
->
numOfSupportVnodes
=
htons
(
pStatus
->
numOfSupportVnodes
);
pStatus
->
numOfSupportQnodes
=
htons
(
pStatus
->
numOfSupportQnodes
);
pStatus
->
clusterCfg
.
statusInterval
=
htonl
(
pStatus
->
clusterCfg
.
statusInterval
);
pStatus
->
clusterCfg
.
mnodeEqualVnodeNum
=
htonl
(
pStatus
->
clusterCfg
.
mnodeEqualVnodeNum
);
pStatus
->
clusterCfg
.
checkTime
=
htobe64
(
pStatus
->
clusterCfg
.
checkTime
);
}
...
...
@@ -308,7 +300,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
pDnode
=
mndAcquireDnodeByEp
(
pMnode
,
pStatus
->
dnodeEp
);
if
(
pDnode
==
NULL
)
{
mDebug
(
"dnode:%s, not created yet"
,
pStatus
->
dnodeEp
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
return
-
1
;
}
}
else
{
pDnode
=
mndAcquireDnode
(
pMnode
,
pStatus
->
dnodeId
);
...
...
@@ -319,7 +312,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
}
mError
(
"dnode:%d, %s not exist"
,
pStatus
->
dnodeId
,
pStatus
->
dnodeEp
);
mndReleaseDnode
(
pMnode
,
pDnode
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
return
-
1
;
}
}
...
...
@@ -329,7 +323,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
}
mndReleaseDnode
(
pMnode
,
pDnode
);
mError
(
"dnode:%d, status msg version:%d not match cluster:%d"
,
pStatus
->
dnodeId
,
pStatus
->
sver
,
pMnode
->
cfg
.
sver
);
return
TSDB_CODE_MND_INVALID_MSG_VERSION
;
terrno
=
TSDB_CODE_MND_INVALID_MSG_VERSION
;
return
-
1
;
}
if
(
pStatus
->
dnodeId
==
0
)
{
...
...
@@ -341,7 +336,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
}
mError
(
"dnode:%d, clusterId %d not match exist %d"
,
pDnode
->
id
,
pStatus
->
clusterId
,
pMnode
->
clusterId
);
mndReleaseDnode
(
pMnode
,
pDnode
);
return
TSDB_CODE_MND_INVALID_CLUSTER_ID
;
terrno
!=
TSDB_CODE_MND_INVALID_CLUSTER_ID
;
return
-
1
;
}
else
{
pDnode
->
accessTimes
++
;
mTrace
(
"dnode:%d, status received, access times %d"
,
pDnode
->
id
,
pDnode
->
accessTimes
);
...
...
@@ -355,7 +351,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
pDnode
->
offlineReason
=
ret
;
mError
(
"dnode:%d, cluster cfg inconsistent since:%s"
,
pDnode
->
id
,
offlineReason
[
ret
]);
mndReleaseDnode
(
pMnode
,
pDnode
);
return
TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT
;
terrno
=
TSDB_CODE_MND_INVALID_CLUSTER_CFG
;
return
-
1
;
}
mInfo
(
"dnode:%d, from offline to online"
,
pDnode
->
id
);
...
...
@@ -366,6 +363,7 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
pDnode
->
numOfSupportMnodes
=
pStatus
->
numOfSupportMnodes
;
pDnode
->
numOfSupportVnodes
=
pStatus
->
numOfSupportVnodes
;
pDnode
->
numOfSupportQnodes
=
pStatus
->
numOfSupportQnodes
;
pDnode
->
lastAccessTime
=
taosGetTimestampMs
();
pDnode
->
status
=
DND_STATUS_READY
;
int32_t
numOfEps
=
mndGetDnodeSize
(
pMnode
);
...
...
@@ -373,7 +371,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
SStatusRsp
*
pRsp
=
rpcMallocCont
(
contLen
);
if
(
pRsp
==
NULL
)
{
mndReleaseDnode
(
pMnode
,
pDnode
);
return
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
pRsp
->
dnodeCfg
.
dnodeId
=
htonl
(
pDnode
->
id
);
...
...
@@ -390,13 +389,13 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
static
int32_t
mndCreateDnode
(
SMnode
*
pMnode
,
SMnodeMsg
*
pMsg
,
SCreateDnodeMsg
*
pCreate
)
{
SDnodeObj
dnodeObj
=
{
0
};
dnodeObj
.
id
=
1
;
// todo
dnodeObj
.
id
=
id
++
;
dnodeObj
.
createdTime
=
taosGetTimestampMs
();
dnodeObj
.
updateTime
=
dnodeObj
.
createdTime
;
taosGetFqdnPortFromEp
(
pCreate
->
ep
,
dnodeObj
.
fqdn
,
&
dnodeObj
.
port
);
if
(
dnodeObj
.
fqdn
[
0
]
==
0
||
dnodeObj
.
port
<=
0
)
{
terrno
=
TSDB_CODE_
SDB_APP_ERROR
;
terrno
=
TSDB_CODE_
MND_INVALID_DNODE_EP
;
mError
(
"dnode:%s, failed to create since %s"
,
pCreate
->
ep
,
terrstr
());
return
terrno
;
}
...
...
@@ -449,7 +448,7 @@ static int32_t mndProcessCreateDnodeMsg(SMnodeMsg *pMsg) {
mDebug
(
"dnode:%s, start to create"
,
pCreate
->
ep
);
if
(
pCreate
->
ep
[
0
]
==
0
)
{
terrno
=
TSDB_CODE_
SDB_APP_ERROR
;
terrno
=
TSDB_CODE_
MND_INVALID_DNODE_EP
;
mError
(
"dnode:%s, failed to create since %s"
,
pCreate
->
ep
,
terrstr
());
return
-
1
;
}
...
...
@@ -457,7 +456,7 @@ static int32_t mndProcessCreateDnodeMsg(SMnodeMsg *pMsg) {
SDnodeObj
*
pDnode
=
mndAcquireDnodeByEp
(
pMnode
,
pCreate
->
ep
);
if
(
pDnode
!=
NULL
)
{
mError
(
"dnode:%d, already exist"
,
pDnode
->
id
);
sdbRelease
(
pMnode
->
pSdb
,
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
terrno
=
TSDB_CODE_MND_DNODE_ALREADY_EXIST
;
return
-
1
;
}
...
...
@@ -478,7 +477,7 @@ static int32_t mndDropDnode(SMnode *pMnode, SMnodeMsg *pMsg, SDnodeObj *pDnode)
mError
(
"dnode:%d, failed to drop since %s"
,
pDnode
->
id
,
terrstr
());
return
-
1
;
}
mDebug
(
"trans:%d, used to drop
user
:%d"
,
pTrans
->
id
,
pDnode
->
id
);
mDebug
(
"trans:%d, used to drop
dnode
:%d"
,
pTrans
->
id
,
pDnode
->
id
);
SSdbRaw
*
pRedoRaw
=
mndDnodeActionEncode
(
pDnode
);
if
(
pRedoRaw
==
NULL
||
mndTransAppendRedolog
(
pTrans
,
pRedoRaw
)
!=
0
)
{
...
...
@@ -522,26 +521,26 @@ static int32_t mndProcessDropDnodeMsg(SMnodeMsg *pMsg) {
mDebug
(
"dnode:%d, start to drop"
,
pDrop
->
dnodeId
);
if
(
pDrop
->
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_
SDB_APP_ERROR
;
terrno
=
TSDB_CODE_
MND_INVALID_DNODE_ID
;
mError
(
"dnode:%d, failed to drop since %s"
,
pDrop
->
dnodeId
,
terrstr
());
return
-
1
;
}
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pDrop
->
dnodeId
);
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%d, not exist"
,
pDrop
->
dnodeId
);
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
mError
(
"dnode:%d, failed to drop since %s"
,
pDrop
->
dnodeId
,
terrstr
());
return
-
1
;
}
int32_t
code
=
mndDropDnode
(
pMnode
,
pMsg
,
pDnode
);
if
(
code
!=
0
)
{
mndReleaseDnode
(
pMnode
,
pDnode
);
mError
(
"dnode:%d, failed to drop since %s"
,
pDrop
->
dnodeId
,
terrstr
());
return
-
1
;
}
sdbRelease
(
pMnode
->
pSdb
,
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
...
...
@@ -553,7 +552,7 @@ static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) {
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pCfg
->
dnodeId
);
if
(
pDnode
==
NULL
)
{
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
mError
(
"dnode:%d, failed to c
f
g since %s "
,
pCfg
->
dnodeId
,
terrstr
());
mError
(
"dnode:%d, failed to c
onfi
g since %s "
,
pCfg
->
dnodeId
,
terrstr
());
return
-
1
;
}
...
...
@@ -562,17 +561,22 @@ static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) {
SCfgDnodeMsg
*
pCfgDnode
=
rpcMallocCont
(
sizeof
(
SCfgDnodeMsg
));
pCfgDnode
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
memcpy
(
pCfgDnode
->
config
,
pCfg
->
config
,
128
);
memcpy
(
pCfgDnode
->
config
,
pCfg
->
config
,
TSDB_DNODE_CONFIG_LEN
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TSDB_MSG_TYPE_CONFIG_DNODE_IN
,
.
pCont
=
pCfgDnode
,
.
contLen
=
sizeof
(
SCfgDnodeMsg
)};
SRpcMsg
rpcMsg
=
{.
msgType
=
TSDB_MSG_TYPE_CONFIG_DNODE_IN
,
.
pCont
=
pCfgDnode
,
.
contLen
=
sizeof
(
SCfgDnodeMsg
),
.
ahandle
=
pMsg
->
rpcMsg
.
ahandle
};
mInfo
(
"dnode:%d,
is configured"
,
pCfg
->
dnodeId
);
mInfo
(
"dnode:%d,
app:%p config:%s req send to dnode"
,
pCfg
->
dnodeId
,
rpcMsg
.
ahandle
,
pCfg
->
config
);
mndSendMsgToDnode
(
pMnode
,
&
epSet
,
&
rpcMsg
);
return
0
;
}
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
pMsg
)
{
mInfo
(
"cfg dnode rsp is received"
);
}
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
pMsg
)
{
mInfo
(
"app:%p config rsp from dnode"
,
pMsg
->
rpcMsg
.
ahandle
);
}
static
int32_t
mndGetConfigMeta
(
SMnodeMsg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
)
{
int32_t
cols
=
0
;
...
...
@@ -600,8 +604,7 @@ static int32_t mndGetConfigMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg
pShow
->
numOfRows
=
TSDB_CONFIG_NUMBER
;
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
pShow
->
pIter
=
NULL
;
strcpy
(
pMeta
->
tableFname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
tbFname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
@@ -676,7 +679,7 @@ static int32_t mndGetDnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
strcpy
(
pSchema
[
cols
].
name
,
"
cor
es"
);
strcpy
(
pSchema
[
cols
].
name
,
"
max vnod
es"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -708,7 +711,7 @@ static int32_t mndGetDnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
pShow
->
numOfRows
=
sdbGetSize
(
pSdb
,
SDB_DNODE
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
@@ -740,7 +743,7 @@ static int32_t mndRetrieveDnodes(SMnodeMsg *pMsg, SShowObj *pShow, char *data, i
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int16_t
*
)
pWrite
=
pDnode
->
numOf
Cor
es
;
*
(
int16_t
*
)
pWrite
=
pDnode
->
numOf
SupportVnod
es
;
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
@@ -753,7 +756,11 @@ static int32_t mndRetrieveDnodes(SMnodeMsg *pMsg, SShowObj *pShow, char *data, i
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_TO_VARSTR
(
pWrite
,
offlineReason
[
pDnode
->
offlineReason
]);
if
(
pDnode
->
status
==
DND_STATUS_READY
)
{
STR_TO_VARSTR
(
pWrite
,
""
);
}
else
{
STR_TO_VARSTR
(
pWrite
,
offlineReason
[
pDnode
->
offlineReason
]);
}
cols
++
;
numOfRows
++
;
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
1cdacd2a
...
...
@@ -429,7 +429,7 @@ static int32_t mndGetFuncMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *p
pShow
->
numOfRows
=
sdbGetSize
(
pSdb
,
SDB_FUNC
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
"show funcs"
);
strcpy
(
pMeta
->
t
b
Fname
,
"show funcs"
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
1cdacd2a
...
...
@@ -405,7 +405,7 @@ static int32_t mndGetMnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
pShow
->
numOfRows
=
sdbGetSize
(
pSdb
,
SDB_MNODE
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
1cdacd2a
...
...
@@ -270,7 +270,7 @@ char *mndShowStr(int32_t showType) {
return
"show mnodes"
;
case
TSDB_MGMT_TABLE_VGROUP
:
return
"show vgroups"
;
case
TSDB_MGMT_TABLE_ST
ABLE
:
case
TSDB_MGMT_TABLE_ST
B
:
return
"show stables"
;
case
TSDB_MGMT_TABLE_MODULE
:
return
"show modules"
;
...
...
source/dnode/mnode/impl/src/mndSt
able
.c
→
source/dnode/mnode/impl/src/mndSt
b
.c
浏览文件 @
1cdacd2a
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
1cdacd2a
...
...
@@ -489,7 +489,7 @@ static int32_t mndGetUserMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *p
pShow
->
numOfRows
=
sdbGetSize
(
pSdb
,
SDB_USER
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
1cdacd2a
...
...
@@ -45,7 +45,7 @@ static void mndCancelGetNextVnode(SMnode *pMnode, void *pIter);
int32_t
mndInitVgroup
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_VGROUP
,
.
keyType
=
SDB_KEY_
BINARY
,
.
keyType
=
SDB_KEY_
INT32
,
.
encodeFp
=
(
SdbEncodeFp
)
mndVgroupActionEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
mndVgroupActionDecode
,
.
insertFp
=
(
SdbInsertFp
)
mndVgroupActionInsert
,
...
...
@@ -238,7 +238,7 @@ static int32_t mndGetVgroupMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg
}
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
@@ -337,7 +337,7 @@ static int32_t mndGetVnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
pShow
->
replica
=
dnodeId
;
pShow
->
numOfRows
=
mndGetVnodesNum
(
pMnode
,
dnodeId
);
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
strcpy
(
pMeta
->
t
able
Fname
,
mndShowStr
(
pShow
->
type
));
strcpy
(
pMeta
->
t
b
Fname
,
mndShowStr
(
pShow
->
type
));
return
0
;
}
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
1cdacd2a
...
...
@@ -24,7 +24,7 @@
#include "mndMnode.h"
#include "mndProfile.h"
#include "mndShow.h"
#include "mndSt
able
.h"
#include "mndSt
b
.h"
#include "mndSync.h"
#include "mndTelem.h"
#include "mndTrans.h"
...
...
@@ -131,7 +131,7 @@ static int32_t mndInitSteps(SMnode *pMnode) {
if
(
mndAllocStep
(
pMnode
,
"mnode-user"
,
mndInitUser
,
mndCleanupUser
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-db"
,
mndInitDb
,
mndCleanupDb
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-vgroup"
,
mndInitVgroup
,
mndCleanupVgroup
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-st
able"
,
mndInitStable
,
mndCleanupStable
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-st
b"
,
mndInitStb
,
mndCleanupStb
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-func"
,
mndInitFunc
,
mndCleanupFunc
)
!=
0
)
return
-
1
;
if
(
pMnode
->
clusterId
<=
0
)
{
if
(
mndAllocStep
(
pMnode
,
"mnode-sdb-deploy"
,
mndDeploySdb
,
NULL
)
!=
0
)
return
-
1
;
...
...
@@ -205,7 +205,6 @@ static int32_t mndSetOptions(SMnode *pMnode, const SMnodeOpt *pOption) {
pMnode
->
cfg
.
sver
=
pOption
->
cfg
.
sver
;
pMnode
->
cfg
.
enableTelem
=
pOption
->
cfg
.
enableTelem
;
pMnode
->
cfg
.
statusInterval
=
pOption
->
cfg
.
statusInterval
;
pMnode
->
cfg
.
mnodeEqualVnodeNum
=
pOption
->
cfg
.
mnodeEqualVnodeNum
;
pMnode
->
cfg
.
shellActivityTimer
=
pOption
->
cfg
.
shellActivityTimer
;
pMnode
->
cfg
.
timezone
=
strdup
(
pOption
->
cfg
.
timezone
);
pMnode
->
cfg
.
locale
=
strdup
(
pOption
->
cfg
.
locale
);
...
...
@@ -215,7 +214,7 @@ static int32_t mndSetOptions(SMnode *pMnode, const SMnodeOpt *pOption) {
if
(
pMnode
->
sendMsgToDnodeFp
==
NULL
||
pMnode
->
sendMsgToMnodeFp
==
NULL
||
pMnode
->
sendRedirectMsgFp
==
NULL
||
pMnode
->
putMsgToApplyMsgFp
==
NULL
||
pMnode
->
dnodeId
<
0
||
pMnode
->
clusterId
<
0
||
pMnode
->
cfg
.
statusInterval
<
1
||
pOption
->
cfg
.
mnodeEqualVnodeNum
<
0
)
{
pMnode
->
cfg
.
statusInterval
<
1
)
{
terrno
=
TSDB_CODE_MND_INVALID_OPTIONS
;
return
-
1
;
}
...
...
@@ -430,3 +429,10 @@ void mndProcessWriteMsg(SMnodeMsg *pMsg) { mndProcessRpcMsg(pMsg); }
void
mndProcessSyncMsg
(
SMnodeMsg
*
pMsg
)
{
mndProcessRpcMsg
(
pMsg
);
}
void
mndProcessApplyMsg
(
SMnodeMsg
*
pMsg
)
{}
uint64_t
mndGenerateUid
(
char
*
name
,
int32_t
len
)
{
int64_t
us
=
taosGetTimestampUs
();
int32_t
hashval
=
MurmurHash3_32
(
name
,
len
);
uint64_t
x
=
(
us
&
0x000000FFFFFFFFFF
)
<<
24
;
return
x
+
((
hashval
&
((
1ul
<<
16
)
-
1ul
))
<<
8
)
+
(
taosRand
()
&
((
1ul
<<
8
)
-
1ul
));
}
\ No newline at end of file
source/libs/parser/inc/astGenerator.h
浏览文件 @
1cdacd2a
...
...
@@ -121,7 +121,7 @@ typedef struct SRelationInfo {
typedef
struct
SCreatedTableInfo
{
SToken
name
;
// table name token
SToken
st
ableName
;
// super table name token , for using clause
SToken
st
bName
;
// super table name token , for using clause
SArray
*
pTagNames
;
// create by using super table, tag name
SArray
*
pTagVals
;
// create by using super table, tag value
char
*
fullname
;
// table full name
...
...
source/libs/parser/inc/sql.y
浏览文件 @
1cdacd2a
...
...
@@ -112,13 +112,13 @@ cmd ::= SHOW dbPrefix(X) TABLES LIKE ids(Y). {
}
cmd ::= SHOW dbPrefix(X) STABLES. {
setShowOptions(pInfo, TSDB_MGMT_TABLE_ST
ABLE
, &X, 0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_ST
B
, &X, 0);
}
cmd ::= SHOW dbPrefix(X) STABLES LIKE ids(Y). {
SToken token;
tSetDbName(&token, &X);
setShowOptions(pInfo, TSDB_MGMT_TABLE_ST
ABLE
, &token, &Y);
setShowOptions(pInfo, TSDB_MGMT_TABLE_ST
B
, &token, &Y);
}
cmd ::= SHOW dbPrefix(X) VGROUPS. {
...
...
source/libs/parser/src/astGenerator.c
浏览文件 @
1cdacd2a
...
...
@@ -634,7 +634,7 @@ SCreatedTableInfo createNewChildTableInfo(SToken *pTableName, SArray *pTagNames,
info
.
name
=
*
pToken
;
info
.
pTagNames
=
pTagNames
;
info
.
pTagVals
=
pTagVals
;
info
.
st
ableName
=
*
pTableName
;
info
.
st
bName
=
*
pTableName
;
info
.
igExist
=
(
igExists
->
n
>
0
)
?
1
:
0
;
return
info
;
...
...
source/libs/parser/src/sql.c
浏览文件 @
1cdacd2a
...
...
@@ -2312,14 +2312,14 @@ static void yy_reduce(
break
;
case
26
:
/* cmd ::= SHOW dbPrefix STABLES */
{
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_ST
ABLE
,
&
yymsp
[
-
1
].
minor
.
yy0
,
0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_ST
B
,
&
yymsp
[
-
1
].
minor
.
yy0
,
0
);
}
break
;
case
27
:
/* cmd ::= SHOW dbPrefix STABLES LIKE ids */
{
SToken
token
;
tSetDbName
(
&
token
,
&
yymsp
[
-
3
].
minor
.
yy0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_ST
ABLE
,
&
token
,
&
yymsp
[
0
].
minor
.
yy0
);
setShowOptions
(
pInfo
,
TSDB_MGMT_TABLE_ST
B
,
&
token
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
28
:
/* cmd ::= SHOW dbPrefix VGROUPS */
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
1cdacd2a
...
...
@@ -126,6 +126,8 @@ typedef struct SRpcConn {
SRpcReqContext
*
pContext
;
// request context
}
SRpcConn
;
static
pthread_once_t
tsRpcInitOnce
=
PTHREAD_ONCE_INIT
;
int
tsRpcMaxUdpSize
=
15000
;
// bytes
int
tsProgressTimer
=
100
;
// not configurable
...
...
@@ -220,17 +222,22 @@ static void rpcFree(void *p) {
free
(
p
);
}
int32_t
rpcInit
(
void
)
{
tsProgressTimer
=
tsRpcTimer
/
2
;
tsRpcMaxRetry
=
tsRpcMaxTime
*
1000
/
tsProgressTimer
;
tsRpcHeadSize
=
RPC_MSG_OVERHEAD
;
static
void
rpcInitImp
(
void
)
{
tsProgressTimer
=
tsRpcTimer
/
2
;
tsRpcMaxRetry
=
tsRpcMaxTime
*
1000
/
tsProgressTimer
;
tsRpcHeadSize
=
RPC_MSG_OVERHEAD
;
tsRpcOverhead
=
sizeof
(
SRpcReqContext
);
tsRpcRefId
=
taosOpenRef
(
200
,
rpcFree
);
return
0
;
}
int32_t
rpcInit
(
void
)
{
pthread_once
(
&
tsRpcInitOnce
,
rpcInitImp
);
return
0
;
}
void
rpcCleanup
(
void
)
{
taosCloseRef
(
tsRpcRefId
);
tsRpcRefId
=
-
1
;
...
...
@@ -406,7 +413,7 @@ void rpcSendRequest(void *shandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t
// for TDengine, all the query, show commands shall have TCP connection
char
type
=
pMsg
->
msgType
;
if
(
type
==
TSDB_MSG_TYPE_QUERY
||
type
==
TSDB_MSG_TYPE_SHOW_RETRIEVE
||
type
==
TSDB_MSG_TYPE_FETCH
||
type
==
TSDB_MSG_TYPE_ST
ABLE
_VGROUP
||
type
==
TSDB_MSG_TYPE_FETCH
||
type
==
TSDB_MSG_TYPE_ST
B
_VGROUP
||
type
==
TSDB_MSG_TYPE_TABLES_META
||
type
==
TSDB_MSG_TYPE_TABLE_META
||
type
==
TSDB_MSG_TYPE_SHOW
||
type
==
TSDB_MSG_TYPE_STATUS
||
type
==
TSDB_MSG_TYPE_ALTER_TABLE
)
pContext
->
connType
=
RPC_CONN_TCPC
;
...
...
source/util/src/terror.c
浏览文件 @
1cdacd2a
...
...
@@ -162,22 +162,23 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_VER, "Invalid raw data vers
TAOS_DEFINE_ERROR
(
TSDB_CODE_SDB_INVALID_DATA_LEN
,
"Invalid raw data len"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SDB_INVALID_DATA_CONTENT
,
"Invalid raw data content"
)
// mnode-dnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DNODE_ALREADY_EXIST
,
"DNode already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DNODE_NOT_EXIST
,
"DNode does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_VGROUP_NOT_EXIST
,
"VGroup does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_REMOVE_MASTER
,
"Master DNode cannot be removed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_ENOUGH_DNODES
,
"Out of DNodes"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_CLUSTER_CFG_INCONSISTENT
,
"Cluster cfg inconsistent"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_DNODE_CFG_OPTION
,
"Invalid dnode cfg option"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_BALANCE_ENABLED
,
"Balance already enabled"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CLUSTER_CFG
,
"Cluster cfg inconsistent"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CLUSTER_ID
,
"Cluster id not match"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_DNODE_CFG
,
"Invalid dnode cfg"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_DNODE_EP
,
"Invalid dnode end point"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_DNODE_ID
,
"Invalid dnode id"
)
// mnode-vgroup
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_VGROUP_NOT_EXIST
,
"VGroup does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_VGROUP_NOT_IN_DNODE
,
"Vgroup not in dnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_VGROUP_ALREADY_IN_DNODE
,
"Vgroup already in dnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DNODE_NOT_FREE
,
"Dnode not avaliable"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CLUSTER_ID
,
"Cluster id not match"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Cluster not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DNODE_ID_NOT_CONFIGURED
,
"Dnode Id not configured"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DNODE_EP_NOT_CONFIGURED
,
"Dnode Ep not configured"
)
// mnode-acct
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACCT_ALREADY_EXIST
,
"Account already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACCT_NOT_EXIST
,
"Invalid account"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_ACCT_OPTION
,
"Invalid account options"
)
...
...
@@ -193,8 +194,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_USERS, "Too many users")
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_MNODE_ALREADY_EXIST
,
"Mnode already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_MNODE_NOT_EXIST
,
"Mnode not there"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_
TABLE_ALREADY_EXIST
,
"T
able already exists"
)
// mnode-stable
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_
STB_ALREADY_EXIST
,
"St
able already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_ID
,
"Table name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_NAME
,
"Table does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_TYPE
,
"Invalid table type in tsdb"
)
...
...
src/client/inc/tscParseLine.h
浏览文件 @
1cdacd2a
...
...
@@ -28,7 +28,7 @@ typedef struct {
}
TAOS_SML_KV
;
typedef
struct
{
char
*
st
able
Name
;
char
*
st
b
Name
;
char
*
childTableName
;
TAOS_SML_KV
*
tags
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录