Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b3a8651
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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,发现更多精彩内容 >>
未验证
提交
8b3a8651
编写于
2月 10, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
2月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10198 from taosdata/feature/mnode
collect vload infos
上级
38ba699e
29cb13cf
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
44 addition
and
7 deletion
+44
-7
include/common/tmsg.h
include/common/tmsg.h
+2
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+4
-2
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+21
-0
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+2
-0
source/dnode/vnode/CMakeLists.txt
source/dnode/vnode/CMakeLists.txt
+1
-0
source/dnode/vnode/src/vnd/vnodeInt.c
source/dnode/vnode/src/vnd/vnodeInt.c
+11
-1
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
8b3a8651
...
...
@@ -614,10 +614,11 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
int8_t
role
;
int64_t
numOfTables
;
int64_t
numOfTimeSeries
;
int64_t
totalStorage
;
int64_t
compStorage
;
int64_t
pointsWritten
;
int64_t
tablesNum
;
}
SVnodeLoad
;
typedef
struct
{
...
...
source/common/src/tmsg.c
浏览文件 @
8b3a8651
...
...
@@ -489,10 +489,11 @@ int32_t tSerializeSStatusReq(void **buf, SStatusReq *pReq) {
SVnodeLoad
*
pload
=
taosArrayGet
(
pReq
->
pVloads
,
i
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pload
->
vgId
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pload
->
role
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
numOfTables
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
numOfTimeSeries
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
totalStorage
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
compStorage
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
pointsWritten
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
tablesNum
);
}
return
tlen
;
...
...
@@ -531,10 +532,11 @@ void *tDeserializeSStatusReq(void *buf, SStatusReq *pReq) {
SVnodeLoad
vload
=
{
0
};
buf
=
taosDecodeFixedI32
(
buf
,
&
vload
.
vgId
);
buf
=
taosDecodeFixedI8
(
buf
,
&
vload
.
role
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
numOfTables
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
numOfTimeSeries
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
totalStorage
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
compStorage
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
pointsWritten
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
tablesNum
);
if
(
taosArrayPush
(
pReq
->
pVloads
,
&
vload
)
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
8b3a8651
...
...
@@ -283,8 +283,8 @@ typedef struct {
uint32_t
hashEnd
;
char
dbName
[
TSDB_DB_FNAME_LEN
];
int64_t
dbUid
;
int
32
_t
numOfTables
;
int
32
_t
numOfTimeSeries
;
int
64
_t
numOfTables
;
int
64
_t
numOfTimeSeries
;
int64_t
totalStorage
;
int64_t
compStorage
;
int64_t
pointsWritten
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
8b3a8651
...
...
@@ -322,6 +322,27 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) {
}
}
int32_t
numOfVloads
=
(
int32_t
)
taosArrayGetSize
(
statusReq
.
pVloads
);
for
(
int32_t
v
=
0
;
v
<
numOfVloads
;
++
v
)
{
SVnodeLoad
*
pVload
=
taosArrayGet
(
statusReq
.
pVloads
,
v
);
SVgObj
*
pVgroup
=
mndAcquireVgroup
(
pMnode
,
pVload
->
vgId
);
if
(
pVgroup
!=
NULL
)
{
if
(
pVload
->
role
==
TAOS_SYNC_STATE_LEADER
)
{
pVgroup
->
numOfTables
=
pVload
->
numOfTables
;
pVgroup
->
numOfTimeSeries
=
pVload
->
numOfTimeSeries
;
pVgroup
->
totalStorage
=
pVload
->
totalStorage
;
pVgroup
->
compStorage
=
pVload
->
compStorage
;
pVgroup
->
pointsWritten
=
pVload
->
pointsWritten
;
}
for
(
int32_t
vg
=
0
;
vg
<
pVgroup
->
replica
;
++
vg
)
{
pVgroup
->
vnodeGid
[
vg
].
role
=
pVload
->
role
;
}
}
mndReleaseVgroup
(
pMnode
,
pVgroup
);
}
int64_t
curMs
=
taosGetTimestampMs
();
bool
online
=
mndIsDnodeOnline
(
pMnode
,
pDnode
,
curMs
);
bool
dnodeChanged
=
(
statusReq
.
dver
!=
sdbGetTableVer
(
pMnode
->
pSdb
,
SDB_DNODE
));
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
8b3a8651
...
...
@@ -462,6 +462,8 @@ void mndProcessMsg(SMnodeMsg *pMsg) {
PROCESS_RPC_END:
if
(
isReq
)
{
if
(
pMsg
->
rpcMsg
.
handle
==
NULL
)
return
;
if
(
code
==
TSDB_CODE_APP_NOT_READY
)
{
mndSendRedirectRsp
(
pMnode
,
&
pMsg
->
rpcMsg
);
}
else
if
(
code
!=
0
)
{
...
...
source/dnode/vnode/CMakeLists.txt
浏览文件 @
8b3a8651
...
...
@@ -28,6 +28,7 @@ target_link_libraries(
PUBLIC scheduler
PUBLIC executor
PUBLIC qworker
PUBLIC sync
)
if
(
${
BUILD_TEST
}
)
...
...
source/dnode/vnode/src/vnd/vnodeInt.c
浏览文件 @
8b3a8651
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "vnd.h"
#include "sync.h"
// #include "vnodeInt.h"
int32_t
vnodeAlter
(
SVnode
*
pVnode
,
const
SVnodeCfg
*
pCfg
)
{
return
0
;
}
...
...
@@ -23,7 +24,16 @@ int32_t vnodeCompact(SVnode *pVnode) { return 0; }
int32_t
vnodeSync
(
SVnode
*
pVnode
)
{
return
0
;
}
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
)
{
return
0
;
}
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
)
{
pLoad
->
vgId
=
pVnode
->
vgId
;
pLoad
->
role
=
TAOS_SYNC_STATE_LEADER
;
pLoad
->
numOfTables
=
500
;
pLoad
->
numOfTimeSeries
=
400
;
pLoad
->
totalStorage
=
300
;
pLoad
->
compStorage
=
200
;
pLoad
->
pointsWritten
=
100
;
return
0
;
}
int
vnodeProcessSyncReq
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
SRpcMsg
**
pRsp
)
{
vInfo
(
"sync message is processed"
);
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
8b3a8651
...
...
@@ -419,7 +419,7 @@ void rpcSendRequest(void *shandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t
}
void
rpcSendResponse
(
const
SRpcMsg
*
pRsp
)
{
if
(
pRsp
->
handle
==
NULL
)
return
;
ASSERT
(
pRsp
->
handle
!=
NULL
)
;
int
msgLen
=
0
;
SRpcConn
*
pConn
=
(
SRpcConn
*
)
pRsp
->
handle
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录