提交 fba78a9d 编写于 作者: S Shengliang Guan

TD-2513 let vnode keep work as master if onlineNum=0.5

上级 4f012910
...@@ -715,8 +715,12 @@ static SSyncPeer *syncCheckMaster(SSyncNode *pNode) { ...@@ -715,8 +715,12 @@ static SSyncPeer *syncCheckMaster(SSyncNode *pNode) {
if (onlineNum <= replica * 0.5) { if (onlineNum <= replica * 0.5) {
if (nodeRole != TAOS_SYNC_ROLE_UNSYNCED) { if (nodeRole != TAOS_SYNC_ROLE_UNSYNCED) {
nodeRole = TAOS_SYNC_ROLE_UNSYNCED; if (nodeRole == TAOS_SYNC_ROLE_MASTER && onlineNum == replica * 0.5) {
sInfo("vgId:%d, self change to unsynced state, online:%d replica:%d", pNode->vgId, onlineNum, replica); sInfo("vgId:%d, self keep work as master, online:%d replica:%d", pNode->vgId, onlineNum, replica);
} else {
nodeRole = TAOS_SYNC_ROLE_UNSYNCED;
sInfo("vgId:%d, self change to unsynced state, online:%d replica:%d", pNode->vgId, onlineNum, replica);
}
(*pNode->notifyRole)(pNode->vgId, nodeRole); (*pNode->notifyRole)(pNode->vgId, nodeRole);
} }
} else { } else {
......
...@@ -84,15 +84,15 @@ step2: ...@@ -84,15 +84,15 @@ step2:
return -1 return -1
endi endi
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show dnodes sql show dnodes
print dnode1 $data4_1 print dnode1 $data4_1
print dnode2 $data4_2 print dnode2 $data4_2
print dnode3 $data4_3 print dnode3 $data4_3
print dnode4 $data4_4 print dnode4 $data4_4
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data4_1 != ready then if $data4_1 != ready then
goto step2 goto step2
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册