Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2a3c43ab
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2a3c43ab
编写于
3月 17, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10] change some log format
上级
562967f1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
29 deletion
+35
-29
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+2
-2
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+9
-15
src/dnode/src/dnodeMnode.c
src/dnode/src/dnodeMnode.c
+8
-8
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+3
-3
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+12
-0
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+1
-1
未找到文件。
src/dnode/src/dnodeMClient.c
浏览文件 @
2a3c43ab
...
@@ -41,11 +41,11 @@ int32_t dnodeInitMClient() {
...
@@ -41,11 +41,11 @@ int32_t dnodeInitMClient() {
tsDnodeMClientRpc
=
rpcOpen
(
&
rpcInit
);
tsDnodeMClientRpc
=
rpcOpen
(
&
rpcInit
);
if
(
tsDnodeMClientRpc
==
NULL
)
{
if
(
tsDnodeMClientRpc
==
NULL
)
{
dError
(
"failed to init
connection from mgm
t"
);
dError
(
"failed to init
mnode rpc clien
t"
);
return
-
1
;
return
-
1
;
}
}
dPrint
(
"
client connection to mgm
t is opened"
);
dPrint
(
"
mnode rpc clien
t is opened"
);
return
0
;
return
0
;
}
}
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
2a3c43ab
...
@@ -80,13 +80,6 @@ int32_t dnodeInitMgmt() {
...
@@ -80,13 +80,6 @@ int32_t dnodeInitMgmt() {
}
}
taosTmrReset
(
dnodeSendStatusMsg
,
500
,
NULL
,
tsDnodeTmr
,
&
tsStatusTimer
);
taosTmrReset
(
dnodeSendStatusMsg
,
500
,
NULL
,
tsDnodeTmr
,
&
tsStatusTimer
);
SMDCreateVnodeMsg
cfg
;
cfg
.
cfg
.
vgId
=
1
;
cfg
.
cfg
.
precision
=
0
;
cfg
.
vnode
=
1
;
cfg
.
cfg
.
maxSessions
=
1000
;
cfg
.
cfg
.
daysPerFile
=
10
;
return
dnodeOpenVnodes
();
return
dnodeOpenVnodes
();
}
}
...
@@ -171,8 +164,8 @@ static int32_t dnodeOpenVnodes() {
...
@@ -171,8 +164,8 @@ static int32_t dnodeOpenVnodes() {
int32_t
vnode
=
atoi
(
de
->
d_name
+
5
);
int32_t
vnode
=
atoi
(
de
->
d_name
+
5
);
if
(
vnode
==
0
)
continue
;
if
(
vnode
==
0
)
continue
;
char
vnodeDir
[
TSDB_FILENAME_LEN
];
char
vnodeDir
[
TSDB_FILENAME_LEN
*
3
];
s
printf
(
vnodeDir
,
"%s/%s"
,
tsVnodeDir
,
de
->
d_name
);
s
nprintf
(
vnodeDir
,
TSDB_FILENAME_LEN
*
3
,
"%s/%s"
,
tsVnodeDir
,
de
->
d_name
);
int32_t
code
=
dnodeOpenVnode
(
vnode
,
vnodeDir
);
int32_t
code
=
dnodeOpenVnode
(
vnode
,
vnodeDir
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
numOfVnodes
++
;
numOfVnodes
++
;
...
@@ -181,7 +174,7 @@ static int32_t dnodeOpenVnodes() {
...
@@ -181,7 +174,7 @@ static int32_t dnodeOpenVnodes() {
}
}
closedir
(
dir
);
closedir
(
dir
);
dPrint
(
"
all vnodes is opened, num
:%d"
,
numOfVnodes
);
dPrint
(
"
dnode mgmt is opened, vnodes
:%d"
,
numOfVnodes
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -189,7 +182,7 @@ typedef void (*CleanupFp)(char *);
...
@@ -189,7 +182,7 @@ typedef void (*CleanupFp)(char *);
static
void
dnodeCleanupVnodes
()
{
static
void
dnodeCleanupVnodes
()
{
int32_t
num
=
taosGetIntHashSize
(
tsDnodeVnodesHash
);
int32_t
num
=
taosGetIntHashSize
(
tsDnodeVnodesHash
);
taosCleanUpIntHashWithFp
(
tsDnodeVnodesHash
,
(
CleanupFp
)
dnodeCleanupVnode
);
taosCleanUpIntHashWithFp
(
tsDnodeVnodesHash
,
(
CleanupFp
)
dnodeCleanupVnode
);
dPrint
(
"
all vnodes is opened, num
:%d"
,
num
);
dPrint
(
"
dnode mgmt is closed, vnodes
:%d"
,
num
);
}
}
static
int32_t
dnodeOpenVnode
(
int32_t
vnode
,
char
*
rootDir
)
{
static
int32_t
dnodeOpenVnode
(
int32_t
vnode
,
char
*
rootDir
)
{
...
@@ -401,10 +394,11 @@ static void dnodeProcessAlterStreamMsg(SRpcMsg *pMsg) {
...
@@ -401,10 +394,11 @@ static void dnodeProcessAlterStreamMsg(SRpcMsg *pMsg) {
}
}
static
void
dnodeProcessConfigDnodeMsg
(
SRpcMsg
*
pMsg
)
{
static
void
dnodeProcessConfigDnodeMsg
(
SRpcMsg
*
pMsg
)
{
// SCfgDnodeMsg *pCfg = (SCfgDnodeMsg *)pCont;
SMDCfgDnodeMsg
*
pCfg
=
(
SMDCfgDnodeMsg
*
)
pMsg
->
pCont
;
//
int32_t
code
=
tsCfgDynamicOptions
(
pCfg
->
config
);
// int32_t code = tsCfgDynamicOptions(pCfg->config);
// dnodeSendRspToMnode(pConn, msgType + 1, code, NULL, 0);
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
code
,
.
msgType
=
0
};
rpcSendResponse
(
&
rpcRsp
);
}
}
static
void
dnodeSendStatusMsg
(
void
*
handle
,
void
*
tmrId
)
{
static
void
dnodeSendStatusMsg
(
void
*
handle
,
void
*
tmrId
)
{
...
...
src/dnode/src/dnodeMnode.c
浏览文件 @
2a3c43ab
...
@@ -40,41 +40,41 @@ int32_t dnodeInitMnode() {
...
@@ -40,41 +40,41 @@ int32_t dnodeInitMnode() {
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
localIp
=
tsAnyIp
?
"0.0.0.0"
:
tsPrivateIp
;
rpcInit
.
localIp
=
tsAnyIp
?
"0.0.0.0"
:
tsPrivateIp
;
rpcInit
.
localPort
=
tsDnodeMnodePort
;
rpcInit
.
localPort
=
tsDnodeMnodePort
;
rpcInit
.
label
=
"DND-m
gmt
"
;
rpcInit
.
label
=
"DND-m
node
"
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
cfp
=
dnodeProcessMsgFromMnode
;
rpcInit
.
cfp
=
dnodeProcessMsgFromMnode
;
rpcInit
.
sessions
=
TSDB_SESSIONS_PER_DNODE
;
rpcInit
.
sessions
=
TSDB_SESSIONS_PER_DNODE
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1
5
00
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1
0
00
;
tsDnodeMnodeRpc
=
rpcOpen
(
&
rpcInit
);
tsDnodeMnodeRpc
=
rpcOpen
(
&
rpcInit
);
if
(
tsDnodeMnodeRpc
==
NULL
)
{
if
(
tsDnodeMnodeRpc
==
NULL
)
{
dError
(
"failed to init
connection from mgmt
"
);
dError
(
"failed to init
mnode rpc server
"
);
return
-
1
;
return
-
1
;
}
}
dPrint
(
"
connection to mgmt
is opened"
);
dPrint
(
"
mnode rpc server
is opened"
);
return
0
;
return
0
;
}
}
void
dnodeCleanupMnode
()
{
void
dnodeCleanupMnode
()
{
if
(
tsDnodeMnodeRpc
)
{
if
(
tsDnodeMnodeRpc
)
{
rpcClose
(
tsDnodeMnodeRpc
);
rpcClose
(
tsDnodeMnodeRpc
);
tsDnodeMnodeRpc
=
NULL
;
}
}
}
}
static
void
dnodeProcessMsgFromMnode
(
SRpcMsg
*
pMsg
)
{
static
void
dnodeProcessMsgFromMnode
(
SRpcMsg
*
pMsg
)
{
SRpcMsg
rspMsg
;
SRpcMsg
rspMsg
;
rspMsg
.
handle
=
pMsg
->
handle
;
rspMsg
.
handle
=
pMsg
->
handle
;
rspMsg
.
pCont
=
NULL
;
rspMsg
.
pCont
=
NULL
;
rspMsg
.
contLen
=
0
;
rspMsg
.
contLen
=
0
;
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_RUNING
)
{
rspMsg
.
code
=
TSDB_CODE_NOT_READY
;
rspMsg
.
code
=
TSDB_CODE_NOT_READY
;
rpcSendResponse
(
&
rspMsg
);
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
dTrace
(
"
conn
:%p, query msg is ignored since dnode not running"
,
pMsg
->
handle
);
dTrace
(
"
thandle
:%p, query msg is ignored since dnode not running"
,
pMsg
->
handle
);
return
;
return
;
}
}
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
2a3c43ab
...
@@ -53,15 +53,15 @@ int32_t dnodeInitShell() {
...
@@ -53,15 +53,15 @@ int32_t dnodeInitShell() {
rpcInit
.
sessions
=
TSDB_SESSIONS_PER_DNODE
;
rpcInit
.
sessions
=
TSDB_SESSIONS_PER_DNODE
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1500
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1500
;
rpcInit
.
afp
=
rpcInit
.
afp
=
dnodeRetrieveUserAuthInfo
;
tsDnodeShellRpc
=
rpcOpen
(
&
rpcInit
);
tsDnodeShellRpc
=
rpcOpen
(
&
rpcInit
);
if
(
tsDnodeShellRpc
==
NULL
)
{
if
(
tsDnodeShellRpc
==
NULL
)
{
dError
(
"failed to init
connection from shell
"
);
dError
(
"failed to init
shell rpc server
"
);
return
-
1
;
return
-
1
;
}
}
dPrint
(
"
connection to shell
is opened"
);
dPrint
(
"
shell rpc server
is opened"
);
return
0
;
return
0
;
}
}
...
...
src/mnode/src/mgmtDnode.c
浏览文件 @
2a3c43ab
...
@@ -44,6 +44,7 @@ static int32_t mgmtRetrieveConfigs(SShowObj *pShow, char *data, int32_t rows, vo
...
@@ -44,6 +44,7 @@ static int32_t mgmtRetrieveConfigs(SShowObj *pShow, char *data, int32_t rows, vo
static
int32_t
mgmtGetVnodeMeta
(
STableMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtGetVnodeMeta
(
STableMeta
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtRetrieveVnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mgmtRetrieveVnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
void
mgmtProcessCfgDnodeMsg
(
SQueuedMsg
*
pMsg
);
static
void
mgmtProcessCfgDnodeMsg
(
SQueuedMsg
*
pMsg
);
static
void
mgmtProcessCfgDnodeMsgRsp
(
SRpcMsg
*
rpcMsg
)
;
void
mgmtSetDnodeMaxVnodes
(
SDnodeObj
*
pDnode
)
{
void
mgmtSetDnodeMaxVnodes
(
SDnodeObj
*
pDnode
)
{
int32_t
maxVnodes
=
pDnode
->
numOfCores
*
tsNumOfVnodesPerCore
;
int32_t
maxVnodes
=
pDnode
->
numOfCores
*
tsNumOfVnodesPerCore
;
...
@@ -435,6 +436,8 @@ int32_t mgmtInitDnodes() {
...
@@ -435,6 +436,8 @@ int32_t mgmtInitDnodes() {
mgmtAddShellShowMetaHandle
(
TSDB_MGMT_TABLE_VNODES
,
mgmtGetVnodeMeta
);
mgmtAddShellShowMetaHandle
(
TSDB_MGMT_TABLE_VNODES
,
mgmtGetVnodeMeta
);
mgmtAddShellShowRetrieveHandle
(
TSDB_MGMT_TABLE_VNODES
,
mgmtRetrieveVnodes
);
mgmtAddShellShowRetrieveHandle
(
TSDB_MGMT_TABLE_VNODES
,
mgmtRetrieveVnodes
);
mgmtAddShellMsgHandle
(
TSDB_MSG_TYPE_CM_CONFIG_DNODE
,
mgmtProcessCfgDnodeMsg
);
mgmtAddShellMsgHandle
(
TSDB_MSG_TYPE_CM_CONFIG_DNODE
,
mgmtProcessCfgDnodeMsg
);
mgmtAddDClientRspHandle
(
TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP
,
mgmtProcessCfgDnodeMsgRsp
);
if
(
mgmtInitDnodesFp
)
{
if
(
mgmtInitDnodesFp
)
{
return
mgmtInitDnodesFp
();
return
mgmtInitDnodesFp
();
...
@@ -532,6 +535,11 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
...
@@ -532,6 +535,11 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
if
(
mgmtCheckRedirect
(
pMsg
->
thandle
))
return
;
if
(
mgmtCheckRedirect
(
pMsg
->
thandle
))
return
;
SCMCfgDnodeMsg
*
pCmCfgDnode
=
pMsg
->
pCont
;
SCMCfgDnodeMsg
*
pCmCfgDnode
=
pMsg
->
pCont
;
if
(
pCmCfgDnode
->
ip
[
0
]
==
0
)
{
strcpy
(
pCmCfgDnode
->
ip
,
tsPrivateIp
);
}
else
{
strcpy
(
pCmCfgDnode
->
ip
,
pCmCfgDnode
->
ip
);
}
uint32_t
dnodeIp
=
inet_addr
(
pCmCfgDnode
->
ip
);
uint32_t
dnodeIp
=
inet_addr
(
pCmCfgDnode
->
ip
);
if
(
strcmp
(
pMsg
->
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
...
@@ -558,3 +566,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
...
@@ -558,3 +566,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
rpcSendResponse
(
&
rpcRsp
);
rpcSendResponse
(
&
rpcRsp
);
}
}
static
void
mgmtProcessCfgDnodeMsgRsp
(
SRpcMsg
*
rpcMsg
)
{
mTrace
(
"cfg vnode rsp is received"
);
}
\ No newline at end of file
src/util/src/tglobalcfg.c
浏览文件 @
2a3c43ab
...
@@ -135,7 +135,7 @@ int tsOfflineThreshold = 864000; // seconds 10days
...
@@ -135,7 +135,7 @@ int tsOfflineThreshold = 864000; // seconds 10days
int
tsMgmtEqualVnodeNum
=
4
;
int
tsMgmtEqualVnodeNum
=
4
;
int
tsEnableHttpModule
=
1
;
int
tsEnableHttpModule
=
1
;
int
tsEnableMonitorModule
=
1
;
int
tsEnableMonitorModule
=
0
;
int
tsRestRowLimit
=
10240
;
int
tsRestRowLimit
=
10240
;
int
tsMaxSQLStringLen
=
TSDB_MAX_SQL_LEN
;
int
tsMaxSQLStringLen
=
TSDB_MAX_SQL_LEN
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录