Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
490caa96
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
490caa96
编写于
6月 09, 2021
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4599]<fix>: fix false dnode offline
上级
3bf8a5dd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
18 deletion
+17
-18
src/balance/src/bnMain.c
src/balance/src/bnMain.c
+4
-4
src/balance/src/bnThread.c
src/balance/src/bnThread.c
+5
-5
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+1
-2
src/mnode/inc/mnodeDnode.h
src/mnode/inc/mnodeDnode.h
+1
-1
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+6
-6
未找到文件。
src/balance/src/bnMain.c
浏览文件 @
490caa96
...
@@ -405,7 +405,7 @@ void bnReset() {
...
@@ -405,7 +405,7 @@ void bnReset() {
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
==
NULL
)
break
;
// while master change, should reset dnode to offline
// while master change, should reset dnode to offline
mInfo
(
"dnode:%d set access:%
d
to 0"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
);
mInfo
(
"dnode:%d set access:%
"
PRId64
"
to 0"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
);
pDnode
->
lastAccess
=
0
;
pDnode
->
lastAccess
=
0
;
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
)
{
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
)
{
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
...
@@ -499,7 +499,7 @@ static bool bnMontiorDropping() {
...
@@ -499,7 +499,7 @@ static bool bnMontiorDropping() {
if
(
dnodeIsMasterEp
(
pDnode
->
dnodeEp
))
continue
;
if
(
dnodeIsMasterEp
(
pDnode
->
dnodeEp
))
continue
;
if
(
mnodeGetDnodesNum
()
<=
1
)
continue
;
if
(
mnodeGetDnodesNum
()
<=
1
)
continue
;
mLInfo
(
"dnode:%d, set to removing state for it offline:%
d
seconds"
,
pDnode
->
dnodeId
,
mLInfo
(
"dnode:%d, set to removing state for it offline:%
"
PRId64
"
seconds"
,
pDnode
->
dnodeId
,
tsAccessSquence
-
pDnode
->
lastAccess
);
tsAccessSquence
-
pDnode
->
lastAccess
);
pDnode
->
status
=
TAOS_DN_STATUS_DROPPING
;
pDnode
->
status
=
TAOS_DN_STATUS_DROPPING
;
...
@@ -574,8 +574,8 @@ void bnCheckStatus() {
...
@@ -574,8 +574,8 @@ void bnCheckStatus() {
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
&&
pDnode
->
status
!=
TAOS_DN_STATUS_OFFLINE
)
{
if
(
pDnode
->
status
!=
TAOS_DN_STATUS_DROPPING
&&
pDnode
->
status
!=
TAOS_DN_STATUS_OFFLINE
)
{
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
offlineReason
=
TAOS_DN_OFF_STATUS_MSG_TIMEOUT
;
pDnode
->
offlineReason
=
TAOS_DN_OFF_STATUS_MSG_TIMEOUT
;
mInfo
(
"dnode:%d, set to offline state, access seq:%
d last seq:%d laststat:%d"
,
pDnode
->
dnodeId
,
tsAccessSquence
,
mInfo
(
"dnode:%d, set to offline state, access seq:%
"
PRId64
" last seq:%"
PRId64
" laststat:%d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
,
pDnode
->
status
);
tsAccessSquence
,
pDnode
->
lastAccess
,
pDnode
->
status
);
bnSetVgroupOffline
(
pDnode
);
bnSetVgroupOffline
(
pDnode
);
bnStartTimer
(
3000
);
bnStartTimer
(
3000
);
}
}
...
...
src/balance/src/bnThread.c
浏览文件 @
490caa96
...
@@ -101,13 +101,13 @@ static void bnProcessTimer(void *handle, void *tmrId) {
...
@@ -101,13 +101,13 @@ static void bnProcessTimer(void *handle, void *tmrId) {
if
(
!
sdbIsMaster
())
return
;
if
(
!
sdbIsMaster
())
return
;
if
(
tsBnThread
.
stop
)
return
;
if
(
tsBnThread
.
stop
)
return
;
tsBnThread
.
timer
=
NULL
;
if
(
handle
==
NULL
)
{
tsAccessSquence
++
;
tsBnThread
.
timer
=
NULL
;
++
tsAccessSquence
;
bnStartTimer
(
-
1
);
bnStartTimer
(
-
1
);
bnCheckStatus
();
bnCheckStatus
();
if
(
handle
==
NULL
)
{
if
(
tsAccessSquence
%
tsBalanceInterval
==
0
)
{
if
(
tsAccessSquence
%
tsBalanceInterval
==
0
)
{
mDebug
(
"balance function is scheduled by timer"
);
mDebug
(
"balance function is scheduled by timer"
);
bnPostSignal
();
bnPostSignal
();
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
490caa96
...
@@ -48,9 +48,8 @@ typedef struct SDnodeObj {
...
@@ -48,9 +48,8 @@ typedef struct SDnodeObj {
int32_t
dnodeId
;
int32_t
dnodeId
;
int32_t
openVnodes
;
int32_t
openVnodes
;
int64_t
createdTime
;
int64_t
createdTime
;
int
32_t
resever0
;
// from dnode status msg, config information
int
64_t
lastAccess
;
int32_t
customScore
;
// config by user
int32_t
customScore
;
// config by user
uint32_t
lastAccess
;
uint16_t
numOfCores
;
// from dnode status msg
uint16_t
numOfCores
;
// from dnode status msg
uint16_t
dnodePort
;
uint16_t
dnodePort
;
char
dnodeFqdn
[
TSDB_FQDN_LEN
];
char
dnodeFqdn
[
TSDB_FQDN_LEN
];
...
...
src/mnode/inc/mnodeDnode.h
浏览文件 @
490caa96
...
@@ -77,7 +77,7 @@ void * mnodeGetDnodeByEp(char *ep);
...
@@ -77,7 +77,7 @@ void * mnodeGetDnodeByEp(char *ep);
void
mnodeUpdateDnode
(
SDnodeObj
*
pDnode
);
void
mnodeUpdateDnode
(
SDnodeObj
*
pDnode
);
int32_t
mnodeDropDnode
(
SDnodeObj
*
pDnode
,
void
*
pMsg
);
int32_t
mnodeDropDnode
(
SDnodeObj
*
pDnode
,
void
*
pMsg
);
extern
int
32
_t
tsAccessSquence
;
extern
int
64
_t
tsAccessSquence
;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
490caa96
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
#include "mnodePeer.h"
#include "mnodePeer.h"
#include "mnodeCluster.h"
#include "mnodeCluster.h"
int
32_t
tsAccessSquence
=
0
;
int
64_t
tsAccessSquence
=
0
;
int64_t
tsDnodeRid
=
-
1
;
int64_t
tsDnodeRid
=
-
1
;
static
void
*
tsDnodeSdb
=
NULL
;
static
void
*
tsDnodeSdb
=
NULL
;
static
int32_t
tsDnodeUpdateSize
=
0
;
static
int32_t
tsDnodeUpdateSize
=
0
;
extern
void
*
tsMnodeSdb
;
extern
void
*
tsMnodeSdb
;
...
@@ -567,7 +567,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -567,7 +567,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
mnodeGetClusterId
());
mnodeGetClusterId
());
return
TSDB_CODE_MND_INVALID_CLUSTER_ID
;
return
TSDB_CODE_MND_INVALID_CLUSTER_ID
;
}
else
{
}
else
{
mTrace
(
"dnode:%d, status received, access times %
d
openVnodes:%d:%d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
,
mTrace
(
"dnode:%d, status received, access times %
"
PRId64
"
openVnodes:%d:%d"
,
pDnode
->
dnodeId
,
pDnode
->
lastAccess
,
htons
(
pStatus
->
openVnodes
),
pDnode
->
openVnodes
);
htons
(
pStatus
->
openVnodes
),
pDnode
->
openVnodes
);
}
}
}
}
...
@@ -629,9 +629,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -629,9 +629,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
bnNotify
();
bnNotify
();
}
}
i
f
(
!
tsEnableBalance
)
{
i
nt32_t
numOfMnodes
=
mnodeGetMnodesNum
();
int32_t
numOfMnodes
=
mnodeGetMnodesNum
();
if
(
numOfMnodes
<
tsNumOfMnodes
&&
numOfMnodes
<
mnodeGetOnlineDnodesNum
())
{
if
(
numOfMnodes
<
tsNumOfMnodes
)
bnNotify
();
bnNotify
();
}
}
if
(
openVnodes
!=
pDnode
->
openVnodes
)
{
if
(
openVnodes
!=
pDnode
->
openVnodes
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录