Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
10f78bb5
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
10f78bb5
编写于
2月 18, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dnodeMgmt.c
上级
7fb3fd98
变更
18
展开全部
隐藏空白更改
内联
并排
Showing
18 changed file
with
187 addition
and
667 deletion
+187
-667
src/client/src/tscSql.c
src/client/src/tscSql.c
+3
-3
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
...ector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
+1
-1
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+1
-3
src/dnode/inc/dnodeUtil.h
src/dnode/inc/dnodeUtil.h
+0
-39
src/dnode/inc/dnodeVnodeMgmt.h
src/dnode/inc/dnodeVnodeMgmt.h
+14
-13
src/dnode/inc/dnodeWrite.h
src/dnode/inc/dnodeWrite.h
+9
-28
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+94
-457
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-1
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+2
-2
src/dnode/src/dnodeUtil.c
src/dnode/src/dnodeUtil.c
+0
-25
src/dnode/src/dnodeVnodeMgmt.c
src/dnode/src/dnodeVnodeMgmt.c
+16
-0
src/dnode/src/dnodeWrite.c
src/dnode/src/dnodeWrite.c
+25
-21
src/inc/dnode.h
src/inc/dnode.h
+0
-1
src/inc/mnode.h
src/inc/mnode.h
+1
-0
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/inc/taosmsg.h
src/inc/taosmsg.h
+11
-55
src/mnode/src/mgmtDnodeInt.c
src/mnode/src/mgmtDnodeInt.c
+6
-16
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+2
-2
未找到文件。
src/client/src/tscSql.c
浏览文件 @
10f78bb5
...
...
@@ -1034,7 +1034,7 @@ static int tscParseTblNameList(SSqlObj *pSql, const char *tblNameList, int32_t t
pCmd
->
command
=
TSDB_SQL_MULTI_META
;
pCmd
->
count
=
0
;
int
code
=
TSDB_CODE_INVALID_
METER
_ID
;
int
code
=
TSDB_CODE_INVALID_
TABLE
_ID
;
char
*
str
=
(
char
*
)
tblNameList
;
SQueryInfo
*
pQueryInfo
=
NULL
;
...
...
@@ -1070,7 +1070,7 @@ static int tscParseTblNameList(SSqlObj *pSql, const char *tblNameList, int32_t t
// Check if the table name available or not
if
(
tscValidateName
(
&
sToken
)
!=
TSDB_CODE_SUCCESS
)
{
code
=
TSDB_CODE_INVALID_
METER
_ID
;
code
=
TSDB_CODE_INVALID_
TABLE
_ID
;
sprintf
(
pCmd
->
payload
,
"table name is invalid"
);
return
code
;
}
...
...
@@ -1080,7 +1080,7 @@ static int tscParseTblNameList(SSqlObj *pSql, const char *tblNameList, int32_t t
}
if
(
++
pCmd
->
count
>
TSDB_MULTI_METERMETA_MAX_NUM
)
{
code
=
TSDB_CODE_INVALID_
METER
_ID
;
code
=
TSDB_CODE_INVALID_
TABLE
_ID
;
sprintf
(
pCmd
->
payload
,
"tables over the max number"
);
return
code
;
}
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBError.java
浏览文件 @
10f78bb5
...
...
@@ -48,7 +48,7 @@ public enum TSDBError {
TSDB_CODE_INVALID_VALUE
(
24
,
"invalid value"
),
TSDB_CODE_REDIRECT
(
25
,
"service not available"
),
TSDB_CODE_ALREADY_THERE
(
26
,
"already there"
),
TSDB_CODE_INVALID_
METER
_ID
(
27
,
"invalid meter ID"
),
TSDB_CODE_INVALID_
TABLE
_ID
(
27
,
"invalid meter ID"
),
TSDB_CODE_INVALID_SQL
(
28
,
"invalid SQL"
),
// this message often comes with additional info which will vary based on the specific error situation
TSDB_CODE_NETWORK_UNAVAIL
(
29
,
"failed to connect to server"
),
TSDB_CODE_INVALID_MSG_LEN
(
30
,
"invalid msg len"
),
...
...
src/dnode/inc/dnodeMgmt.h
浏览文件 @
10f78bb5
...
...
@@ -25,12 +25,10 @@ extern "C" {
#include "tsched.h"
#include "dnode.h"
int
dnodeProcessCreateTableRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
int
dnodeProcessRemoveTableRequest
(
char
*
pMsg
,
int
msgLen
,
SMgmtObj
*
pMgmtObj
);
void
dnodeDistributeMsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
);
extern
void
*
dm
Qhandle
;
extern
void
*
tsDnodeMgmt
Qhandle
;
void
dnodeSendVpeerCfgMsg
(
int32_t
vnode
);
void
dnodeSendMeterCfgMsg
(
int32_t
vnode
,
int32_t
sid
);
...
...
src/dnode/inc/dnodeUtil.h
已删除
100644 → 0
浏览文件 @
7fb3fd98
/*
* 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/>.
*/
#ifndef TDENGINE_DNODE_UTIL_H
#define TDENGINE_DNODE_UTIL_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdbool.h>
#include <stdint.h>
#include "taosdef.h"
#include "taosmsg.h"
#include "tstatus.h"
EVnodeStatus
dnodeGetVnodeStatus
(
int32_t
vnode
);
bool
dnodeCheckVnodeExist
(
int32_t
vnode
);
void
*
dnodeGetVnodeObj
(
int32_t
vnode
);
#ifdef __cplusplus
}
#endif
#endif
src/dnode/inc/dnodeVnodeMgmt.h
浏览文件 @
10f78bb5
...
...
@@ -21,9 +21,10 @@ extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include "taosdef.h"
#include "taosmsg.h"
#include "tstatus.h"
/*
* Open all Vnodes in the local data directory
...
...
@@ -38,34 +39,34 @@ int32_t dnodeCleanupVnodes();
/*
* Check if vnode already exists
*/
int32_t
dnodeCheckVnodeExist
(
in
t
vid
);
bool
dnodeCheckVnodeExist
(
int32_
t
vid
);
/*
* Create vnode with specified configuration and open it
* if exist, config it
*/
//tsdb_repo_t* dnodeCreateVnode(int vid, SVnodeCfg *cfg);
void
*
dnodeCreateVnode
(
int
vid
,
SVnodeCfg
*
cfg
);
void
*
dnodeCreateVnode
(
int32_t
vnode
,
SVPeersMsg
*
cfg
);
/*
*
Modify vnode configuration information
*
Remove vnode from local repository
*/
int32_t
dnode
ConfigVnode
(
int
vid
,
SVnodeCfg
*
cfg
);
int32_t
dnode
DropVnode
(
int32_t
vnode
);
/*
*
Modify vnode replication information
*
Get the vnode object that has been opened
*/
int32_t
dnodeConfigVnodePeers
(
int
vid
/*, SVpeerCfgMsg *cfg*/
);
//tsdb_repo_t* dnodeGetVnode(int vid);
void
*
dnodeGetVnode
(
int
vid
);
/*
*
Remove vnode from local repository
*
get the status of vnode
*/
int32_t
dnodeDropVnode
(
int
vid
);
EVnodeStatus
dnodeGetVnodeStatus
(
int32_t
vnode
);
/*
*
Get the vnode object that has been opened
*
Check if vnode already exists, and table exist in this vnode
*/
//tsdb_repo_t* dnodeGetVnode(int vid);
void
*
dnodeGetVnode
(
int
vid
);
bool
dnodeCheckTableExist
(
int32_t
vnode
,
int32_t
sid
,
int64_t
uid
);
#ifdef __cplusplus
}
...
...
src/dnode/inc/dnodeWrite.h
浏览文件 @
10f78bb5
...
...
@@ -35,45 +35,26 @@ extern "C" {
void
dnodeWriteData
(
SShellSubmitMsg
*
pSubmit
,
void
*
pConn
,
void
(
*
callback
)(
SShellSubmitRspMsg
*
rsp
,
void
*
pConn
));
/*
* Create noraml table with specified configuration and open it
* Create table with specified configuration and open it
* if table already exist, update its schema and tag
*/
int32_t
dnodeCreate
NormalTable
(
SCreateNormal
TableMsg
*
table
);
int32_t
dnodeCreate
Table
(
SDCreate
TableMsg
*
table
);
/*
* Create stream table with specified configuration and open it
*/
int32_t
dnodeCreateStreamTable
(
SCreateStreamTableMsg
*
table
);
/*
* Create child table with specified configuration and open it
*/
int32_t
dnodeCreateChildTable
(
SCreateChildTableMsg
*
table
);
/*
* Modify normal table configuration information
*
*/
int32_t
dnodeAlterNormalTable
(
SCreateNormalTableMsg
*
table
);
/*
* Modify stream table configuration information
* Remove table from local repository
*/
int32_t
dnode
AlterStreamTable
(
SCreateStreamTableMsg
*
table
);
int32_t
dnode
DropTable
(
int32_t
vnode
,
int32_t
sid
,
uint64_t
uid
);
/*
* Modify child table configuration information
* Create stream
* if stream already exist, update it
*/
int32_t
dnode
AlterChildTable
(
SCreateChildTableMsg
*
table
);
int32_t
dnode
CreateStream
(
SAlterStreamMsg
*
stream
);
/*
* Remove all child tables of supertable from local repository
*/
int32_t
dnodeDropSuperTable
(
int
vid
,
int
sid
,
int64_t
uid
);
/*
* Remove table from local repository
*/
int32_t
dnodeDropTable
(
int
vid
,
int
sid
,
int64_t
uid
);
int32_t
dnodeDropSuperTable
(
uint64_t
stableUid
);
#ifdef __cplusplus
}
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
10f78bb5
此差异已折叠。
点击以展开。
src/dnode/src/dnodeShell.c
浏览文件 @
10f78bb5
...
...
@@ -29,7 +29,7 @@
#include "dnodeRead.h"
#include "dnodeSystem.h"
#include "dnodeShell.h"
#include "dnode
Util
.h"
#include "dnode
VnodeMgmt
.h"
#include "dnodeWrite.h"
static
void
dnodeProcessRetrieveRequest
(
int8_t
*
pCont
,
int32_t
contLen
,
void
*
pConn
);
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
10f78bb5
...
...
@@ -53,7 +53,7 @@ static int32_t dnodeInitTmrCtl();
void
*
tsStatusTimer
=
NULL
;
void
*
vnodeTmrCtrl
;
void
**
tsRpcQhandle
;
void
*
dm
Qhandle
;
void
*
tsDnodeMgmt
Qhandle
;
void
*
tsQueryQhandle
;
int32_t
tsVnodePeers
=
TSDB_VNODES_SUPPORT
-
1
;
int32_t
tsMaxQueues
;
...
...
@@ -298,7 +298,7 @@ static int32_t dnodeInitRpcQHandle() {
tsRpcQhandle
[
i
]
=
taosInitScheduler
(
tsSessionsPerVnode
,
1
,
"dnode"
);
}
dm
Qhandle
=
taosInitScheduler
(
tsSessionsPerVnode
,
1
,
"mgmt"
);
tsDnodeMgmt
Qhandle
=
taosInitScheduler
(
tsSessionsPerVnode
,
1
,
"mgmt"
);
return
0
;
}
...
...
src/dnode/src/dnodeUtil.c
已删除
100644 → 0
浏览文件 @
7fb3fd98
/*
* 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/>.
*/
#define _DEFAULT_SOURCE
#include "dnodeUtil.h"
EVnodeStatus
dnodeGetVnodeStatus
(
int32_t
vnode
)
{
return
TSDB_VN_STATUS_MASTER
;
}
bool
dnodeCheckVnodeExist
(
int32_t
vnode
)
{
return
true
;
}
src/dnode/src/dnodeVnodeMgmt.c
浏览文件 @
10f78bb5
...
...
@@ -14,4 +14,20 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tlog.h"
#include "taoserror.h"
#include "dnodeVnodeMgmt.h"
EVnodeStatus
dnodeGetVnodeStatus
(
int32_t
vnode
)
{
return
TSDB_VN_STATUS_MASTER
;
}
bool
dnodeCheckVnodeExist
(
int32_t
vnode
)
{
return
true
;
}
bool
dnodeCheckTableExist
(
int32_t
vnode
,
int32_t
sid
,
int64_t
uid
)
{
return
true
;
}
src/dnode/src/dnodeWrite.c
浏览文件 @
10f78bb5
...
...
@@ -18,6 +18,7 @@
#include "taoserror.h"
#include "tlog.h"
#include "dnodeWrite.h"
#include "dnodeVnodeMgmt.h"
void
dnodeWriteData
(
SShellSubmitMsg
*
pSubmit
,
void
*
pConn
,
void
(
*
callback
)(
SShellSubmitRspMsg
*
rsp
,
void
*
pConn
))
{
SShellSubmitRspMsg
result
=
{
0
};
...
...
@@ -32,35 +33,38 @@ void dnodeWriteData(SShellSubmitMsg *pSubmit, void *pConn, void (*callback)(SShe
//TODO: submit implementation
}
int32_t
dnodeCreate
NormalTable
(
SCreateNormal
TableMsg
*
table
)
{
return
0
;
int32_t
dnodeCreate
Table
(
SDCreate
TableMsg
*
table
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
dnodeCreateStreamTable
(
SCreateStreamTableMsg
*
table
)
{
return
0
;
}
int32_t
dnodeCreateChildTable
(
SCreateChildTableMsg
*
table
)
{
return
0
;
}
int32_t
dnodeAlterNormalTable
(
SCreateNormalTableMsg
*
table
)
{
return
0
;
/*
* Remove table from local repository
*/
int32_t
dnodeDropTable
(
int32_t
vnode
,
int32_t
sid
,
uint64_t
uid
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
dnodeAlterStreamTable
(
SCreateStreamTableMsg
*
table
)
{
return
0
;
}
/*
* Create stream
* if stream already exist, update it
*/
int32_t
dnodeCreateStream
(
SAlterStreamMsg
*
stream
)
{
int32_t
vnode
=
htonl
(
stream
->
vnode
);
int32_t
sid
=
htonl
(
stream
->
sid
);
uint64_t
uid
=
htobe64
(
stream
->
uid
);
int32_t
dnodeAlterChildTable
(
SCreateChildTableMsg
*
table
)
{
return
0
;
}
if
(
!
dnodeCheckTableExist
(
vnode
,
sid
,
uid
)
)
{
return
TSDB_CODE_INVALID_TABLE
;
}
int32_t
dnodeDropSuperTable
(
int
vid
,
int
sid
,
int64_t
uid
)
{
return
0
;
//TODO create or remove stream
}
int32_t
dnodeDropTable
(
int
vid
,
int
sid
,
int64_t
uid
)
{
return
0
;
/*
* Remove all child tables of supertable from local repository
*/
int32_t
dnodeDropSuperTable
(
uint64_t
stableUid
)
{
return
TSDB_CODE_SUCCESS
;
}
src/inc/dnode.h
浏览文件 @
10f78bb5
...
...
@@ -49,7 +49,6 @@ extern char *(*taosBuildRspMsgToMnodeWithSize)(SMgmtObj *pObj, char type, int si
extern
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
int
(
*
taosSendMsgToMnode
)(
SMgmtObj
*
pObj
,
char
*
msg
,
int
msgLen
);
extern
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
extern
void
(
*
dnodeInitMgmtIp
)();
extern
int
(
*
dnodeInitMgmt
)();
...
...
src/inc/mnode.h
浏览文件 @
10f78bb5
...
...
@@ -335,6 +335,7 @@ typedef struct {
char
payload
[];
/* payload for wildcard match in show tables */
}
SShowObj
;
void
mgmtProcessMsgFromDnode
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
);
#ifdef __cplusplus
}
...
...
src/inc/taoserror.h
浏览文件 @
10f78bb5
...
...
@@ -161,6 +161,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_VNODE_STATUS, 0, 116, "invalid vnode s
TAOS_DEFINE_ERROR
(
TSDB_CODE_FAILED_TO_LOCK_RESOURCES
,
0
,
117
,
"failed to lock resources"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TABLE_ID_MISMATCH
,
0
,
118
,
"table id mismatch"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_QUERY_CACHE_ERASED
,
0
,
119
,
"query cache erased"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_MSG
,
0
,
120
,
"invalid message"
)
#ifdef TAOS_ERROR_C
};
...
...
src/inc/taosmsg.h
浏览文件 @
10f78bb5
...
...
@@ -313,72 +313,28 @@ typedef struct SSchema {
short
bytes
;
}
SSchema
;
typedef
struct
SMColumn
{
typedef
struct
{
int8_t
type
;
int16_t
colId
;
int16_t
bytes
;
}
SMColumn
;
typedef
struct
{
int32_t
size
;
int8_t
*
data
;
}
SVariableMsg
;
typedef
struct
{
short
vnode
;
int32_t
sid
;
uint64_t
uid
;
char
spi
;
char
encrypt
;
char
meterId
[
TSDB_TABLE_ID_LEN
];
char
secret
[
TSDB_KEY_LEN
];
char
cipheringKey
[
TSDB_KEY_LEN
];
uint64_t
timeStamp
;
uint64_t
lastCreate
;
short
numOfColumns
;
short
sqlLen
;
// SQL string is after schema
char
reserved
[
16
];
int32_t
sversion
;
SMColumn
schema
[];
}
SCreateMsg
;
}
SDTableColumn
;
typedef
struct
{
int32_t
vnode
;
int32_t
sid
;
uint64_t
uid
;
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
char
superTableId
[
TSDB_TABLE_ID_LEN
+
1
];
uint64_t
createdTime
;
uint64_t
superTableUid
;
int32_t
tableType
;
int32_t
sversion
;
int16_t
numOfColumns
;
int16_t
numOfTags
;
int32_t
tagDataLen
;
int8_t
data
[];
}
SCreateChildTableMsg
;
typedef
struct
{
int32_t
vnode
;
int32_t
sid
;
uint64_t
uid
;
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
int32_t
sqlDataLen
;
uint64_t
createdTime
;
int32_t
sversion
;
int16_t
numOfColumns
;
int8_t
data
[];
}
SCreateNormalTableMsg
;
typedef
struct
{
int32_t
vnode
;
int32_t
sid
;
uint64_t
uid
;
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
uint64_t
createdTime
;
int32_t
sversion
;
int16_t
numOfColumns
;
int32_t
sqlLen
;
char
superTableId
[
TSDB_TABLE_ID_LEN
+
1
];
int8_t
data
[];
}
SCreateStreamTableMsg
;
}
SDCreateTableMsg
;
typedef
struct
{
char
db
[
TSDB_TABLE_ID_LEN
];
...
...
@@ -468,10 +424,10 @@ typedef struct {
int32_t
sid
;
uint64_t
uid
;
char
meterId
[
TSDB_TABLE_ID_LEN
];
}
S
RemoveMeter
Msg
;
}
S
DRemoveTable
Msg
;
typedef
struct
{
shor
t
vnode
;
int32_
t
vnode
;
}
SFreeVnodeMsg
;
typedef
struct
SColIndexEx
{
...
...
@@ -923,11 +879,11 @@ typedef struct {
}
SKillQuery
,
SKillStream
,
SKillConnection
;
typedef
struct
{
short
vnode
;
int32_t
vnode
;
int32_t
sid
;
uint64_t
uid
;
uint64_t
stime
;
// stream starting time
char
status
;
int32_t
status
;
}
SAlterStreamMsg
;
#pragma pack(pop)
...
...
src/mnode/src/mgmtDnodeInt.c
浏览文件 @
10f78bb5
...
...
@@ -78,7 +78,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
pMsg
=
mgmtBuildCreateMeterIe
(
pTable
,
pMsg
,
vnode
);
}
else
{
mTrace
(
"dnode:%s, vnode:%d sid:%d, meter not there"
,
taosIpStr
(
pObj
->
privateIp
),
vnode
,
sid
);
*
pMsg
=
TSDB_CODE_INVALID_
METER
_ID
;
*
pMsg
=
TSDB_CODE_INVALID_
TABLE
_ID
;
pMsg
++
;
*
(
int32_t
*
)
pMsg
=
htonl
(
vnode
);
...
...
@@ -307,7 +307,7 @@ int32_t mgmtSendCreateNormalTableMsg(SNormalTableObj *pTable, SVgObj *pVgroup) {
}
int
mgmtSendRemoveMeterMsgToDnode
(
STabObj
*
pTable
,
SVgObj
*
pVgroup
)
{
S
RemoveMeter
Msg
*
pRemove
;
S
DRemoveTable
Msg
*
pRemove
;
char
*
pMsg
,
*
pStart
;
int
i
,
msgLen
=
0
;
SDnodeObj
*
pObj
;
...
...
@@ -326,12 +326,12 @@ int mgmtSendRemoveMeterMsgToDnode(STabObj *pTable, SVgObj *pVgroup) {
if
(
pStart
==
NULL
)
continue
;
pMsg
=
pStart
;
pRemove
=
(
S
RemoveMeter
Msg
*
)
pMsg
;
pRemove
=
(
S
DRemoveTable
Msg
*
)
pMsg
;
pRemove
->
vnode
=
htons
(
pVgroup
->
vnodeGid
[
i
].
vnode
);
pRemove
->
sid
=
htonl
(
pTable
->
gid
.
sid
);
memcpy
(
pRemove
->
meterId
,
pTable
->
meterId
,
TSDB_TABLE_ID_LEN
);
pMsg
+=
sizeof
(
S
RemoveMeter
Msg
);
pMsg
+=
sizeof
(
S
DRemoveTable
Msg
);
msgLen
=
pMsg
-
pStart
;
taosSendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
...
...
@@ -559,7 +559,7 @@ int mgmtSendCfgDnodeMsg(char *cont) {
* functions for communicate between dnode and mnode
*/
extern
void
*
dm
Qhandle
;
extern
void
*
tsDnodeMgmt
Qhandle
;
void
*
mgmtStatusTimer
=
NULL
;
void
mgmtProcessMsgFromDnode
(
char
*
content
,
int
msgLen
,
int
msgType
,
SDnodeObj
*
pObj
);
...
...
@@ -608,7 +608,7 @@ int32_t taosSendMsgToDnodeImp(SDnodeObj *pObj, char *msg, int32_t msgLen) {
schedMsg
.
msg
=
msg
-
1
;
schedMsg
.
ahandle
=
NULL
;
schedMsg
.
thandle
=
NULL
;
taosScheduleTask
(
dm
Qhandle
,
&
schedMsg
);
taosScheduleTask
(
tsDnodeMgmt
Qhandle
,
&
schedMsg
);
return
0
;
}
...
...
@@ -682,13 +682,3 @@ void mgmtProcessDnodeStatusImp(void *handle, void *tmrId) {
*/
}
void
(
*
mgmtProcessDnodeStatus
)(
void
*
handle
,
void
*
tmrId
)
=
mgmtProcessDnodeStatusImp
;
void
mgmtProcessMsgFromDnodeSpecImp
(
SSchedMsg
*
sched
)
{
char
msgType
=
*
sched
->
msg
;
char
*
content
=
sched
->
msg
+
1
;
mTrace
(
"msg:%s is received from dnode"
,
taosMsg
[(
uint8_t
)
msgType
]);
mgmtProcessMsgFromDnode
(
content
,
0
,
msgType
,
mgmtGetDnode
(
0
));
free
(
sched
->
msg
);
}
void
(
*
mgmtProcessMsgFromDnodeSpec
)(
SSchedMsg
*
sched
)
=
mgmtProcessMsgFromDnodeSpecImp
;
src/mnode/src/mgmtVgroup.c
浏览文件 @
10f78bb5
...
...
@@ -296,11 +296,11 @@ int mgmtGetVgroupMeta(SMeterMeta *pMeta, SShowObj *pShow, SConnObj *pConn) {
if
(
pShow
->
payloadLen
>
0
)
{
pTable
=
mgmtGetTable
(
pShow
->
payload
);
if
(
NULL
==
pTable
)
{
return
TSDB_CODE_INVALID_
METER
_ID
;
return
TSDB_CODE_INVALID_
TABLE
_ID
;
}
pVgroup
=
mgmtGetVgroup
(
pTable
->
gid
.
vgId
);
if
(
NULL
==
pVgroup
)
return
TSDB_CODE_INVALID_
METER
_ID
;
if
(
NULL
==
pVgroup
)
return
TSDB_CODE_INVALID_
TABLE
_ID
;
maxReplica
=
pVgroup
->
numOfVnodes
>
maxReplica
?
pVgroup
->
numOfVnodes
:
maxReplica
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录