Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b0f048a3
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b0f048a3
编写于
6月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: redistribute vgroup
上级
19439c8b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
13 deletion
+39
-13
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+15
-4
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+13
-1
tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
...t/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
+11
-8
未找到文件。
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
b0f048a3
...
...
@@ -1078,6 +1078,8 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
if
(
numOfActions
==
0
)
return
code
;
if
(
pTrans
->
redoActionPos
>=
numOfActions
)
return
code
;
int32_t
retryTimes
=
0
;
for
(
int32_t
action
=
pTrans
->
redoActionPos
;
action
<
numOfActions
;
++
action
)
{
STransAction
*
pAction
=
taosArrayGet
(
pTrans
->
redoActions
,
pTrans
->
redoActionPos
);
...
...
@@ -1126,17 +1128,26 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
pTrans
->
code
=
terrno
;
mError
(
"trans:%d, %s:%d is executed and failed to sync to other mnodes since %s"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
());
break
;
if
(
retryTimes
>=
3
)
break
;
else
continue
;
}
retryTimes
=
0
;
}
else
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mDebug
(
"trans:%d, %s:%d is in progress and wait it finish"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
);
break
;
}
else
{
terrno
=
code
;
pTrans
->
code
=
code
;
mError
(
"trans:%d, %s:%d failed to execute since %s"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
());
break
;
pAction
->
epSet
.
inUse
++
;
if
(
pAction
->
epSet
.
inUse
>=
pAction
->
epSet
.
numOfEps
)
pAction
->
epSet
.
inUse
=
0
;
mError
(
"trans:%d, %s:%d failed to execute since %s, inUse set to %d"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
(),
pAction
->
epSet
.
inUse
);
if
(
retryTimes
>=
3
)
break
;
else
continue
;
}
}
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
b0f048a3
...
...
@@ -72,7 +72,19 @@ static int32_t vnodeProcessAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) {
return
-
1
;
}
return
syncPropose
(
pVnode
->
sync
,
&
rpcMsg
,
false
);
int32_t
code
=
syncPropose
(
pVnode
->
sync
,
&
rpcMsg
,
false
);
if
(
code
!=
0
)
{
vDebug
(
"vgId:%d, failed to propose reconfig msg since %s"
,
TD_VID
(
pVnode
),
terrstr
());
if
(
syncLeaderTransfer
(
pVnode
->
sync
)
!=
0
)
{
vError
(
"vgId:%d, failed to transfer leader since %s"
,
TD_VID
(
pVnode
),
terrstr
());
}
else
{
vDebug
(
"vgId:%d, transfer leader success, propose reconfig config again"
,
TD_VID
(
pVnode
));
taosMsleep
(
10
);
code
=
syncPropose
(
pVnode
->
sync
,
&
rpcMsg
,
false
);
}
}
return
code
;
}
void
vnodeProposeMsg
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
...
...
tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
浏览文件 @
b0f048a3
...
...
@@ -4,6 +4,11 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode1 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode2 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode3 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode4 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode5 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
...
...
@@ -128,9 +133,9 @@ if $rows != 1 then
endi
if $data(2)[4] == leader then
$leaderExist = 1
$leaderVnode =
4
$follower1 =
2
$follower2 =
3
$leaderVnode =
2
$follower1 =
3
$follower2 =
4
endi
if $data(2)[6] == leader then
$leaderExist = 1
...
...
@@ -140,9 +145,9 @@ if $data(2)[6] == leader then
endi
if $data(2)[8] == leader then
$leaderExist = 1
$leaderVnode =
2
$follower1 =
3
$follower2 =
4
$leaderVnode =
4
$follower1 =
2
$follower2 =
3
endi
if $leaderExist != 1 then
goto step3
...
...
@@ -171,8 +176,6 @@ if $rows != 1 then
return -1
endi
return
print =============== step33: move follower1
print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5
sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录