Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
93dbe454
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看板
未验证
提交
93dbe454
编写于
3月 08, 2023
作者:
S
Shengliang Guan
提交者:
GitHub
3月 08, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20309 from taosdata/feat/compact_with_time_range
feat: compact with time range
上级
4a682ebe
b5b6f310
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
15 deletion
+35
-15
include/common/tmsg.h
include/common/tmsg.h
+4
-3
source/common/src/tmsg.c
source/common/src/tmsg.c
+16
-1
source/dnode/mnode/impl/inc/mndVgroup.h
source/dnode/mnode/impl/inc/mndVgroup.h
+2
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+9
-7
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+4
-3
未找到文件。
include/common/tmsg.h
浏览文件 @
93dbe454
...
...
@@ -1291,9 +1291,10 @@ int32_t tSerializeSDropIdxReq(void* buf, int32_t bufLen, SDropIndexReq* pReq);
int32_t
tDeserializeSDropIdxReq
(
void
*
buf
,
int32_t
bufLen
,
SDropIndexReq
*
pReq
);
typedef
struct
{
int64_t
dbUid
;
char
db
[
TSDB_DB_FNAME_LEN
];
int64_t
compactStartTime
;
int64_t
dbUid
;
char
db
[
TSDB_DB_FNAME_LEN
];
int64_t
compactStartTime
;
STimeWindow
tw
;
}
SCompactVnodeReq
;
int32_t
tSerializeSCompactVnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SCompactVnodeReq
*
pReq
);
...
...
source/common/src/tmsg.c
浏览文件 @
93dbe454
...
...
@@ -4108,6 +4108,11 @@ int32_t tSerializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq *
if
(
tEncodeI64
(
&
encoder
,
pReq
->
dbUid
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
db
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
compactStartTime
)
<
0
)
return
-
1
;
// 1.1 add tw.skey and tw.ekey
if
(
tEncodeI64
(
&
encoder
,
pReq
->
tw
.
skey
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
tw
.
ekey
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -4120,11 +4125,21 @@ int32_t tDeserializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq
tDecoderInit
(
&
decoder
,
buf
,
bufLen
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
dbUid
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
db
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
compactStartTime
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
// 1.1
if
(
tDecodeIsEnd
(
&
decoder
))
{
pReq
->
tw
.
skey
=
TSKEY_MIN
;
pReq
->
tw
.
ekey
=
TSKEY_MAX
;
}
else
{
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
tw
.
skey
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
tw
.
ekey
)
<
0
)
return
-
1
;
}
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
return
0
;
}
...
...
source/dnode/mnode/impl/inc/mndVgroup.h
浏览文件 @
93dbe454
...
...
@@ -43,7 +43,8 @@ int32_t mndAddDropVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVg
int32_t
mndSetMoveVgroupsInfoToTrans
(
SMnode
*
,
STrans
*
pTrans
,
int32_t
dropDnodeId
,
bool
force
);
int32_t
mndBuildAlterVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pOldDb
,
SDbObj
*
pNewDb
,
SVgObj
*
pVgroup
,
SArray
*
pArray
);
int32_t
mndBuildCompactVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
);
int32_t
mndBuildCompactVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
,
STimeWindow
tw
);
void
*
mndBuildCreateVnodeReq
(
SMnode
*
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
void
*
mndBuildDropVnodeReq
(
SMnode
*
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
93dbe454
...
...
@@ -2209,11 +2209,12 @@ _OVER:
bool
mndVgroupInDb
(
SVgObj
*
pVgroup
,
int64_t
dbUid
)
{
return
!
pVgroup
->
isTsma
&&
pVgroup
->
dbUid
==
dbUid
;
}
static
void
*
mndBuildCompactVnodeReq
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
,
int64_t
compactTs
)
{
static
void
*
mndBuildCompactVnodeReq
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
,
int64_t
compactTs
,
STimeWindow
tw
)
{
SCompactVnodeReq
compactReq
=
{
0
};
compactReq
.
dbUid
=
pDb
->
uid
;
compactReq
.
compactStartTime
=
compactTs
;
compactReq
.
tw
=
tw
;
tstrncpy
(
compactReq
.
db
,
pDb
->
name
,
TSDB_DB_FNAME_LEN
);
mInfo
(
"vgId:%d, build compact vnode config req"
,
pVgroup
->
vgId
);
...
...
@@ -2239,13 +2240,13 @@ static void *mndBuildCompactVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgrou
return
pReq
;
}
static
int32_t
mndAddCompactVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
)
{
static
int32_t
mndAddCompactVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
,
STimeWindow
tw
)
{
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetVgroupEpset
(
pMnode
,
pVgroup
);
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildCompactVnodeReq
(
pMnode
,
pDb
,
pVgroup
,
&
contLen
,
compactTs
);
void
*
pReq
=
mndBuildCompactVnodeReq
(
pMnode
,
pDb
,
pVgroup
,
&
contLen
,
compactTs
,
tw
);
if
(
pReq
==
NULL
)
return
-
1
;
action
.
pCont
=
pReq
;
...
...
@@ -2260,7 +2261,8 @@ static int32_t mndAddCompactVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *
return
0
;
}
int32_t
mndBuildCompactVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
)
{
if
(
mndAddCompactVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
,
compactTs
)
!=
0
)
return
-
1
;
int32_t
mndBuildCompactVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int64_t
compactTs
,
STimeWindow
tw
)
{
if
(
mndAddCompactVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
,
compactTs
,
tw
)
!=
0
)
return
-
1
;
return
0
;
}
\ No newline at end of file
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
93dbe454
...
...
@@ -457,9 +457,10 @@ struct SCommitInfo {
};
struct
SCompactInfo
{
SVnode
*
pVnode
;
int32_t
flag
;
int64_t
commitID
;
SVnode
*
pVnode
;
int32_t
flag
;
int64_t
commitID
;
STimeWindow
tw
;
};
#ifdef __cplusplus
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录