Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b892b1fd
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看板
提交
b892b1fd
编写于
5月 17, 2023
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cache/flag: fix cache flag compiling issue
上级
e95613ec
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
29 deletion
+29
-29
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+0
-4
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+5
-1
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+24
-24
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
b892b1fd
...
...
@@ -305,10 +305,6 @@ void tsdbUntakeReadSnap(STsdbReader *pReader, STsdbReadSnap *pSnap, bool proa
// tsdbMerge.c ==============================================================================================
int32_t
tsdbMerge
(
STsdb
*
pTsdb
);
#define TSDB_CACHE_NO(c) ((c).cacheLast == 0)
#define TSDB_CACHE_LAST_ROW(c) (((c).cacheLast & 1) > 0)
#define TSDB_CACHE_LAST(c) (((c).cacheLast & 2) > 0)
// tsdbDiskData ==============================================================================================
int32_t
tDiskDataBuilderCreate
(
SDiskDataBuilder
**
ppBuilder
);
void
*
tDiskDataBuilderDestroy
(
SDiskDataBuilder
*
pBuilder
);
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
b892b1fd
...
...
@@ -197,7 +197,7 @@ void tqClose(STQ*);
int
tqPushMsg
(
STQ
*
,
void
*
msg
,
int32_t
msgLen
,
tmsg_t
msgType
,
int64_t
ver
);
int
tqRegisterPushHandle
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
);
int
tqUnregisterPushHandle
(
STQ
*
pTq
,
void
*
pHandle
);
int
tqStartStreamTasks
(
STQ
*
pTq
);
// restore all stream tasks after vnode launching completed.
int
tqStartStreamTasks
(
STQ
*
pTq
);
// restore all stream tasks after vnode launching completed.
int
tqCommit
(
STQ
*
);
int32_t
tqUpdateTbUidList
(
STQ
*
pTq
,
const
SArray
*
tbUidList
,
bool
isAdd
);
...
...
@@ -405,6 +405,10 @@ struct SVnode {
#define VND_IS_RSMA(v) ((v)->config.isRsma == 1)
#define VND_IS_TSMA(v) ((v)->config.isTsma == 1)
#define TSDB_CACHE_NO(c) ((c).cacheLast == 0)
#define TSDB_CACHE_LAST_ROW(c) (((c).cacheLast & 1) > 0)
#define TSDB_CACHE_LAST(c) (((c).cacheLast & 2) > 0)
struct
STbUidStore
{
tb_uid_t
suid
;
SArray
*
tbUids
;
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
b892b1fd
...
...
@@ -208,10 +208,26 @@ static void tsdbCloseRocksCache(STsdb *pTsdb) {
taosMemoryFree
(
pTsdb
->
rCache
.
pTSchema
);
}
static
void
rocksMayWrite
(
STsdb
*
pTsdb
,
bool
force
)
{
rocksdb_writebatch_t
*
wb
=
pTsdb
->
rCache
.
writebatch
;
if
(
force
||
rocksdb_writebatch_count
(
wb
)
>=
1024
)
{
char
*
err
=
NULL
;
rocksdb_write
(
pTsdb
->
rCache
.
db
,
pTsdb
->
rCache
.
writeoptions
,
wb
,
&
err
);
if
(
NULL
!=
err
)
{
tsdbError
(
"vgId:%d, %s failed at line %d since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
,
__LINE__
,
err
);
rocksdb_free
(
err
);
}
rocksdb_writebatch_clear
(
wb
);
}
}
int32_t
tsdbCacheCommit
(
STsdb
*
pTsdb
)
{
int32_t
code
=
0
;
char
*
err
=
NULL
;
rocksMayWrite
(
pTsdb
,
true
);
rocksdb_flush
(
pTsdb
->
rCache
.
db
,
pTsdb
->
rCache
.
flushoptions
,
&
err
);
if
(
NULL
!=
err
)
{
tsdbError
(
"vgId:%d, %s failed at line %d since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
,
__LINE__
,
err
);
...
...
@@ -281,22 +297,6 @@ static SLastCol *tsdbCacheLookup(STsdb *pTsdb, tb_uid_t uid, int16_t cid, int8_t
return
pLastCol
;
}
static
void
rocksMayWrite
(
STsdb
*
pTsdb
)
{
rocksdb_writebatch_t
*
wb
=
pTsdb
->
rCache
.
writebatch
;
int
count
=
rocksdb_writebatch_count
(
wb
);
if
(
count
>=
1024
)
{
char
*
err
=
NULL
;
rocksdb_write
(
pTsdb
->
rCache
.
db
,
pTsdb
->
rCache
.
writeoptions
,
wb
,
&
err
);
if
(
NULL
!=
err
)
{
tsdbError
(
"vgId:%d, %s failed at line %d since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
,
__LINE__
,
err
);
rocksdb_free
(
err
);
}
rocksdb_writebatch_clear
(
wb
);
}
}
int32_t
tsdbCacheUpdate
(
STsdb
*
pTsdb
,
tb_uid_t
suid
,
tb_uid_t
uid
,
TSDBROW
*
pRow
)
{
int32_t
code
=
0
;
...
...
@@ -398,7 +398,7 @@ int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSDBROW *pRow
taosMemoryFree
(
values_list
);
taosMemoryFree
(
values_list_sizes
);
rocksMayWrite
(
pTsdb
);
rocksMayWrite
(
pTsdb
,
false
);
taosThreadMutexUnlock
(
&
pTsdb
->
rCache
.
rMutex
);
_exit:
...
...
@@ -507,7 +507,7 @@ int32_t tsdbCacheGetSlow(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCacheR
}
if
(
wb
)
{
rocksMayWrite
(
pTsdb
);
rocksMayWrite
(
pTsdb
,
false
);
}
taosThreadMutexUnlock
(
&
pTsdb
->
rCache
.
rMutex
);
...
...
@@ -575,7 +575,7 @@ static SLastCol *tsdbCacheLoadCol(STsdb *pTsdb, SCacheRowsReader *pr, int16_t sl
}
if
(
wb
)
{
rocksMayWrite
(
pTsdb
);
rocksMayWrite
(
pTsdb
,
false
);
}
taosThreadMutexUnlock
(
&
pTsdb
->
rCache
.
rMutex
);
...
...
@@ -672,7 +672,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
}
if
(
wb
)
{
rocksMayWrite
(
pTsdb
);
rocksMayWrite
(
pTsdb
,
false
);
}
taosArrayDestroy
(
pTmpColArray
);
...
...
@@ -734,10 +734,10 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
code
=
-
1
;
}
SLastCol
lastCol
=
*
pLastCol
;
reallocVarData
(
&
lastCol
.
colVal
);
//
SLastCol lastCol = *pLastCol;
//
reallocVarData(&lastCol.colVal);
taosArraySet
(
pLastArray
,
idxKey
->
idx
,
&
l
astCol
);
taosArraySet
(
pLastArray
,
idxKey
->
idx
,
pL
astCol
);
taosArrayRemove
(
remainCols
,
j
);
taosMemoryFree
(
values_list
[
i
]);
...
...
@@ -941,7 +941,7 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
taosMemoryFree
(
values_list
);
taosMemoryFree
(
values_list_sizes
);
rocksMayWrite
(
pTsdb
);
rocksMayWrite
(
pTsdb
,
false
);
taosThreadMutexUnlock
(
&
pTsdb
->
rCache
.
rMutex
);
_exit:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录