Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c7c47788
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
c7c47788
编写于
6月 04, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
b6e79b26
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
20 deletion
+24
-20
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+2
-2
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+22
-18
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
c7c47788
...
...
@@ -87,7 +87,7 @@ int metaAlterSTable(SMeta* pMeta, int64_t version, SVCreateStbReq* p
int
metaDropSTable
(
SMeta
*
pMeta
,
int64_t
verison
,
SVDropStbReq
*
pReq
);
int
metaCreateTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateTbReq
*
pReq
);
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
);
int
metaAlterTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVAlterTbReq
*
pReq
,
STableMetaRsp
*
pMetaRsp
);
int
metaAlterTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVAlterTbReq
*
pReq
,
STableMetaRsp
*
pMetaRsp
);
SSchemaWrapper
*
metaGetTableSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
bool
isinline
);
STSchema
*
metaGetTbTSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
);
int
metaGetTableEntryByName
(
SMetaReader
*
pReader
,
const
char
*
name
);
...
...
@@ -112,7 +112,7 @@ int32_t metaDropTSma(SMeta* pMeta, int64_t indexUid);
int
tsdbOpen
(
SVnode
*
pVnode
,
STsdb
**
ppTsdb
,
const
char
*
dir
,
STsdbKeepCfg
*
pKeepCfg
);
int
tsdbClose
(
STsdb
**
pTsdb
);
int
tsdbBegin
(
STsdb
*
pTsdb
);
int
tsdbCommit
(
STsdb
*
pTsdb
);
int
32_t
tsdbCommit
(
STsdb
*
pTsdb
);
int
tsdbScanAndConvertSubmitMsg
(
STsdb
*
pTsdb
,
SSubmitReq
*
pMsg
);
int
tsdbInsertData
(
STsdb
*
pTsdb
,
int64_t
version
,
SSubmitReq
*
pMsg
,
SSubmitRsp
*
pRsp
);
int
tsdbInsertTableData
(
STsdb
*
pTsdb
,
SSubmitMsgIter
*
pMsgIter
,
SSubmitBlk
*
pBlock
,
SSubmitBlkRsp
*
pRsp
);
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
c7c47788
...
...
@@ -86,7 +86,7 @@ static void tsdbCloseCommitFile(SCommitH *pCommith, bool hasError);
static
bool
tsdbCanAddSubBlock
(
SCommitH
*
pCommith
,
SBlock
*
pBlock
,
SMergeInfo
*
pInfo
);
static
void
tsdbLoadAndMergeFromCache
(
STsdb
*
pTsdb
,
SDataCols
*
pDataCols
,
int
*
iter
,
SCommitIter
*
pCommitIter
,
SDataCols
*
pTarget
,
TSKEY
maxKey
,
int
maxRows
,
int8_t
update
);
int
tsdbWriteBlockIdx
(
SDFile
*
pHeadf
,
SArray
*
pIdxA
,
void
**
ppBuf
);
static
int
tsdbWriteBlockIdx
(
SDFile
*
pHeadf
,
SArray
*
pIdxA
,
void
**
ppBuf
);
static
int
tsdbApplyRtnOnFSet
(
STsdb
*
pRepo
,
SDFileSet
*
pSet
,
SRtn
*
pRtn
);
int
tsdbBegin
(
STsdb
*
pTsdb
)
{
...
...
@@ -101,33 +101,36 @@ int tsdbBegin(STsdb *pTsdb) {
return
0
;
}
int
tsdbCommit
(
STsdb
*
pRepo
)
{
int32_t
tsdbCommit
(
STsdb
*
pTsdb
)
{
int32_t
code
=
0
;
SCommitH
commith
=
{
0
};
SDFileSet
*
pSet
=
NULL
;
int
fid
;
// if (pRepo->imem == NULL) return 0
;
p
Repo
->
imem
=
pRepo
->
mem
;
p
Repo
->
mem
=
NULL
;
ASSERT
(
pTsdb
->
imem
==
NULL
&&
pTsdb
->
mem
)
;
p
Tsdb
->
imem
=
pTsdb
->
mem
;
p
Tsdb
->
mem
=
NULL
;
tsdbStartCommit
(
pRepo
);
// Resource initialization
if
(
tsdbInitCommitH
(
&
commith
,
p
Repo
)
<
0
)
{
// start commit
tsdbStartCommit
(
pTsdb
);
if
(
tsdbInitCommitH
(
&
commith
,
p
Tsdb
)
<
0
)
{
return
-
1
;
}
#if 0
// Skip expired memory data and expired FSET
tsdbSeekCommitIter(&commith, commith.rtn.minKey);
while ((pSet = tsdbFSIterNext(&(commith.fsIter)))) {
if (pSet->fid < commith.rtn.minFid) {
tsdbInfo
(
"vgId:%d, FSET %d on level %d disk id %d expires, remove it"
,
REPO_ID
(
p
Repo
),
pSet
->
fid
,
tsdbInfo("vgId:%d, FSET %d on level %d disk id %d expires, remove it", REPO_ID(p
Tsdb
), pSet->fid,
TSDB_FSET_LEVEL(pSet), TSDB_FSET_ID(pSet));
} else {
break;
}
}
#endif
//
Loop to commit to each file
//
commit
fid
=
tsdbNextCommitFid
(
&
(
commith
));
while
(
true
)
{
// Loop over both on disk and memory
...
...
@@ -136,7 +139,7 @@ int tsdbCommit(STsdb *pRepo) {
if
(
pSet
&&
(
fid
==
TSDB_IVLD_FID
||
pSet
->
fid
<
fid
))
{
// Only has existing FSET but no memory data to commit in this
// existing FSET, only check if file in correct retention
if
(
tsdbApplyRtnOnFSet
(
p
Repo
,
pSet
,
&
(
commith
.
rtn
))
<
0
)
{
if
(
tsdbApplyRtnOnFSet
(
p
Tsdb
,
pSet
,
&
(
commith
.
rtn
))
<
0
)
{
tsdbDestroyCommitH
(
&
commith
);
return
-
1
;
}
...
...
@@ -167,10 +170,11 @@ int tsdbCommit(STsdb *pRepo) {
}
}
// end commit
tsdbDestroyCommitH
(
&
commith
);
tsdbEndCommit
(
p
Repo
,
TSDB_CODE_SUCCESS
);
tsdbEndCommit
(
p
Tsdb
,
TSDB_CODE_SUCCESS
);
return
0
;
return
code
;
}
static
int
tsdbApplyRtnOnFSet
(
STsdb
*
pRepo
,
SDFileSet
*
pSet
,
SRtn
*
pRtn
)
{
...
...
@@ -717,8 +721,8 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
// extern int32_t tsTsdbMetaCompactRatio;
int
tsdbWriteBlockInfoImpl
(
SDFile
*
pHeadf
,
STable
*
pTable
,
SArray
*
pSupA
,
SArray
*
pSubA
,
void
**
ppBuf
,
SBlockIdx
*
pIdx
)
{
static
int
tsdbWriteBlockInfoImpl
(
SDFile
*
pHeadf
,
STable
*
pTable
,
SArray
*
pSupA
,
SArray
*
pSubA
,
void
**
ppBuf
,
SBlockIdx
*
pIdx
)
{
size_t
nSupBlocks
;
size_t
nSubBlocks
;
uint32_t
tlen
;
...
...
@@ -778,7 +782,7 @@ int tsdbWriteBlockInfoImpl(SDFile *pHeadf, STable *pTable, SArray *pSupA, SArray
return
0
;
}
int
tsdbWriteBlockIdx
(
SDFile
*
pHeadf
,
SArray
*
pIdxA
,
void
**
ppBuf
)
{
static
int
tsdbWriteBlockIdx
(
SDFile
*
pHeadf
,
SArray
*
pIdxA
,
void
**
ppBuf
)
{
SBlockIdx
*
pBlkIdx
;
size_t
nidx
=
taosArrayGetSize
(
pIdxA
);
int
tlen
=
0
,
size
;
...
...
@@ -1012,8 +1016,8 @@ static int tsdbComparKeyBlock(const void *arg1, const void *arg2) {
* @param ppExBuf
* @return int
*/
int
tsdbWriteBlockImpl
(
STsdb
*
pRepo
,
STable
*
pTable
,
SDFile
*
pDFile
,
SDFile
*
pDFileAggr
,
SDataCols
*
pDataCols
,
SBlock
*
pBlock
,
bool
isLast
,
bool
isSuper
,
void
**
ppBuf
,
void
**
ppCBuf
,
void
**
ppExBuf
)
{
static
int
tsdbWriteBlockImpl
(
STsdb
*
pRepo
,
STable
*
pTable
,
SDFile
*
pDFile
,
SDFile
*
pDFileAggr
,
SDataCols
*
pDataCols
,
SBlock
*
pBlock
,
bool
isLast
,
bool
isSuper
,
void
**
ppBuf
,
void
**
ppCBuf
,
void
**
ppExBuf
)
{
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SBlockData
*
pBlockData
=
NULL
;
SAggrBlkData
*
pAggrBlkData
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录