Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4ed2af9e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
4ed2af9e
编写于
6月 13, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
cc764032
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
5 deletion
+20
-5
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-0
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+3
-1
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
+8
-4
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+8
-0
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
4ed2af9e
...
...
@@ -150,6 +150,7 @@ int32_t tTABLEIDCmprFn(const void *p1, const void *p2);
int32_t
tsdbKeyCmprFn
(
const
void
*
p1
,
const
void
*
p2
);
// SDelIdx
int32_t
tDelIdxClear
(
SDelIdx
*
pDelIdx
);
int32_t
tDelIdxPutItem
(
SDelIdx
*
pDelIdx
,
SDelIdxItem
*
pItem
);
int32_t
tDelIdxGetItemByIdx
(
SDelIdx
*
pDelIdx
,
SDelIdxItem
*
pItem
,
int32_t
idx
);
int32_t
tDelIdxGetItem
(
SDelIdx
*
pDelIdx
,
SDelIdxItem
*
pItem
,
TABLEID
id
);
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
4ed2af9e
...
...
@@ -265,6 +265,8 @@ static int32_t tsdbCommitDelEnd(SCommitter *pCommitter) {
if
(
code
)
goto
_err
;
}
tDelIdxClear
(
&
pCommitter
->
delIdxNew
);
return
code
;
_err:
...
...
@@ -300,7 +302,7 @@ static int32_t tsdbCommitDel(SCommitter *pCommitter) {
}
_exit:
tsdbDebug
(
"vgId:%d commit del d
ata d
one, nDel:%"
PRId64
,
TD_VID
(
pTsdb
->
pVnode
),
pMemTable
->
nDel
);
tsdbDebug
(
"vgId:%d commit del done, nDel:%"
PRId64
,
TD_VID
(
pTsdb
->
pVnode
),
pMemTable
->
nDel
);
return
code
;
_err:
...
...
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
浏览文件 @
4ed2af9e
...
...
@@ -107,6 +107,9 @@ int32_t tsdbDelFWriterOpen(SDelFWriter **ppWriter, SDelFile *pFile, STsdb *pTsdb
goto
_err
;
}
pDelFWriter
->
pFile
->
size
=
TSDB_FHDR_SIZE
;
pDelFWriter
->
pFile
->
offset
=
0
;
return
code
;
_err:
...
...
@@ -188,7 +191,6 @@ int32_t tsdbWriteDelIdx(SDelFWriter *pWriter, SDelIdx *pDelIdx, uint8_t **ppBuf)
// prepare
pDelIdx
->
delimiter
=
TSDB_FILE_DLMT
;
// pDelIdx->nOffset = (todo)
// alloc
if
(
!
ppBuf
)
ppBuf
=
&
pBuf
;
...
...
@@ -219,7 +221,7 @@ int32_t tsdbWriteDelIdx(SDelFWriter *pWriter, SDelIdx *pDelIdx, uint8_t **ppBuf)
return
code
;
_err:
tsdbError
(
"vgId:%d
failed to write del idx
since %s"
,
TD_VID
(
pWriter
->
pTsdb
->
pVnode
),
tstrerror
(
code
));
tsdbError
(
"vgId:%d
write del idx failed
since %s"
,
TD_VID
(
pWriter
->
pTsdb
->
pVnode
),
tstrerror
(
code
));
tsdbFree
(
pBuf
);
return
code
;
}
...
...
@@ -379,9 +381,12 @@ _err:
int32_t
tsdbReadDelIdx
(
SDelFReader
*
pReader
,
SDelIdx
*
pDelIdx
,
uint8_t
**
ppBuf
)
{
int32_t
code
=
0
;
int32_t
n
;
int64_t
offset
=
pReader
->
pFile
->
offset
;
int64_t
size
=
pReader
->
pFile
->
size
-
offset
;
ASSERT
(
ppBuf
&&
*
ppBuf
);
// seek
if
(
taosLSeekFile
(
pReader
->
pReadH
,
offset
,
SEEK_SET
)
<
0
)
{
code
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -407,10 +412,9 @@ int32_t tsdbReadDelIdx(SDelFReader *pReader, SDelIdx *pDelIdx, uint8_t **ppBuf)
}
// decode
int32_t
n
=
tGetDelIdx
(
*
ppBuf
,
pDelIdx
);
n
=
tGetDelIdx
(
*
ppBuf
,
pDelIdx
);
ASSERT
(
n
==
size
-
sizeof
(
TSCKSUM
));
ASSERT
(
pDelIdx
->
delimiter
==
TSDB_FILE_DLMT
);
// ASSERT(pDelIdx->nOffset > 0 && pDelIdx->nData > 0);
return
code
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
4ed2af9e
...
...
@@ -15,6 +15,7 @@
#include "tsdb.h"
// SOffset =======================================================================
#define TSDB_OFFSET_I32 ((uint8_t)0)
#define TSDB_OFFSET_I16 ((uint8_t)1)
#define TSDB_OFFSET_I8 ((uint8_t)2)
...
...
@@ -234,6 +235,13 @@ static FORCE_INLINE int32_t tGetDelIdxItem(uint8_t *p, SDelIdxItem *pDelIdxItem)
}
// SDelIdx ======================================================
int32_t
tDelIdxClear
(
SDelIdx
*
pDelIdx
)
{
int32_t
code
=
0
;
tdbFree
(
pDelIdx
->
offset
.
pOffset
);
tdbFree
(
pDelIdx
->
pData
);
return
code
;
}
int32_t
tDelIdxPutItem
(
SDelIdx
*
pDelIdx
,
SDelIdxItem
*
pItem
)
{
int32_t
code
=
0
;
uint32_t
offset
=
pDelIdx
->
nData
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录