Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0bb3794b
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0bb3794b
编写于
10月 16, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1725
上级
b1cc403d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
28 deletion
+34
-28
src/balance/src/balance.c
src/balance/src/balance.c
+3
-2
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+2
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+7
-5
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+22
-20
未找到文件。
src/balance/src/balance.c
浏览文件 @
0bb3794b
...
...
@@ -126,7 +126,7 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
balanceAccquireDnodeList
();
mDebug
(
"db:%s, alloc %d vnodes to vgroup, dnodes total:%d, avail:%d"
,
pVgroup
->
dbName
,
pVgroup
->
numOfVnodes
,
mDebug
(
"db:%s,
try
alloc %d vnodes to vgroup, dnodes total:%d, avail:%d"
,
pVgroup
->
dbName
,
pVgroup
->
numOfVnodes
,
mnodeGetDnodesNum
(),
tsBalanceDnodeListSize
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(;
dnode
<
tsBalanceDnodeListSize
;
++
dnode
)
{
...
...
@@ -571,7 +571,8 @@ static void balanceCheckDnodeAccess() {
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
&&
pDnode
->
status
!=
TAOS_DN_STATUS_OFFLINE
)
{
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
offlineReason
=
TAOS_DN_OFF_STATUS_MSG_TIMEOUT
;
mInfo
(
"dnode:%d, set to offline state"
,
pDnode
->
dnodeId
);
mInfo
(
"dnode:%d, set to offline state, access seq:%d, last seq:%d"
,
pDnode
->
dnodeId
,
tsAccessSquence
,
pDnode
->
lastAccess
);
balanceSetVgroupOffline
(
pDnode
);
}
}
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
0bb3794b
...
...
@@ -471,7 +471,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
mnodeGetClusterId
());
return
TSDB_CODE_MND_INVALID_CLUSTER_ID
;
}
else
{
mTrace
(
"dnode:%d, status received, access times %d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
);
mTrace
(
"dnode:%d, status received, access times %d openVnodes:%d:%d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
,
htons
(
pStatus
->
openVnodes
),
pDnode
->
openVnodes
);
}
}
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
0bb3794b
...
...
@@ -2409,14 +2409,16 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
}
}
else
{
if
(
mnodeMsg
->
retry
++
<
10
)
{
mDebug
(
"app:%p:%p, table:%s, create table rsp received, need retry, times:%d result:%s thandle:%p"
,
mnodeMsg
->
rpcMsg
.
ahandle
,
mnodeMsg
,
pTable
->
info
.
tableId
,
mnodeMsg
->
retry
,
tstrerror
(
rpcMsg
->
code
),
mnodeMsg
->
rpcMsg
.
handle
);
mDebug
(
"app:%p:%p, table:%s, create table rsp received, need retry, times:%d vgId:%d sid:%d uid:%"
PRIu64
" result:%s thandle:%p"
,
mnodeMsg
->
rpcMsg
.
ahandle
,
mnodeMsg
,
pTable
->
info
.
tableId
,
mnodeMsg
->
retry
,
pTable
->
vgId
,
pTable
->
sid
,
pTable
->
uid
,
tstrerror
(
rpcMsg
->
code
),
mnodeMsg
->
rpcMsg
.
handle
);
dnodeDelayReprocessMnodeWriteMsg
(
mnodeMsg
);
}
else
{
mError
(
"app:%p:%p, table:%s, failed to create in dnode, result:%s thandle:%p"
,
mnodeMsg
->
rpcMsg
.
ahandle
,
mnodeMsg
,
pTable
->
info
.
tableId
,
tstrerror
(
rpcMsg
->
code
),
mnodeMsg
->
rpcMsg
.
handle
);
mError
(
"app:%p:%p, table:%s, failed to create in dnode, vgId:%d sid:%d uid:%"
PRIu64
", result:%s thandle:%p"
,
mnodeMsg
->
rpcMsg
.
ahandle
,
mnodeMsg
,
pTable
->
info
.
tableId
,
pTable
->
vgId
,
pTable
->
sid
,
pTable
->
uid
,
tstrerror
(
rpcMsg
->
code
),
mnodeMsg
->
rpcMsg
.
handle
);
SSdbOper
oper
=
{.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
};
sdbDeleteRow
(
&
oper
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
0bb3794b
...
...
@@ -270,31 +270,34 @@ void mnodeUpdateVgroup(SVgObj *pVgroup) {
Traverse all vgroups on mnode, if there no such vgId on a dnode, so send msg to this dnode for re-creating this vgId/vnode
*/
void
mnodeCheckUnCreatedVgroup
(
SDnodeObj
*
pDnode
,
SVnodeLoad
*
pVloads
,
int32_t
openVnodes
)
{
SVnodeLoad
*
pNextV
=
NULL
;
void
*
pIter
=
NULL
;
while
(
1
)
{
SVgObj
*
pVgroup
;
pIter
=
mnodeGetNextVgroup
(
pIter
,
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
pNextV
=
pVloads
;
int32_t
i
;
for
(
i
=
0
;
i
<
openVnodes
;
++
i
)
{
if
((
pVgroup
->
vnodeGid
[
i
].
pDnode
==
pDnode
)
&&
(
pVgroup
->
vgId
==
pNextV
->
vgId
))
{
break
;
}
pNextV
++
;
}
if
(
i
==
openVnodes
)
{
if
(
pVgroup
->
status
==
TAOS_VG_STATUS_CREATING
||
pVgroup
->
status
==
TAOS_VG_STATUS_DROPPING
)
{
mDebug
(
"vgId:%d, not exist in dnode:%d and status is %s, do nothing"
,
pVgroup
->
vgId
,
pDnode
->
dnodeId
,
vgroupStatus
[
pVgroup
->
status
]);
}
else
{
mDebug
(
"vgId:%d, not exist in dnode:%d and status is %s, send create msg"
,
pVgroup
->
vgId
,
pDnode
->
dnodeId
,
vgroupStatus
[
pVgroup
->
status
]);
mnodeSendCreateVgroupMsg
(
pVgroup
,
NULL
);
for
(
int
v
=
0
;
v
<
pVgroup
->
numOfVnodes
;
++
v
)
{
if
(
pVgroup
->
vnodeGid
[
v
].
dnodeId
==
pDnode
->
dnodeId
)
{
// vgroup should have a vnode on this dnode
bool
have
=
false
;
for
(
int32_t
i
=
0
;
i
<
openVnodes
;
++
i
)
{
SVnodeLoad
*
pVload
=
pVloads
+
i
;
if
(
pVgroup
->
vgId
==
pVload
->
vgId
)
{
have
=
true
;
break
;
}
}
if
(
have
)
continue
;
if
(
pVgroup
->
status
==
TAOS_VG_STATUS_CREATING
||
pVgroup
->
status
==
TAOS_VG_STATUS_DROPPING
)
{
mDebug
(
"vgId:%d, not exist in dnode:%d and status is %s, do nothing"
,
pVgroup
->
vgId
,
pDnode
->
dnodeId
,
vgroupStatus
[
pVgroup
->
status
]);
}
else
{
mDebug
(
"vgId:%d, not exist in dnode:%d and status is %s, send create msg"
,
pVgroup
->
vgId
,
pDnode
->
dnodeId
,
vgroupStatus
[
pVgroup
->
status
]);
mnodeSendCreateVgroupMsg
(
pVgroup
,
NULL
);
}
}
}
...
...
@@ -302,7 +305,6 @@ void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t o
}
sdbFreeIter
(
pIter
);
return
;
}
void
mnodeUpdateVgroupStatus
(
SVgObj
*
pVgroup
,
SDnodeObj
*
pDnode
,
SVnodeLoad
*
pVload
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录