Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
01aca9ff
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
01aca9ff
编写于
8月 30, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: stat timeseries every minute to avoid dnode offline caused by massive tables
上级
24208378
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
21 deletion
+27
-21
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+15
-13
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+12
-8
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
01aca9ff
...
...
@@ -157,17 +157,17 @@ void tsdbCacheSetCapacity(SVnode *pVnode, size_t capacity);
size_t
tsdbCacheGetCapacity
(
SVnode
*
pVnode
);
// tq
typedef
struct
SMetaTableInfo
{
typedef
struct
SMetaTableInfo
{
int64_t
suid
;
int64_t
uid
;
SSchemaWrapper
*
schema
;
char
tbName
[
TSDB_TABLE_NAME_LEN
];
}
SMetaTableInfo
;
}
SMetaTableInfo
;
typedef
struct
SIdInfo
{
int64_t
version
;
int32_t
index
;
}
SIdInfo
;
typedef
struct
SIdInfo
{
int64_t
version
;
int32_t
index
;
}
SIdInfo
;
typedef
struct
SSnapContext
{
SMeta
*
pMeta
;
...
...
@@ -180,8 +180,8 @@ typedef struct SSnapContext {
SArray
*
idList
;
int32_t
index
;
bool
withMeta
;
bool
queryMetaOrData
;
// true-get meta, false-get data
}
SSnapContext
;
bool
queryMetaOrData
;
// true-get meta, false-get data
}
SSnapContext
;
typedef
struct
STqReader
{
int64_t
ver
;
...
...
@@ -232,11 +232,12 @@ int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWr
int32_t
vnodeSnapWriterClose
(
SVSnapWriter
*
pWriter
,
int8_t
rollback
,
SSnapshot
*
pSnapshot
);
int32_t
vnodeSnapWrite
(
SVSnapWriter
*
pWriter
,
uint8_t
*
pData
,
uint32_t
nData
);
int32_t
buildSnapContext
(
SMeta
*
pMeta
,
int64_t
snapVersion
,
int64_t
suid
,
int8_t
subType
,
bool
withMeta
,
SSnapContext
**
ctxRet
);
int32_t
getMetafromSnapShot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
);
SMetaTableInfo
getUidfromSnapShot
(
SSnapContext
*
ctx
);
int32_t
setForSnapShot
(
SSnapContext
*
ctx
,
int64_t
uid
);
int32_t
destroySnapContext
(
SSnapContext
*
ctx
);
int32_t
buildSnapContext
(
SMeta
*
pMeta
,
int64_t
snapVersion
,
int64_t
suid
,
int8_t
subType
,
bool
withMeta
,
SSnapContext
**
ctxRet
);
int32_t
getMetafromSnapShot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
);
SMetaTableInfo
getUidfromSnapShot
(
SSnapContext
*
ctx
);
int32_t
setForSnapShot
(
SSnapContext
*
ctx
,
int64_t
uid
);
int32_t
destroySnapContext
(
SSnapContext
*
ctx
);
// structs
struct
STsdbCfg
{
...
...
@@ -259,6 +260,7 @@ typedef struct {
int64_t
numOfNTables
;
int64_t
numOfNTimeSeries
;
int64_t
numOfTimeSeries
;
int64_t
itvTimeSeries
;
int64_t
pointsWritten
;
int64_t
totalStorage
;
int64_t
compStorage
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
01aca9ff
...
...
@@ -615,9 +615,13 @@ int64_t metaGetTbNum(SMeta *pMeta) {
// N.B. Called by statusReq per second
int64_t
metaGetTimeSeriesNum
(
SMeta
*
pMeta
)
{
// sum of (number of columns of stable - 1) * number of ctables (excluding timestamp column)
int64_t
num
=
0
;
vnodeGetTimeSeriesNum
(
pMeta
->
pVnode
,
&
num
);
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
=
num
;
if
(
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
<=
0
||
++
pMeta
->
pVnode
->
config
.
vndStats
.
itvTimeSeries
%
60
==
0
)
{
int64_t
num
=
0
;
vnodeGetTimeSeriesNum
(
pMeta
->
pVnode
,
&
num
);
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
=
num
;
pMeta
->
pVnode
->
config
.
vndStats
.
itvTimeSeries
=
0
;
}
return
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
+
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
;
}
...
...
@@ -890,7 +894,7 @@ const void *metaGetTableTagVal(void *pTag, int16_t type, STagVal *val) {
#ifdef TAG_FILTER_DEBUG
if
(
IS_VAR_DATA_TYPE
(
val
->
type
))
{
char
*
buf
=
taosMemoryCalloc
(
val
->
nData
+
1
,
1
);
char
*
buf
=
taosMemoryCalloc
(
val
->
nData
+
1
,
1
);
memcpy
(
buf
,
val
->
pData
,
val
->
nData
);
metaDebug
(
"metaTag table val varchar index:%d cid:%d type:%d value:%s"
,
1
,
val
->
cid
,
val
->
type
,
buf
);
taosMemoryFree
(
buf
);
...
...
@@ -900,13 +904,13 @@ const void *metaGetTableTagVal(void *pTag, int16_t type, STagVal *val) {
metaDebug
(
"metaTag table val number index:%d cid:%d type:%d value:%f"
,
1
,
val
->
cid
,
val
->
type
,
dval
);
}
SArray
*
pTagVals
=
NULL
;
tTagToValArray
((
STag
*
)
pTag
,
&
pTagVals
);
SArray
*
pTagVals
=
NULL
;
tTagToValArray
((
STag
*
)
pTag
,
&
pTagVals
);
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
pTagVals
);
i
++
)
{
STagVal
*
pTagVal
=
(
STagVal
*
)
taosArrayGet
(
pTagVals
,
i
);
STagVal
*
pTagVal
=
(
STagVal
*
)
taosArrayGet
(
pTagVals
,
i
);
if
(
IS_VAR_DATA_TYPE
(
pTagVal
->
type
))
{
char
*
buf
=
taosMemoryCalloc
(
pTagVal
->
nData
+
1
,
1
);
char
*
buf
=
taosMemoryCalloc
(
pTagVal
->
nData
+
1
,
1
);
memcpy
(
buf
,
pTagVal
->
pData
,
pTagVal
->
nData
);
metaDebug
(
"metaTag table varchar index:%d cid:%d type:%d value:%s"
,
i
,
pTagVal
->
cid
,
pTagVal
->
type
,
buf
);
taosMemoryFree
(
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录