Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a21fbd05
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看板
提交
a21fbd05
编写于
12月 28, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
f35900ca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
32 deletion
+46
-32
source/dnode/vnode/src/tsdb/tsdbCompact.c
source/dnode/vnode/src/tsdb/tsdbCompact.c
+46
-26
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+0
-6
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCompact.c
浏览文件 @
a21fbd05
...
...
@@ -614,32 +614,52 @@ int32_t tsdbCompact(STsdb *pTsdb, int32_t flag) {
nRow
++
;
// write block data if schema changed
// if ((pCompactor->bData.suid || pCompactor->bData.uid) &&
// !TABLE_SAME_SCHEMA(pCompactor->bData.suid, pCompactor->bData.uid, pRowInfo->suid, pRowInfo->uid)) {
// // TODO: write block data
// ASSERT(0);
// // set block data not initialized
// tBlockDataReset(&pCompactor->bData);
// }
// // init the block data if not initialized yet
// if (pCompactor->bData.suid == 0 && pCompactor->bData.uid == 0) {
// code = tBlockDataInit(&pCompactor->bData, &(TABLEID){.suid = pRowInfo->suid, .uid = pRowInfo->uid}, pTSchema,
// NULL, 0);
// TSDB_CHECK_CODE(code, lino, _exit);
// }
// // append row to block data
// code = tBlockDataAppendRow(&pCompactor->bData, &pRowInfo->row, pTSchema, pRowInfo->uid);
// TSDB_CHECK_CODE(code, lino, _exit);
// // check if block data is full
// if (pCompactor->bData.nRow >= pCompactor->maxRows) {
// // TODO: write block data
// ASSERT(0);
// }
if
(
pCompactor
->
bData
.
suid
==
0
&&
pCompactor
->
bData
.
uid
==
0
)
{
// init the block data if not initialized yet
code
=
tBlockDataInit
(
&
pCompactor
->
bData
,
&
(
TABLEID
){.
suid
=
pRowInfo
->
suid
,
.
uid
=
pRowInfo
->
uid
},
pTSchema
,
NULL
,
0
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
else
{
if
(
pCompactor
->
bData
.
suid
!=
pRowInfo
->
suid
)
{
// not same super table
if
(
pCompactor
->
bData
.
nRow
<
pCompactor
->
minRows
)
{
// TODO: write block data to .stt file, need to check if nRow is 0
tBlockDataClear
(
&
pCompactor
->
bData
);
}
else
{
// TODO: write block data to .data file, need to check if nRow is 0
tBlockDataClear
(
&
pCompactor
->
bData
);
}
code
=
tBlockDataInit
(
&
pCompactor
->
bData
,
&
(
TABLEID
){.
suid
=
pRowInfo
->
suid
,
.
uid
=
pRowInfo
->
uid
},
pTSchema
,
NULL
,
0
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
else
if
(
pCompactor
->
bData
.
uid
!=
pRowInfo
->
uid
)
{
if
(
pRowInfo
->
suid
)
{
// different child table
if
(
pCompactor
->
bData
.
nRow
>
pCompactor
->
minRows
)
{
// TODO
}
}
else
{
// different normal table
if
(
pCompactor
->
bData
.
nRow
<
pCompactor
->
minRows
)
{
// TODO: write data to .stt file, need to check if nRow is 0
tBlockDataClear
(
&
pCompactor
->
bData
);
}
else
{
// TODO: write data to .data file, need to check if nRow is 0
tBlockDataClear
(
&
pCompactor
->
bData
);
}
code
=
tBlockDataInit
(
&
pCompactor
->
bData
,
&
(
TABLEID
){.
suid
=
pRowInfo
->
suid
,
.
uid
=
pRowInfo
->
uid
},
pTSchema
,
NULL
,
0
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
}
}
// append row to block data
code
=
tBlockDataAppendRow
(
&
pCompactor
->
bData
,
&
pRowInfo
->
row
,
pTSchema
,
pRowInfo
->
uid
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// check if block data is full
if
(
pCompactor
->
bData
.
nRow
>=
pCompactor
->
maxRows
)
{
tBlockDataClear
(
&
pCompactor
->
bData
);
}
// iterate to next row
code
=
tsdbCompactNextRow
(
pCompactor
);
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
a21fbd05
...
...
@@ -301,11 +301,7 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
vnodeProcessAlterConfigReq
(
pVnode
,
version
,
pReq
,
len
,
pRsp
);
break
;
case
TDMT_VND_COMMIT
:
#if 0
vnodeSyncCommit
(
pVnode
);
#else
vnodeAsyncCompact
(
pVnode
);
#endif
vnodeBegin
(
pVnode
);
goto
_exit
;
case
TDMT_VND_COMPACT
:
...
...
@@ -1276,10 +1272,8 @@ static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t version, void
vInfo
(
"vgId:%d, compact msg will be processed, db:%s dbUid:%"
PRId64
" compactStartTime:%"
PRId64
,
TD_VID
(
pVnode
),
req
.
db
,
req
.
dbUid
,
req
.
compactStartTime
);
#if 0
vnodeAsyncCompact
(
pVnode
);
vnodeBegin
(
pVnode
);
#endif
return
0
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录