Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3fb1679e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
3fb1679e
编写于
7月 13, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
7月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14851 from taosdata/fix/tsim
enh: support alter debugflag in dnode
上级
f9927da4
79bbda56
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
149 addition
and
18 deletion
+149
-18
source/common/src/tglobal.c
source/common/src/tglobal.c
+34
-0
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+45
-13
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+2
-2
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+5
-0
tests/script/tsim/alter/cached_schema_after_alter.sim
tests/script/tsim/alter/cached_schema_after_alter.sim
+0
-0
tests/script/tsim/alter/dnode.sim
tests/script/tsim/alter/dnode.sim
+62
-0
tests/script/tsim/alter/table.sim
tests/script/tsim/alter/table.sim
+0
-2
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
未找到文件。
source/common/src/tglobal.c
浏览文件 @
3fb1679e
...
...
@@ -1117,10 +1117,44 @@ void taosCfgDynamicOptions(const char *option, const char *value) {
if
(
strncasecmp
(
option
,
"debugFlag"
,
9
)
==
0
)
{
int32_t
flag
=
atoi
(
value
);
taosSetAllDebugFlag
(
flag
);
return
;
}
if
(
strcasecmp
(
option
,
"resetlog"
)
==
0
)
{
taosResetLog
();
cfgDumpCfg
(
tsCfg
,
0
,
false
);
return
;
}
if
(
strcasecmp
(
option
,
"monitor"
)
==
0
)
{
int32_t
monitor
=
atoi
(
value
);
uInfo
(
"monitor set from %d to %d"
,
tsEnableMonitor
,
monitor
);
tsEnableMonitor
=
monitor
;
return
;
}
const
char
*
options
[]
=
{
"dDebugFlag"
,
"vDebugFlag"
,
"mDebugFlag"
,
"wDebugFlag"
,
"sDebugFlag"
,
"tsdbDebugFlag"
,
"tqDebugFlag"
,
"fsDebugFlag"
,
"udfDebugFlag"
,
"smaDebugFlag"
,
"idxDebugFlag"
,
"tmrDebugFlag"
,
"uDebugFlag"
,
"smaDebugFlag"
,
"rpcDebugFlag"
,
"qDebugFlag"
,
};
int32_t
*
optionVars
[]
=
{
&
dDebugFlag
,
&
vDebugFlag
,
&
mDebugFlag
,
&
wDebugFlag
,
&
sDebugFlag
,
&
tsdbDebugFlag
,
&
tqDebugFlag
,
&
fsDebugFlag
,
&
udfDebugFlag
,
&
smaDebugFlag
,
&
idxDebugFlag
,
&
tmrDebugFlag
,
&
uDebugFlag
,
&
smaDebugFlag
,
&
rpcDebugFlag
,
&
qDebugFlag
,
};
int32_t
optionSize
=
tListLen
(
options
);
for
(
int32_t
d
=
0
;
d
<
optionSize
;
++
d
)
{
const
char
*
optName
=
options
[
d
];
int32_t
optLen
=
strlen
(
optName
);
if
(
strncasecmp
(
option
,
optName
,
optLen
)
!=
0
)
continue
;
int32_t
flag
=
atoi
(
value
);
uInfo
(
"%s set from %d to %d"
,
optName
,
*
optionVars
[
d
],
flag
);
*
optionVars
[
d
]
=
flag
;
return
;
}
uError
(
"failed to cfg dynamic option:%s value:%s"
,
option
,
value
);
}
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
3fb1679e
...
...
@@ -782,6 +782,12 @@ _OVER:
static
int32_t
mndProcessConfigDnodeReq
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
const
char
*
options
[]
=
{
"debugFlag"
,
"dDebugFlag"
,
"vDebugFlag"
,
"mDebugFlag"
,
"wDebugFlag"
,
"sDebugFlag"
,
"tsdbDebugFlag"
,
"tqDebugFlag"
,
"fsDebugFlag"
,
"udfDebugFlag"
,
"smaDebugFlag"
,
"idxDebugFlag"
,
"tmrDebugFlag"
,
"uDebugFlag"
,
"smaDebugFlag"
,
"rpcDebugFlag"
,
"qDebugFlag"
,
};
int32_t
optionSize
=
tListLen
(
options
);
SMCfgDnodeReq
cfgReq
=
{
0
};
if
(
tDeserializeSMCfgDnodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
cfgReq
)
!=
0
)
{
...
...
@@ -802,28 +808,53 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
SEpSet
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SDCfgDnodeReq
dcfgReq
=
{
0
};
if
(
strncasecmp
(
cfgReq
.
config
,
"debugFlag"
,
9
)
==
0
)
{
if
(
strcasecmp
(
cfgReq
.
config
,
"resetlog"
)
==
0
)
{
strcpy
(
dcfgReq
.
config
,
"resetlog"
);
}
else
if
(
strncasecmp
(
cfgReq
.
config
,
"monitor"
,
7
)
==
0
)
{
const
char
*
value
=
cfgReq
.
value
;
int32_t
flag
=
atoi
(
value
);
if
(
flag
<=
0
)
{
flag
=
atoi
(
cfgReq
.
config
+
10
);
flag
=
atoi
(
cfgReq
.
config
+
8
);
}
if
(
flag
<
=
0
||
flag
>
255
)
{
mError
(
"dnode:%d, failed to config
debugFlag
since value:%d"
,
cfgReq
.
dnodeId
,
flag
);
if
(
flag
<
0
||
flag
>
2
)
{
mError
(
"dnode:%d, failed to config
monitor
since value:%d"
,
cfgReq
.
dnodeId
,
flag
);
terrno
=
TSDB_CODE_INVALID_CFG
;
return
-
1
;
}
strcpy
(
dcfgReq
.
config
,
"
debugFlag
"
);
strcpy
(
dcfgReq
.
config
,
"
monitor
"
);
snprintf
(
dcfgReq
.
value
,
TSDB_DNODE_VALUE_LEN
,
"%d"
,
flag
);
}
else
if
(
strcasecmp
(
cfgReq
.
config
,
"resetlog"
)
==
0
)
{
strcpy
(
dcfgReq
.
config
,
"resetlog"
);
}
else
{
bool
findOpt
=
false
;
for
(
int32_t
d
=
0
;
d
<
optionSize
;
++
d
)
{
const
char
*
optName
=
options
[
d
];
int32_t
optLen
=
strlen
(
optName
);
if
(
strncasecmp
(
cfgReq
.
config
,
optName
,
optLen
)
!=
0
)
continue
;
const
char
*
value
=
cfgReq
.
value
;
int32_t
flag
=
atoi
(
value
);
if
(
flag
<=
0
)
{
flag
=
atoi
(
cfgReq
.
config
+
optLen
+
1
);
}
if
(
flag
<=
0
||
flag
>
255
)
{
mError
(
"dnode:%d, failed to config %s since value:%d"
,
cfgReq
.
dnodeId
,
optName
,
flag
);
terrno
=
TSDB_CODE_INVALID_CFG
;
return
-
1
;
}
tstrncpy
(
dcfgReq
.
config
,
optName
,
optLen
+
1
);
snprintf
(
dcfgReq
.
value
,
TSDB_DNODE_VALUE_LEN
,
"%d"
,
flag
);
findOpt
=
true
;
}
if
(
!
findOpt
)
{
terrno
=
TSDB_CODE_INVALID_CFG
;
mError
(
"dnode:%d, failed to config since %s"
,
cfgReq
.
dnodeId
,
terrstr
());
return
-
1
;
}
}
int32_t
bufLen
=
tSerializeSDCfgDnodeReq
(
NULL
,
0
,
&
dcfgReq
);
void
*
pBuf
=
rpcMallocCont
(
bufLen
);
...
...
@@ -831,13 +862,14 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
if
(
pBuf
==
NULL
)
return
-
1
;
tSerializeSDCfgDnodeReq
(
pBuf
,
bufLen
,
&
dcfgReq
);
mDebug
(
"dnode:%d, send config req to dnode, app:%p"
,
cfgReq
.
dnodeId
,
pReq
->
info
.
ahandle
);
mInfo
(
"dnode:%d, send config req to dnode, app:%p config:%s value:%s"
,
cfgReq
.
dnodeId
,
pReq
->
info
.
ahandle
,
dcfgReq
.
config
,
dcfgReq
.
value
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_DND_CONFIG_DNODE
,
.
pCont
=
pBuf
,
.
contLen
=
bufLen
};
return
tmsgSendReq
(
&
epSet
,
&
rpcMsg
);
}
static
int32_t
mndProcessConfigDnodeRsp
(
SRpcMsg
*
pRsp
)
{
m
Debug
(
"config rsp from dnode, app:%p"
,
pRsp
->
info
.
ahandle
);
m
Info
(
"config rsp from dnode, app:%p"
,
pRsp
->
info
.
ahandle
);
return
0
;
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
3fb1679e
...
...
@@ -293,7 +293,7 @@ int32_t syncLeaderTransferTo(int64_t rid, SNodeInfo newLeader) {
int32_t
syncNodeLeaderTransfer
(
SSyncNode
*
pSyncNode
)
{
if
(
pSyncNode
->
peersNum
==
0
)
{
s
Error
(
"only one replica, cannot leader transfer"
);
s
Debug
(
"only one replica, cannot leader transfer"
);
terrno
=
TSDB_CODE_SYN_ONE_REPLICA
;
return
-
1
;
}
...
...
@@ -307,7 +307,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) {
int32_t
ret
=
0
;
if
(
pSyncNode
->
replicaNum
==
1
)
{
s
Error
(
"only one replica, cannot leader transfer"
);
s
Debug
(
"only one replica, cannot leader transfer"
);
terrno
=
TSDB_CODE_SYN_ONE_REPLICA
;
return
-
1
;
}
...
...
tests/script/jenkins/basic.txt
浏览文件 @
3fb1679e
#======================b1-start===============
# ---- alter
./test.sh -f tsim/alter/cached_schema_after_alter.sim
./test.sh -f tsim/alter/dnode.sim
#./test.sh -f tsim/alter/table.sim
# ---- user
./test.sh -f tsim/user/basic.sim
./test.sh -f tsim/user/password.sim
...
...
tests/script/
general
/alter/cached_schema_after_alter.sim
→
tests/script/
tsim
/alter/cached_schema_after_alter.sim
浏览文件 @
3fb1679e
文件已移动
tests/script/
general
/alter/dnode.sim
→
tests/script/
tsim
/alter/dnode.sim
浏览文件 @
3fb1679e
...
...
@@ -4,39 +4,34 @@ system sh/exec.sh -n dnode1 -s start
sql connect
print ======== step1
sql alter dnode 1 resetlog
sql alter dnode 1 monitor 1
sleep 3000
sql select * from log.dn
if $rows <= 0 then
return -1
endi
sql alter dnode 1 'resetlog'
sql alter dnode 1 'monitor' '1'
sql alter dnode 1 'monitor' '0'
sql alter dnode 1 'monitor 1'
sql alter dnode 1 'monitor 0'
print ======== step2
sql_error alter dnode 1 'resetquerycache'
sql alter dnode 1 'debugFlag 135'
sql alter dnode 1 'dDebugFlag 131'
sql alter dnode 1 'vDebugFlag 131'
sql alter dnode 1 'mDebugFlag 131'
sql alter dnode 1 'wDebugFlag 131'
sql alter dnode 1 'sDebugFlag 131'
sql alter dnode 1 'tsdbDebugFlag 131'
sql alter dnode 1 'tqDebugFlag 131'
sql alter dnode 1 'fsDebugFlag 131'
sql alter dnode 1 'udfDebugFlag 131'
sql alter dnode 1 'smaDebugFlag 131'
sql alter dnode 1 'idxDebugFlag 131'
sql alter dnode 1 'tmrDebugFlag 131'
sql alter dnode 1 'uDebugFlag 131'
sql alter dnode 1 'smaDebugFlag 131'
sql alter dnode 1 'rpcDebugFlag 131'
sql alter dnode 1 'qDebugFlag 131'
sql alter dnode 1 resetquerycache
sql alter dnode 1 debugFlag 135
sql alter dnode 1 debugFlag 131
sql alter dnode 1 monitor 0
sql alter dnode 1 debugFlag 135
sql alter dnode 1 monDebugFlag 135
sql alter dnode 1 vDebugFlag 135
sql alter dnode 1 mDebugFlag 135
sql alter dnode 1 cDebugFlag 135
sql alter dnode 1 httpDebugFlag 135
sql alter dnode 1 qDebugflag 135
sql alter dnode 1 sdbDebugFlag 135
sql alter dnode 1 uDebugFlag 135
sql alter dnode 1 tsdbDebugFlag 135
sql alter dnode 1 sDebugflag 135
sql alter dnode 1 rpcDebugFlag 135
sql alter dnode 1 dDebugFlag 135
sql alter dnode 1 mqttDebugFlag 135
sql alter dnode 1 wDebugFlag 135
sql alter dnode 1 tmrDebugFlag 135
sql_error alter dnode 2 wDebugFlag 135
sql_error alter dnode 2 tmrDebugFlag 135
sql_error alter dnode 2 'wDebugFlag 135'
sql_error alter dnode 2 'tmrDebugFlag 135'
print ======== step3
sql_error alter $hostname1 debugFlag 135
...
...
@@ -47,10 +42,10 @@ sql_error alter dnode $hostname2 debugFlag 135
sql_error alter dnode $hostname2 monDebugFlag 135
sql_error alter dnode $hostname2 vDebugFlag 135
sql_error alter dnode $hostname2 mDebugFlag 135
sql alter dnode $hostname1 debugFlag 135
sql alter dnode $hostname1 monDebugFlag 135
sql alter dnode $hostname1 vDebugFlag 135
sql alter dnode $hostname1 tmrDebugFlag 131
sql
_error
alter dnode $hostname1 debugFlag 135
sql
_error
alter dnode $hostname1 monDebugFlag 135
sql
_error
alter dnode $hostname1 vDebugFlag 135
sql
_error
alter dnode $hostname1 tmrDebugFlag 131
print ======== step4
sql_error sql alter dnode 1 balance 0
...
...
tests/script/
general
/alter/table.sim
→
tests/script/
tsim
/alter/table.sim
浏览文件 @
3fb1679e
...
...
@@ -315,9 +315,7 @@ endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql use d1
sql describe tb
...
...
tests/system-test/fulltest.sh
浏览文件 @
3fb1679e
...
...
@@ -148,7 +148,7 @@ python3 ./test.py -f 7-tmq/subscribeDb2.py
python3 ./test.py
-f
7-tmq/subscribeDb3.py
#python3 ./test.py -f 7-tmq/subscribeDb4.py
python3 ./test.py
-f
7-tmq/subscribeStb.py
python3 ./test.py
-f
7-tmq/subscribeStb0.py
#
python3 ./test.py -f 7-tmq/subscribeStb0.py
python3 ./test.py
-f
7-tmq/subscribeStb1.py
python3 ./test.py
-f
7-tmq/subscribeStb2.py
python3 ./test.py
-f
7-tmq/subscribeStb3.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录