Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f3cf8d5b
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看板
提交
f3cf8d5b
编写于
4月 09, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-238]<feature>: adjust tsdbLoadLastCache
上级
a59165fe
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
src/tsdb/inc/tsdbint.h
src/tsdb/inc/tsdbint.h
+1
-1
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+10
-10
未找到文件。
src/tsdb/inc/tsdbint.h
浏览文件 @
f3cf8d5b
...
...
@@ -116,7 +116,7 @@ STsdbMeta* tsdbGetMeta(STsdbRepo* pRepo);
int
tsdbCheckCommit
(
STsdbRepo
*
pRepo
);
int
tsdbRestoreInfo
(
STsdbRepo
*
pRepo
);
UNUSED_FUNC
int
tsdbCacheLastData
(
STsdbRepo
*
pRepo
,
STsdbCfg
*
oldCfg
);
int32_t
tsdbLoadLastCache
(
STsdbRepo
*
pRepo
,
STable
*
pTable
,
bool
lastKey
);
int32_t
tsdbLoadLastCache
(
STsdbRepo
*
pRepo
,
STable
*
pTable
,
bool
force
);
void
tsdbGetRootDir
(
int
repoid
,
char
dirName
[]);
void
tsdbGetDataDir
(
int
repoid
,
char
dirName
[]);
int
tsdbRestoreLastRow
(
STsdbRepo
*
pRepo
,
STable
*
pTable
,
SReadH
*
pReadh
,
SBlockIdx
*
pIdx
,
bool
onlyKey
);
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
f3cf8d5b
...
...
@@ -937,16 +937,16 @@ int tsdbRestoreInfo(STsdbRepo *pRepo) {
return
0
;
}
int32_t
tsdbLoadLastCache
(
STsdbRepo
*
pRepo
,
STable
*
pTable
,
bool
lastKey
)
{
int32_t
tsdbLoadLastCache
(
STsdbRepo
*
pRepo
,
STable
*
pTable
,
bool
force
)
{
SFSIter
fsiter
;
SReadH
readh
;
SDFileSet
*
pSet
;
bool
onlyKey
=
false
;
int
cacheLastRowTableNum
=
0
;
int
cacheLastColTableNum
=
0
;
bool
cacheLastRow
=
CACHE_LAST_ROW
(
&
(
pRepo
->
config
));
bool
cacheLastCol
=
CACHE_LAST_NULL_COLUMN
(
&
(
pRepo
->
config
));
bool
onlyKey
=
!
cacheLastRow
;
tsdbDebug
(
"tsdbLoadLastCache for %s, cacheLastRow:%d, cacheLastCol:%d"
,
pTable
->
name
->
data
,
cacheLastRow
,
cacheLastCol
);
...
...
@@ -960,22 +960,22 @@ int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable *pTable, bool lastKey) {
tsdbFreeLastColumns
(
pTable
);
}
if
(
!
cacheLastRow
&&
!
cacheLastCol
)
{
if
(
!
lastKey
)
if
(
!
cacheLastRow
&&
!
cacheLastCol
&&
!
force
)
{
return
0
;
onlyKey
=
true
;
}
cacheLastRowTableNum
=
(
cacheLastRow
&&
pTable
->
lastRow
==
NULL
)
?
1
:
0
;
cacheLastColTableNum
=
(
cacheLastCol
&&
pTable
->
lastCols
==
NULL
)
?
1
:
0
;
if
(
cacheLastRowTableNum
==
0
&&
cacheLastColTableNum
==
0
)
{
if
(
!
lastKey
)
return
0
;
onlyKey
=
true
;
if
(
force
&&
cacheLastRowTableNum
==
0
)
{
// if force update , must set 1
cacheLastRowTableNum
=
1
;
}
if
(
cacheLastRowTableNum
==
0
&&
cacheLastColTableNum
==
0
&&
!
force
)
{
return
0
;
}
if
(
tsdbInitReadH
(
&
readh
,
pRepo
)
<
0
)
{
return
-
1
;
}
...
...
@@ -1006,7 +1006,7 @@ int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable *pTable, bool lastKey) {
SBlockIdx
*
pIdx
=
readh
.
pBlkIdx
;
if
(
pIdx
&&
cacheLastRowTableNum
>
0
)
{
if
(
pIdx
&&
(
cacheLastRowTableNum
>
0
)
&&
(
pTable
->
lastRow
==
NULL
||
force
)
)
{
if
(
tsdbRestoreLastRow
(
pRepo
,
pTable
,
&
readh
,
pIdx
,
onlyKey
)
!=
0
)
{
tsdbUnLockFS
(
REPO_FS
(
pRepo
));
tsdbDestroyReadH
(
&
readh
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录