Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
b98ed27f
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b98ed27f
编写于
9月 05, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1315]
上级
0f954399
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
8 deletion
+10
-8
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-0
src/util/inc/tcache.h
src/util/inc/tcache.h
+1
-1
src/util/src/tcache.c
src/util/src/tcache.c
+7
-7
未找到文件。
src/client/src/tscUtil.c
浏览文件 @
b98ed27f
...
...
@@ -718,6 +718,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, SArray* pTableDataBlockList) {
return
TSDB_CODE_SUCCESS
;
}
// TODO: all subqueries should be freed correctly before close this connection.
void
tscCloseTscObj
(
STscObj
*
pObj
)
{
assert
(
pObj
!=
NULL
);
...
...
@@ -727,6 +728,7 @@ void tscCloseTscObj(STscObj* pObj) {
if
(
pObj
->
pDnodeConn
!=
NULL
)
{
rpcClose
(
pObj
->
pDnodeConn
);
pObj
->
pDnodeConn
=
NULL
;
}
tscDebug
(
"%p DB connection is closed, dnodeConn:%p"
,
pObj
,
pObj
->
pDnodeConn
);
...
...
src/util/inc/tcache.h
浏览文件 @
b98ed27f
...
...
@@ -42,7 +42,7 @@ typedef struct SCacheDataNode {
uint64_t
signature
;
struct
STrashElem
*
pTNodeHeader
;
// point to trash node head
uint16_t
keySize
:
15
;
// max key size: 32kb
bool
inTrash
C
an
:
1
;
// denote if it is in trash or not
bool
inTrash
c
an
:
1
;
// denote if it is in trash or not
uint32_t
size
;
// allocated size for current SCacheDataNode
T_REF_DECLARE
()
char
*
key
;
...
...
src/util/src/tcache.c
浏览文件 @
b98ed27f
...
...
@@ -337,9 +337,9 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
*
data
=
NULL
;
// note: extend lifespan before dec ref count
bool
inTrash
Can
=
pNode
->
inTrashC
an
;
bool
inTrash
can
=
pNode
->
inTrashc
an
;
if
(
pCacheObj
->
extendLifespan
&&
(
!
inTrash
C
an
)
&&
(
!
_remove
))
{
if
(
pCacheObj
->
extendLifespan
&&
(
!
inTrash
c
an
)
&&
(
!
_remove
))
{
atomic_store_64
(
&
pNode
->
expireTime
,
pNode
->
lifespan
+
taosGetTimestampMs
());
uDebug
(
"cache:%s data:%p extend expire time: %"
PRId64
,
pCacheObj
->
name
,
pNode
->
data
,
pNode
->
expireTime
);
}
...
...
@@ -350,7 +350,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
char
*
d
=
pNode
->
data
;
int32_t
ref
=
T_REF_VAL_GET
(
pNode
);
uDebug
(
"cache:%s, key:%p, %p is released, refcnt:%d, in trashcan:%d"
,
pCacheObj
->
name
,
key
,
d
,
ref
-
1
,
inTrash
C
an
);
uDebug
(
"cache:%s, key:%p, %p is released, refcnt:%d, in trashcan:%d"
,
pCacheObj
->
name
,
key
,
d
,
ref
-
1
,
inTrash
c
an
);
/*
* If it is not referenced by other users, remove it immediately. Otherwise move this node to trashcan wait for all users
...
...
@@ -359,7 +359,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
* NOTE: previous ref is 0, and current ref is still 0, remove it. If previous is not 0, there is another thread
* that tries to do the same thing.
*/
if
(
inTrash
C
an
)
{
if
(
inTrash
c
an
)
{
ref
=
T_REF_VAL_GET
(
pNode
);
if
(
ref
==
1
)
{
...
...
@@ -428,7 +428,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
char
*
p
=
pNode
->
data
;
int32_t
ref
=
T_REF_DEC
(
pNode
);
uDebug
(
"cache:%s, key:%p, %p released, refcnt:%d, data in trashcan:%d"
,
pCacheObj
->
name
,
key
,
p
,
ref
,
inTrash
C
an
);
uDebug
(
"cache:%s, key:%p, %p released, refcnt:%d, data in trashcan:%d"
,
pCacheObj
->
name
,
key
,
p
,
ref
,
inTrash
c
an
);
}
}
...
...
@@ -499,7 +499,7 @@ SCacheDataNode *taosCreateCacheNode(const char *key, size_t keyLen, const char *
}
void
taosAddToTrash
(
SCacheObj
*
pCacheObj
,
SCacheDataNode
*
pNode
)
{
if
(
pNode
->
inTrash
C
an
)
{
/* node is already in trash */
if
(
pNode
->
inTrash
c
an
)
{
/* node is already in trash */
assert
(
pNode
->
pTNodeHeader
!=
NULL
&&
pNode
->
pTNodeHeader
->
pData
==
pNode
);
return
;
}
...
...
@@ -507,7 +507,7 @@ void taosAddToTrash(SCacheObj *pCacheObj, SCacheDataNode *pNode) {
STrashElem
*
pElem
=
calloc
(
1
,
sizeof
(
STrashElem
));
pElem
->
pData
=
pNode
;
pElem
->
prev
=
NULL
;
pNode
->
inTrash
C
an
=
true
;
pNode
->
inTrash
c
an
=
true
;
pNode
->
pTNodeHeader
=
pElem
;
__cache_wr_lock
(
pCacheObj
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录