Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
59d23065
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
59d23065
编写于
1月 11, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix invalid write in mnode
上级
e3c85764
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
39 deletion
+33
-39
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+1
-1
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+8
-0
tests/script/sh/exec.sh
tests/script/sh/exec.sh
+2
-2
tests/script/sim/db/basic6.sim
tests/script/sim/db/basic6.sim
+21
-35
未找到文件。
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
59d23065
...
...
@@ -740,7 +740,7 @@ static int32_t mndBuildDropVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *
if
(
pReq
==
NULL
)
return
-
1
;
action
.
pCont
=
pReq
;
action
.
contLen
=
sizeof
(
S
Create
VnodeReq
);
action
.
contLen
=
sizeof
(
S
Drop
VnodeReq
);
action
.
msgType
=
TDMT_DND_DROP_VNODE
;
action
.
acceptableCode
=
TSDB_CODE_DND_VNODE_NOT_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
59d23065
...
...
@@ -235,7 +235,7 @@ int32_t mndGetDnodeSize(SMnode *pMnode) {
bool
mndIsDnodeOnline
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
int64_t
curMs
)
{
int64_t
interval
=
ABS
(
pDnode
->
lastAccessTime
-
curMs
);
if
(
interval
>
35
00
*
pMnode
->
cfg
.
statusInterval
)
{
if
(
interval
>
100
00
*
pMnode
->
cfg
.
statusInterval
)
{
if
(
pDnode
->
rebootTime
>
0
)
{
pDnode
->
offlineReason
=
DND_REASON_STATUS_MSG_TIMEOUT
;
}
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
59d23065
...
...
@@ -319,6 +319,14 @@ static int32_t mndGetAvailableDnode(SMnode *pMnode, SVgObj *pVgroup, SArray *pAr
taosArraySort
(
pArray
,
(
__compar_fn_t
)
mndCompareDnodeVnodes
);
int32_t
size
=
taosArrayGetSize
(
pArray
);
if
(
size
<
pVgroup
->
replica
)
{
mError
(
"db:%s, vgId:%d, no enough online dnodes:%d to alloc %d replica"
,
pVgroup
->
dbName
,
pVgroup
->
vgId
,
size
,
pVgroup
->
replica
);
terrno
=
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
return
-
1
;
}
for
(
int32_t
v
=
0
;
v
<
pVgroup
->
replica
;
++
v
)
{
SVnodeGid
*
pVgid
=
&
pVgroup
->
vnodeGid
[
v
];
SDnodeObj
*
pDnode
=
taosArrayGet
(
pArray
,
v
);
...
...
tests/script/sh/exec.sh
浏览文件 @
59d23065
...
...
@@ -30,7 +30,7 @@ do
CLEAR_OPTION
=
"clear"
;;
v
)
SHELL
_OPTION
=
"true"
VALGRIND
_OPTION
=
"true"
;;
u
)
USERS
=
$OPTARG
...
...
@@ -99,7 +99,7 @@ fi
if
[
"
$EXEC_OPTON
"
=
"start"
]
;
then
echo
"ExcuteCmd:"
$EXE_DIR
/taosd
-c
$CFG_DIR
if
[
"
$
SHELL
_OPTION
"
=
"true"
]
;
then
if
[
"
$
VALGRIND
_OPTION
"
=
"true"
]
;
then
TT
=
`
date
+%s
`
mkdir
${
LOG_DIR
}
/
${
TT
}
nohup
valgrind
--log-file
=
${
LOG_DIR
}
/
${
TT
}
/valgrind.log
--tool
=
memcheck
--leak-check
=
full
--show-reachable
=
no
--track-origins
=
yes
--show-leak-kinds
=
all
-v
--workaround-gcc296-bugs
=
yes
$EXE_DIR
/taosd
-c
$CFG_DIR
>
/dev/null 2>&1 &
...
...
tests/script/sim/db/basic6.sim
浏览文件 @
59d23065
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============================ dnode1 start
$i = 0
$dbPrefix =
ob_db_
db
$tbPrefix =
ob_db_
tb
$dbPrefix = db
$tbPrefix = tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db replica 1 days 20 keep 2000 cache 16
sql create database $db replica 1 days 20 keep 2000 cache 16
vgroups 4
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 !=
0
then
if $data02 !=
4
then
return -1
endi
if $data03 != 0 then
...
...
@@ -63,9 +58,6 @@ print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0 then
return -1
endi
...
...
@@ -77,30 +69,14 @@ if $data06 != 15 then
endi
print =============== step6
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = 1
while $i < 4
$i = $i + 1
while $i < 5
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = $i + 1
endw
sql show databases
if $rows != 4 then
return -1
endi
$i = 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
print =============== step7
$i = 0
while $i < 5
...
...
@@ -115,7 +91,8 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql create table st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql show tables
if $rows != 1 then
return -1
...
...
@@ -133,7 +110,8 @@ if $rows != 0 then
endi
print =============== step11
sql create table $tb (ts timestamp, speed int)
sql create table st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql show tables
if $rows != 1 then
return -1
...
...
@@ -149,16 +127,23 @@ sql show tables
if $rows != 0 then
return -1
endi
sql create table $tb (ts timestamp, speed int)
sql create table st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql show tables
if $rows != 1 then
return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
return
sql select * from $tb
if $rows != 5 then
return -1
...
...
@@ -176,7 +161,8 @@ if $rows != 0 then
endi
print =============== step16
sql create table $tb (ts timestamp, speed int)
sql create table st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql show tables
if $rows != 1 then
return -1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录