Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
adminstrot
TDengine
提交
04b5df62
TDengine
项目概览
adminstrot
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
04b5df62
编写于
12月 11, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-1241]
上级
d774aa39
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
31 deletion
+24
-31
src/inc/taosmsg.h
src/inc/taosmsg.h
+3
-8
src/inc/tglobalcfg.h
src/inc/tglobalcfg.h
+1
-1
src/inc/trpc.h
src/inc/trpc.h
+2
-0
src/rpc/src/trpc.c
src/rpc/src/trpc.c
+5
-2
src/system/detail/inc/mgmt.h
src/system/detail/inc/mgmt.h
+2
-3
src/system/detail/src/mgmtShell.c
src/system/detail/src/mgmtShell.c
+9
-13
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+2
-4
未找到文件。
src/inc/taosmsg.h
浏览文件 @
04b5df62
...
@@ -224,9 +224,7 @@ typedef struct {
...
@@ -224,9 +224,7 @@ typedef struct {
uint32_t
destId
;
uint32_t
destId
;
char
meterId
[
TSDB_UNI_LEN
];
char
meterId
[
TSDB_UNI_LEN
];
uint16_t
port
;
// for UDP only
uint16_t
port
;
// for UDP only
uint8_t
usePublicIp
:
1
;
char
empty
[
1
];
uint8_t
isCluster
:
1
;
uint8_t
empty
:
6
;
uint8_t
msgType
;
uint8_t
msgType
;
int32_t
msgLen
;
int32_t
msgLen
;
uint8_t
content
[
0
];
uint8_t
content
[
0
];
...
@@ -666,11 +664,8 @@ typedef struct {
...
@@ -666,11 +664,8 @@ typedef struct {
typedef
struct
{
typedef
struct
{
uint32_t
destId
;
uint32_t
destId
;
char
meterId
[
TSDB_UNI_LEN
];
char
meterId
[
TSDB_UNI_LEN
];
uint16_t
port
;
// for UDP only
char
empty
[
3
];
uint8_t
usePublicIp
:
1
;
char
msgType
;
uint8_t
isCluster
:
1
;
uint8_t
empty
:
6
;
uint8_t
msgType
;
int32_t
msgLen
;
int32_t
msgLen
;
uint8_t
content
[
0
];
uint8_t
content
[
0
];
}
SIntMsg
;
}
SIntMsg
;
...
...
src/inc/tglobalcfg.h
浏览文件 @
04b5df62
...
@@ -80,6 +80,7 @@ extern short tsNumOfVnodesPerCore;
...
@@ -80,6 +80,7 @@ extern short tsNumOfVnodesPerCore;
extern
short
tsNumOfTotalVnodes
;
extern
short
tsNumOfTotalVnodes
;
extern
short
tsCheckHeaderFile
;
extern
short
tsCheckHeaderFile
;
extern
uint32_t
tsServerIp
;
extern
uint32_t
tsServerIp
;
extern
uint32_t
tsPublicIpInt
;
extern
int
tsSessionsPerVnode
;
extern
int
tsSessionsPerVnode
;
extern
int
tsAverageCacheBlocks
;
extern
int
tsAverageCacheBlocks
;
...
@@ -151,7 +152,6 @@ extern int tsAdminRowLimit;
...
@@ -151,7 +152,6 @@ extern int tsAdminRowLimit;
extern
int
tsTscEnableRecordSql
;
extern
int
tsTscEnableRecordSql
;
extern
int
tsAnyIp
;
extern
int
tsAnyIp
;
extern
int
tsUsePublicIp
;
extern
int
tsIsCluster
;
extern
int
tsIsCluster
;
extern
char
tsMonitorDbName
[];
extern
char
tsMonitorDbName
[];
...
...
src/inc/trpc.h
浏览文件 @
04b5df62
...
@@ -109,6 +109,8 @@ int taosSetSecurityInfo(int cid, int sid, char *id, int spi, int encrypt, char *
...
@@ -109,6 +109,8 @@ int taosSetSecurityInfo(int cid, int sid, char *id, int spi, int encrypt, char *
void
taosGetRpcConnInfo
(
void
*
thandle
,
uint32_t
*
peerId
,
uint32_t
*
peerIp
,
uint16_t
*
peerPort
,
int
*
cid
,
int
*
sid
);
void
taosGetRpcConnInfo
(
void
*
thandle
,
uint32_t
*
peerId
,
uint32_t
*
peerIp
,
uint16_t
*
peerPort
,
int
*
cid
,
int
*
sid
);
uint32_t
taosGetRpcLocalIp
(
void
*
thandle
);
int
taosGetOutType
(
void
*
thandle
);
int
taosGetOutType
(
void
*
thandle
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/rpc/src/trpc.c
浏览文件 @
04b5df62
...
@@ -246,8 +246,6 @@ char *taosBuildReqHeader(void *param, char type, char *msg) {
...
@@ -246,8 +246,6 @@ char *taosBuildReqHeader(void *param, char type, char *msg) {
pHeader
->
destId
=
pConn
->
peerId
;
pHeader
->
destId
=
pConn
->
peerId
;
pHeader
->
port
=
0
;
pHeader
->
port
=
0
;
pHeader
->
uid
=
(
uint32_t
)
pConn
+
(
uint32_t
)
getpid
();
pHeader
->
uid
=
(
uint32_t
)
pConn
+
(
uint32_t
)
getpid
();
pHeader
->
usePublicIp
=
(
tsUsePublicIp
==
0
?
0
:
1
);
pHeader
->
isCluster
=
(
tsIsCluster
==
0
?
0
:
1
);
memcpy
(
pHeader
->
meterId
,
pConn
->
meterId
,
tListLen
(
pHeader
->
meterId
));
memcpy
(
pHeader
->
meterId
,
pConn
->
meterId
,
tListLen
(
pHeader
->
meterId
));
...
@@ -1412,6 +1410,11 @@ void taosGetRpcConnInfo(void *thandle, uint32_t *peerId, uint32_t *peerIp, uint1
...
@@ -1412,6 +1410,11 @@ void taosGetRpcConnInfo(void *thandle, uint32_t *peerId, uint32_t *peerIp, uint1
*
sid
=
pConn
->
sid
;
*
sid
=
pConn
->
sid
;
}
}
uint32_t
taosGetRpcLocalIp
(
void
*
thandle
)
{
SRpcConn
*
pConn
=
(
SRpcConn
*
)
thandle
;
return
pConn
->
peerIp
;
}
int
taosGetOutType
(
void
*
thandle
)
{
int
taosGetOutType
(
void
*
thandle
)
{
SRpcConn
*
pConn
=
(
SRpcConn
*
)
thandle
;
SRpcConn
*
pConn
=
(
SRpcConn
*
)
thandle
;
if
(
pConn
==
NULL
)
return
-
1
;
if
(
pConn
==
NULL
)
return
-
1
;
...
...
src/system/detail/inc/mgmt.h
浏览文件 @
04b5df62
...
@@ -222,9 +222,8 @@ typedef struct _connObj {
...
@@ -222,9 +222,8 @@ typedef struct _connObj {
char
superAuth
:
1
;
// super user flag
char
superAuth
:
1
;
// super user flag
char
writeAuth
:
1
;
// write flag
char
writeAuth
:
1
;
// write flag
char
killConnection
:
1
;
// kill the connection flag
char
killConnection
:
1
;
// kill the connection flag
char
usePublicIp
:
1
;
// if the connection request is publicIp
uint8_t
usePublicIp
:
1
;
// if the connection request is publicIp
char
isCluster
:
1
;
uint8_t
reserved
:
4
;
char
reserved
:
3
;
uint32_t
queryId
;
// query ID to be killed
uint32_t
queryId
;
// query ID to be killed
uint32_t
streamId
;
// stream ID to be killed
uint32_t
streamId
;
// stream ID to be killed
uint32_t
ip
;
// shell IP
uint32_t
ip
;
// shell IP
...
...
src/system/detail/src/mgmtShell.c
浏览文件 @
04b5df62
...
@@ -1201,12 +1201,6 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
...
@@ -1201,12 +1201,6 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
goto
_rsp
;
goto
_rsp
;
}
}
if
(
pConn
->
isCluster
!=
tsIsCluster
)
{
mError
(
"Cluster Edition and lite Edition cannot be interconnected, client:%d server:%d"
,
pConn
->
isCluster
,
tsIsCluster
);
code
=
TSDB_CODE_INVALID_CLIENT_VERSION
;
goto
_rsp
;
}
if
(
pConnectMsg
->
db
[
0
])
{
if
(
pConnectMsg
->
db
[
0
])
{
sprintf
(
dbName
,
"%x%s%s"
,
pAcct
->
acctId
,
TS_PATH_DELIMITER
,
pConnectMsg
->
db
);
sprintf
(
dbName
,
"%x%s%s"
,
pAcct
->
acctId
,
TS_PATH_DELIMITER
,
pConnectMsg
->
db
);
pDb
=
mgmtGetDb
(
dbName
);
pDb
=
mgmtGetDb
(
dbName
);
...
@@ -1226,7 +1220,12 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
...
@@ -1226,7 +1220,12 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
pConn
->
pAcct
=
pAcct
;
pConn
->
pAcct
=
pAcct
;
pConn
->
pDb
=
pDb
;
pConn
->
pDb
=
pDb
;
pConn
->
pUser
=
pUser
;
pConn
->
pUser
=
pUser
;
uint32_t
peerIp
=
taosGetRpcLocalIp
(
pConn
->
thandle
);
pConn
->
usePublicIp
=
(
peerIp
==
tsPublicIpInt
?
1
:
0
);
mgmtEstablishConn
(
pConn
);
mgmtEstablishConn
(
pConn
);
mPrint
(
"pConn:%p is created, peerIp:%s publicIp:%s usePublicIp:%u"
,
pConn
,
taosIpStr
(
peerIp
),
taosIpStr
(
tsPublicIpInt
),
pConn
->
usePublicIp
);
_rsp:
_rsp:
pStart
=
taosBuildRspMsgWithSize
(
pConn
->
thandle
,
TSDB_MSG_TYPE_CONNECT_RSP
,
128
);
pStart
=
taosBuildRspMsgWithSize
(
pConn
->
thandle
,
TSDB_MSG_TYPE_CONNECT_RSP
,
128
);
...
@@ -1302,15 +1301,12 @@ void *mgmtProcessMsgFromShell(char *msg, void *ahandle, void *thandle) {
...
@@ -1302,15 +1301,12 @@ void *mgmtProcessMsgFromShell(char *msg, void *ahandle, void *thandle) {
pConn
->
thandle
=
thandle
;
pConn
->
thandle
=
thandle
;
strcpy
(
pConn
->
user
,
pMsg
->
meterId
);
strcpy
(
pConn
->
user
,
pMsg
->
meterId
);
uint32_t
i
p
=
taosGetRpcLocalIp
(
thandle
);
uint32_t
peerI
p
=
taosGetRpcLocalIp
(
thandle
);
if
(
ip
==
tsPublicIp
)
{
pConn
->
usePublicIp
=
(
peerIp
==
tsPublicIpInt
?
1
:
0
);
pConn
->
usePublicIp
=
true
;
mPrint
(
"pConn:%p is rebuild, peerIp:%s publicIp:%s usePublicIp:%u"
,
}
pConn
,
taosIpStr
(
peerIp
),
taosIpStr
(
tsPublicIpInt
),
pConn
->
usePublicIp
);
}
}
pConn
->
usePublicIp
=
pMsg
->
usePublicIp
;
pConn
->
isCluster
=
pMsg
->
isCluster
;
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_CONNECT
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_CONNECT
)
{
(
*
mgmtProcessShellMsg
[
pMsg
->
msgType
])((
char
*
)
pMsg
->
content
,
pMsg
->
msgLen
-
sizeof
(
SIntMsg
),
pConn
);
(
*
mgmtProcessShellMsg
[
pMsg
->
msgType
])((
char
*
)
pMsg
->
content
,
pMsg
->
msgLen
-
sizeof
(
SIntMsg
),
pConn
);
}
else
{
}
else
{
...
...
src/util/src/tglobalcfg.c
浏览文件 @
04b5df62
...
@@ -164,7 +164,7 @@ int tsAdminRowLimit = 10240;
...
@@ -164,7 +164,7 @@ int tsAdminRowLimit = 10240;
int
tsTscEnableRecordSql
=
0
;
int
tsTscEnableRecordSql
=
0
;
int
tsEnableCoreFile
=
0
;
int
tsEnableCoreFile
=
0
;
int
tsAnyIp
=
1
;
int
tsAnyIp
=
1
;
int
tsUsePublicIp
=
0
;
uint32_t
tsPublicIpInt
=
0
;
#ifdef CLUSTER
#ifdef CLUSTER
int
tsIsCluster
=
1
;
int
tsIsCluster
=
1
;
...
@@ -789,9 +789,6 @@ static void doInitGlobalConfig() {
...
@@ -789,9 +789,6 @@ static void doInitGlobalConfig() {
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
#endif
#endif
tsInitConfigOption
(
cfg
++
,
"usePublicIp"
,
&
tsUsePublicIp
,
TSDB_CFG_VTYPE_INT
,
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
,
0
,
1
,
0
,
TSDB_CFG_UTYPE_NONE
);
// version info
// version info
tsInitConfigOption
(
cfg
++
,
"gitinfo"
,
gitinfo
,
TSDB_CFG_VTYPE_STRING
,
tsInitConfigOption
(
cfg
++
,
"gitinfo"
,
gitinfo
,
TSDB_CFG_VTYPE_STRING
,
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
,
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
,
...
@@ -916,6 +913,7 @@ bool tsReadGlobalConfig() {
...
@@ -916,6 +913,7 @@ bool tsReadGlobalConfig() {
if
(
tsPublicIp
[
0
]
==
0
)
{
if
(
tsPublicIp
[
0
]
==
0
)
{
strcpy
(
tsPublicIp
,
tsPrivateIp
);
strcpy
(
tsPublicIp
,
tsPrivateIp
);
}
}
tsPublicIpInt
=
inet_addr
(
tsPublicIp
);
if
(
tsLocalIp
[
0
]
==
0
)
{
if
(
tsLocalIp
[
0
]
==
0
)
{
strcpy
(
tsLocalIp
,
tsPrivateIp
);
strcpy
(
tsLocalIp
,
tsPrivateIp
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录