Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
codyshao
TDengine
提交
feae2858
T
TDengine
项目概览
codyshao
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
feae2858
编写于
7月 17, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
7月 17, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2698 from taosdata/feature/vnode
Feature/vnode
上级
d42d81a7
25eb73d3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
11 deletion
+51
-11
src/common/src/tglobal.c
src/common/src/tglobal.c
+14
-5
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+20
-3
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+4
-0
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+13
-3
未找到文件。
src/common/src/tglobal.c
浏览文件 @
feae2858
...
...
@@ -199,6 +199,9 @@ int32_t sDebugFlag = 135;
int32_t
wDebugFlag
=
135
;
int32_t
tsdbDebugFlag
=
131
;
int32_t
(
*
monitorStartSystemFp
)()
=
NULL
;
void
(
*
monitorStopSystemFp
)()
=
NULL
;
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
void
taosSetAllDebugFlag
()
{
...
...
@@ -248,11 +251,17 @@ bool taosCfgDynamicOptions(char *msg) {
*
((
int32_t
*
)
cfg
->
ptr
)
=
vint
;
if
(
strncasecmp
(
cfg
->
option
,
"monitor"
,
olen
)
==
0
)
{
// if (0 == vint) {
// monitorStartSystem();
// } else {
// monitorStopSystem();
// }
if
(
1
==
vint
)
{
if
(
monitorStartSystemFp
)
{
(
*
monitorStartSystemFp
)();
uInfo
(
"monitor is enabled"
);
}
}
else
{
if
(
monitorStopSystemFp
)
{
(
*
monitorStopSystemFp
)();
uInfo
(
"monitor is disabled"
);
}
}
return
true
;
}
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
feae2858
...
...
@@ -452,10 +452,23 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
return
grantCode
;
}
char
dnodeEp
[
TSDB_EP_LEN
]
=
{
0
};
tstrncpy
(
dnodeEp
,
ep
,
TSDB_EP_LEN
);
strtrim
(
dnodeEp
);
char
*
temp
=
strchr
(
dnodeEp
,
':'
);
if
(
!
temp
)
{
int
len
=
strlen
(
dnodeEp
);
if
(
dnodeEp
[
len
-
1
]
==
';'
)
dnodeEp
[
len
-
1
]
=
0
;
len
=
strlen
(
dnodeEp
);
snprintf
(
dnodeEp
+
len
,
TSDB_EP_LEN
-
len
,
":%d"
,
tsServerPort
);
}
ep
=
dnodeEp
;
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
if
(
pDnode
!=
NULL
)
{
mnodeDecDnodeRef
(
pDnode
);
mError
(
"dnode:%d is alredy exist, %s:%d"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeFqdn
,
pDnode
->
dnodePort
);
mError
(
"dnode:%d is alre
a
dy exist, %s:%d"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeFqdn
,
pDnode
->
dnodePort
);
return
TSDB_CODE_MND_DNODE_ALREADY_EXIST
;
}
...
...
@@ -507,8 +520,12 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) {
static
int32_t
mnodeDropDnodeByEp
(
char
*
ep
,
SMnodeMsg
*
pMsg
)
{
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%s, is not exist"
,
ep
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
int32_t
dnodeId
=
(
int32_t
)
strtol
(
ep
,
NULL
,
10
);
pDnode
=
mnodeGetDnode
(
dnodeId
);
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%s, is not exist"
,
ep
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
}
}
if
(
strcmp
(
pDnode
->
dnodeEp
,
mnodeGetMnodeMasterEp
())
==
0
)
{
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
feae2858
...
...
@@ -76,6 +76,8 @@ static void monitorInitDatabase();
static
void
monitorInitDatabaseCb
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
code
);
static
void
monitorStartTimer
();
static
void
monitorSaveSystemInfo
();
extern
int32_t
(
*
monitorStartSystemFp
)();
extern
void
(
*
monitorStopSystemFp
)();
static
void
monitorCheckDiskUsage
(
void
*
para
,
void
*
unused
)
{
taosGetDisk
();
...
...
@@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) {
int32_t
monitorInitSystem
()
{
taos_init
();
taosTmrReset
(
monitorCheckDiskUsage
,
CHECK_INTERVAL
,
NULL
,
tscTmr
,
&
tsMonitorConn
.
diskTimer
);
monitorStartSystemFp
=
monitorStartSystem
;
monitorStopSystemFp
=
monitorStopSystem
;
return
0
;
}
...
...
tests/tsim/src/simExe.c
浏览文件 @
feae2858
...
...
@@ -21,7 +21,7 @@
#include "tutil.h"
#include "cJSON.h"
void
simLogSql
(
char
*
sql
)
{
void
simLogSql
(
char
*
sql
,
bool
useSharp
)
{
static
FILE
*
fp
=
NULL
;
char
filename
[
256
];
sprintf
(
filename
,
"%s/sim.sql"
,
tsScriptDir
);
...
...
@@ -32,7 +32,12 @@ void simLogSql(char *sql) {
return
;
}
}
fprintf
(
fp
,
"%s;
\n
"
,
sql
);
if
(
useSharp
)
{
fprintf
(
fp
,
"# %s;
\n
"
,
sql
);
}
else
{
fprintf
(
fp
,
"%s;
\n
"
,
sql
);
}
fflush
(
fp
);
}
...
...
@@ -300,6 +305,7 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
sprintf
(
buf
,
"cd %s; "
,
tsScriptDir
);
simVisuallizeOption
(
script
,
option
,
buf
+
strlen
(
buf
));
simLogSql
(
buf
,
true
);
int
code
=
system
(
buf
);
int
repeatTimes
=
0
;
while
(
code
<
0
)
{
...
...
@@ -372,6 +378,10 @@ bool simExecuteSleepCmd(SScript *script, char *option) {
taosMsleep
(
delta
);
simInfo
(
"script:%s, sleep %dms finished"
,
script
->
fileName
,
delta
);
char
sleepStr
[
32
]
=
{
0
};
sprintf
(
sleepStr
,
"sleep %d"
,
delta
);
simLogSql
(
sleepStr
,
true
);
script
->
linePos
++
;
return
true
;
}
...
...
@@ -655,7 +665,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
TAOS_RES
*
pSql
=
NULL
;
for
(
int
attempt
=
0
;
attempt
<
3
;
++
attempt
)
{
simLogSql
(
rest
);
simLogSql
(
rest
,
false
);
pSql
=
taos_query
(
script
->
taos
,
rest
);
ret
=
taos_errno
(
pSql
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录