Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
8292c490
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8292c490
编写于
7月 07, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-853] still need report status when unsynced
上级
aa80815f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
5 deletion
+18
-5
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+1
-1
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+7
-0
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+10
-4
未找到文件。
src/mnode/src/mnodeDnode.c
浏览文件 @
8292c490
...
@@ -334,7 +334,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -334,7 +334,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
if
(
pStatus
->
dnodeId
==
0
)
{
if
(
pStatus
->
dnodeId
==
0
)
{
mDebug
(
"dnode:%d %s, first access"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
);
mDebug
(
"dnode:%d %s, first access"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
);
}
else
{
}
else
{
//mDebug
("dnode:%d, status received, access times %d", pDnode->dnodeId, pDnode->lastAccess);
mTrace
(
"dnode:%d, status received, access times %d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
);
}
}
int32_t
openVnodes
=
htons
(
pStatus
->
openVnodes
);
int32_t
openVnodes
=
htons
(
pStatus
->
openVnodes
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
8292c490
...
@@ -171,6 +171,12 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
...
@@ -171,6 +171,12 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
mnodeVgroupUpdateIdPool
(
pVgroup
);
mnodeVgroupUpdateIdPool
(
pVgroup
);
// reset vgid status on vgroup changed
mDebug
(
"vgId:%d, reset sync status to unsynced"
,
pVgroup
->
vgId
);
for
(
int32_t
v
=
0
;
v
<
pVgroup
->
numOfVnodes
;
++
v
)
{
pVgroup
->
vnodeGid
[
v
].
role
=
TAOS_SYNC_ROLE_UNSYNCED
;
}
mnodeDecVgroupRef
(
pVgroup
);
mnodeDecVgroupRef
(
pVgroup
);
mDebug
(
"vgId:%d, is updated, numOfVnode:%d"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
);
mDebug
(
"vgId:%d, is updated, numOfVnode:%d"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
);
...
@@ -302,6 +308,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
...
@@ -302,6 +308,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SVnodeGid
*
pVgid
=
&
pVgroup
->
vnodeGid
[
i
];
SVnodeGid
*
pVgid
=
&
pVgroup
->
vnodeGid
[
i
];
if
(
pVgid
->
pDnode
==
pDnode
)
{
if
(
pVgid
->
pDnode
==
pDnode
)
{
mTrace
(
"dnode:%d, receive status from dnode, vgId:%d status is %d"
,
pVgroup
->
vgId
,
pDnode
->
dnodeId
,
pVgid
->
role
);
pVgid
->
role
=
pVload
->
role
;
pVgid
->
role
=
pVload
->
role
;
if
(
pVload
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
if
(
pVload
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
pVgroup
->
inUse
=
i
;
pVgroup
->
inUse
=
i
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
8292c490
...
@@ -415,13 +415,19 @@ void *vnodeGetWal(void *pVnode) {
...
@@ -415,13 +415,19 @@ void *vnodeGetWal(void *pVnode) {
}
}
static
void
vnodeBuildVloadMsg
(
SVnodeObj
*
pVnode
,
SDMStatusMsg
*
pStatus
)
{
static
void
vnodeBuildVloadMsg
(
SVnodeObj
*
pVnode
,
SDMStatusMsg
*
pStatus
)
{
int64_t
totalStorage
=
0
;
int64_t
compStorage
=
0
;
int64_t
pointsWritten
=
0
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
;
if
(
pStatus
->
openVnodes
>=
TSDB_MAX_VNODES
)
return
;
if
(
pStatus
->
openVnodes
>=
TSDB_MAX_VNODES
)
return
;
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
==
TAOS_SYNC_ROLE_UNSYNCED
)
return
;
if
(
pVnode
->
tsdb
==
NULL
)
return
;
int64_t
totalStorage
,
compStorage
,
pointsWritten
=
0
;
// still need report status when unsynced
tsdbReportStat
(
pVnode
->
tsdb
,
&
pointsWritten
,
&
totalStorage
,
&
compStorage
);
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
==
TAOS_SYNC_ROLE_UNSYNCED
)
{
}
else
if
(
pVnode
->
tsdb
==
NULL
)
{
}
else
{
tsdbReportStat
(
pVnode
->
tsdb
,
&
pointsWritten
,
&
totalStorage
,
&
compStorage
);
}
SVnodeLoad
*
pLoad
=
&
pStatus
->
load
[
pStatus
->
openVnodes
++
];
SVnodeLoad
*
pLoad
=
&
pStatus
->
load
[
pStatus
->
openVnodes
++
];
pLoad
->
vgId
=
htonl
(
pVnode
->
vgId
);
pLoad
->
vgId
=
htonl
(
pVnode
->
vgId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录