Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
10af6ae3
TDengine
项目概览
冷面1992
/
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,发现更多精彩内容 >>
提交
10af6ae3
编写于
9月 04, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]
上级
bcee3a4a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
src/util/src/tcache.c
src/util/src/tcache.c
+9
-9
未找到文件。
src/util/src/tcache.c
浏览文件 @
10af6ae3
...
...
@@ -109,7 +109,7 @@ static FORCE_INLINE void taosCacheReleaseNode(SCacheObj *pCacheObj, SCacheDataNo
static
FORCE_INLINE
void
doRemoveElemInTrashcan
(
SCacheObj
*
pCacheObj
,
STrashElem
*
pElem
)
{
if
(
pElem
->
pData
->
signature
!=
(
uint64_t
)
pElem
->
pData
)
{
u
Error
(
"key:sig:0x%"
PRIx64
" %p data has been released, ignore"
,
pElem
->
pData
->
signature
,
pElem
->
pData
);
u
Warn
(
"key:sig:0x%"
PRIx64
" %p data has been released, ignore"
,
pElem
->
pData
->
signature
,
pElem
->
pData
);
return
;
}
...
...
@@ -204,7 +204,7 @@ void *taosCachePut(SCacheObj *pCacheObj, const void *key, size_t keyLen, const v
int32_t
succ
=
taosHashPut
(
pCacheObj
->
pHashTable
,
key
,
keyLen
,
&
pNode1
,
sizeof
(
void
*
));
if
(
succ
==
0
)
{
atomic_add_fetch_64
(
&
pCacheObj
->
totalSize
,
pNode1
->
size
);
u
Error
(
"cache:%s, key:%p, %p added into cache, added:%"
PRIu64
", expire:%"
PRIu64
u
Debug
(
"cache:%s, key:%p, %p added into cache, added:%"
PRIu64
", expire:%"
PRIu64
", totalNum:%d totalSize:%"
PRId64
"bytes size:%"
PRId64
"bytes"
,
pCacheObj
->
name
,
key
,
pNode1
->
data
,
pNode1
->
addedTime
,
pNode1
->
expireTime
,
(
int32_t
)
taosHashGetSize
(
pCacheObj
->
pHashTable
),
pCacheObj
->
totalSize
,
(
int64_t
)
dataSize
);
...
...
@@ -233,7 +233,7 @@ void *taosCachePut(SCacheObj *pCacheObj, const void *key, size_t keyLen, const v
if
(
ret
==
0
)
{
atomic_add_fetch_64
(
&
pCacheObj
->
totalSize
,
pNode1
->
size
);
u
Error
(
"cache:%s, key:%p, %p added into cache, added:%"
PRIu64
", expire:%"
PRIu64
u
Debug
(
"cache:%s, key:%p, %p added into cache, added:%"
PRIu64
", expire:%"
PRIu64
", totalNum:%d totalSize:%"
PRId64
"bytes size:%"
PRId64
"bytes"
,
pCacheObj
->
name
,
key
,
pNode1
->
data
,
pNode1
->
addedTime
,
pNode1
->
expireTime
,
(
int32_t
)
taosHashGetSize
(
pCacheObj
->
pHashTable
),
pCacheObj
->
totalSize
,
(
int64_t
)
dataSize
);
...
...
@@ -353,7 +353,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
char
*
d
=
pNode
->
data
;
int32_t
ref
=
T_REF_VAL_GET
(
pNode
);
u
Error
(
"cache:%s, key:%p, %p is released, refcnt:%d, in trashcan:%d"
,
pCacheObj
->
name
,
key
,
d
,
ref
-
1
,
inTrashCan
);
u
Debug
(
"cache:%s, key:%p, %p is released, refcnt:%d, in trashcan:%d"
,
pCacheObj
->
name
,
key
,
d
,
ref
-
1
,
inTrashCan
);
/*
* If it is not referenced by other users, remove it immediately. Otherwise move this node to trashcan wait for all users
...
...
@@ -393,13 +393,13 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
// note that the remove operation can be executed only once.
if
(
ret
==
0
)
{
if
(
p
!=
pNode
)
{
u
Error
(
"cache:%s, key:%p, successfully removed a new entry:%p, refcnt:%d, prev entry:%p has been removed by "
u
Debug
(
"cache:%s, key:%p, successfully removed a new entry:%p, refcnt:%d, prev entry:%p has been removed by "
"others already"
,
pCacheObj
->
name
,
pNode
->
key
,
p
->
data
,
T_REF_VAL_GET
(
p
),
pNode
->
data
);
assert
(
p
->
pTNodeHeader
==
NULL
);
taosAddToTrash
(
pCacheObj
,
p
);
}
else
{
u
Error
(
"cache:%s, key:%p, %p successfully removed from hash table, refcnt:%d"
,
pCacheObj
->
name
,
pNode
->
key
,
u
Debug
(
"cache:%s, key:%p, %p successfully removed from hash table, refcnt:%d"
,
pCacheObj
->
name
,
pNode
->
key
,
pNode
->
data
,
ref
);
if
(
ref
>
0
)
{
assert
(
pNode
->
pTNodeHeader
==
NULL
);
...
...
@@ -409,7 +409,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
atomic_sub_fetch_64
(
&
pCacheObj
->
totalSize
,
pNode
->
size
);
int32_t
size
=
(
int32_t
)
taosHashGetSize
(
pCacheObj
->
pHashTable
);
u
Error
(
"cache:%s, key:%p, %p is destroyed from cache, size:%dbytes, num:%d size:%"
PRId64
"bytes"
,
u
Debug
(
"cache:%s, key:%p, %p is destroyed from cache, size:%dbytes, num:%d size:%"
PRId64
"bytes"
,
pCacheObj
->
name
,
pNode
->
key
,
pNode
->
data
,
pNode
->
size
,
size
,
pCacheObj
->
totalSize
);
if
(
pCacheObj
->
freeFp
)
{
...
...
@@ -420,7 +420,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
}
}
}
else
{
u
Error
(
"cache:%s, key:%p, %p has been removed from hash table by other thread
already, refcnt:%d"
,
u
Debug
(
"cache:%s, key:%p, %p has been removed from hash table by others
already, refcnt:%d"
,
pCacheObj
->
name
,
pNode
->
key
,
pNode
->
data
,
ref
);
}
}
...
...
@@ -549,7 +549,7 @@ void taosTrashCanEmpty(SCacheObj *pCacheObj, bool force) {
}
if
(
force
||
(
T_REF_VAL_GET
(
pElem
->
pData
)
==
0
))
{
uError
(
"cache:%s, key:%p, %p removed from trash. numOfElem in trash:%d"
,
pCacheObj
->
name
,
pElem
->
pData
->
key
,
pElem
->
pData
->
data
,
uError
(
"cache:%s, key:%p, %p removed from trash
can
. numOfElem in trash:%d"
,
pCacheObj
->
name
,
pElem
->
pData
->
key
,
pElem
->
pData
->
data
,
pCacheObj
->
numOfElemsInTrash
-
1
);
STrashElem
*
p
=
pElem
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录