Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8ad688d3
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看板
未验证
提交
8ad688d3
编写于
6月 16, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
6月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13874 from taosdata/fix/dnode
feat: redistribute vgroup
上级
a729c159
4a9738ef
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
13 deletion
+24
-13
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+2
-4
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+11
-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
浏览文件 @
8ad688d3
...
@@ -873,7 +873,8 @@ static void mndTransResetActions(SMnode *pMnode, STrans *pTrans, SArray *pArray)
...
@@ -873,7 +873,8 @@ static void mndTransResetActions(SMnode *pMnode, STrans *pTrans, SArray *pArray)
pAction
->
rawWritten
=
0
;
pAction
->
rawWritten
=
0
;
pAction
->
msgSent
=
0
;
pAction
->
msgSent
=
0
;
pAction
->
msgReceived
=
0
;
pAction
->
msgReceived
=
0
;
if
(
pAction
->
errCode
==
TSDB_CODE_RPC_REDIRECT
)
{
if
(
pAction
->
errCode
==
TSDB_CODE_RPC_REDIRECT
||
pAction
->
errCode
==
TSDB_CODE_SYN_NOT_IN_NEW_CONFIG
||
pAction
->
errCode
==
TSDB_CODE_SYN_INTERNAL_ERROR
||
pAction
->
errCode
==
TSDB_CODE_SYN_NOT_LEADER
)
{
pAction
->
epSet
.
inUse
=
(
pAction
->
epSet
.
inUse
+
1
)
%
pAction
->
epSet
.
numOfEps
;
pAction
->
epSet
.
inUse
=
(
pAction
->
epSet
.
inUse
+
1
)
%
pAction
->
epSet
.
numOfEps
;
mDebug
(
"trans:%d, %s:%d execute status is reset and set epset inuse:%d"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
mDebug
(
"trans:%d, %s:%d execute status is reset and set epset inuse:%d"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
action
,
pAction
->
epSet
.
inUse
);
action
,
pAction
->
epSet
.
inUse
);
...
@@ -1126,7 +1127,6 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
...
@@ -1126,7 +1127,6 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
pTrans
->
code
=
terrno
;
pTrans
->
code
=
terrno
;
mError
(
"trans:%d, %s:%d is executed and failed to sync to other mnodes since %s"
,
pTrans
->
id
,
mError
(
"trans:%d, %s:%d is executed and failed to sync to other mnodes since %s"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
());
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
());
break
;
}
}
}
else
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
}
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
);
mDebug
(
"trans:%d, %s:%d is in progress and wait it finish"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
);
...
@@ -1134,8 +1134,6 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
...
@@ -1134,8 +1134,6 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans)
}
else
{
}
else
{
terrno
=
code
;
terrno
=
code
;
pTrans
->
code
=
code
;
pTrans
->
code
=
code
;
mError
(
"trans:%d, %s:%d failed to execute since %s"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
pAction
->
id
,
terrstr
());
break
;
break
;
}
}
}
}
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
8ad688d3
...
@@ -72,7 +72,17 @@ static int32_t vnodeProcessAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) {
...
@@ -72,7 +72,17 @@ static int32_t vnodeProcessAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) {
return
-
1
;
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
));
}
}
return
code
;
}
}
void
vnodeProposeMsg
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
void
vnodeProposeMsg
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
...
...
tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
浏览文件 @
8ad688d3
...
@@ -4,6 +4,11 @@ system sh/deploy.sh -n dnode2 -i 2
...
@@ -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 dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
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/cfg.sh -n dnode1 -c supportVnodes -v 0
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
...
@@ -128,9 +133,9 @@ if $rows != 1 then
...
@@ -128,9 +133,9 @@ if $rows != 1 then
endi
endi
if $data(2)[4] == leader then
if $data(2)[4] == leader then
$leaderExist = 1
$leaderExist = 1
$leaderVnode =
4
$leaderVnode =
2
$follower1 =
2
$follower1 =
3
$follower2 =
3
$follower2 =
4
endi
endi
if $data(2)[6] == leader then
if $data(2)[6] == leader then
$leaderExist = 1
$leaderExist = 1
...
@@ -140,9 +145,9 @@ if $data(2)[6] == leader then
...
@@ -140,9 +145,9 @@ if $data(2)[6] == leader then
endi
endi
if $data(2)[8] == leader then
if $data(2)[8] == leader then
$leaderExist = 1
$leaderExist = 1
$leaderVnode =
2
$leaderVnode =
4
$follower1 =
3
$follower1 =
2
$follower2 =
4
$follower2 =
3
endi
endi
if $leaderExist != 1 then
if $leaderExist != 1 then
goto step3
goto step3
...
@@ -171,8 +176,6 @@ if $rows != 1 then
...
@@ -171,8 +176,6 @@ if $rows != 1 then
return -1
return -1
endi
endi
return
print =============== step33: move follower1
print =============== step33: move follower1
print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5
print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5
sql 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录