Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5cd357eb
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5cd357eb
编写于
11月 29, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add more debug info
上级
367fac8b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
9 deletion
+14
-9
src/util/src/tref.c
src/util/src/tref.c
+14
-9
未找到文件。
src/util/src/tref.c
浏览文件 @
5cd357eb
...
@@ -172,6 +172,8 @@ int64_t taosAddRef(int rsetId, void *p)
...
@@ -172,6 +172,8 @@ int64_t taosAddRef(int rsetId, void *p)
rid
=
atomic_add_fetch_64
(
&
pSet
->
rid
,
1
);
rid
=
atomic_add_fetch_64
(
&
pSet
->
rid
,
1
);
hash
=
rid
%
pSet
->
max
;
hash
=
rid
%
pSet
->
max
;
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" try to add, hash:%d count:%d"
,
rsetId
,
p
,
rid
,
hash
,
pSet
->
count
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
pNode
->
p
=
p
;
pNode
->
p
=
p
;
...
@@ -183,7 +185,7 @@ int64_t taosAddRef(int rsetId, void *p)
...
@@ -183,7 +185,7 @@ int64_t taosAddRef(int rsetId, void *p)
if
(
pSet
->
nodeList
[
hash
])
pSet
->
nodeList
[
hash
]
->
prev
=
pNode
;
if
(
pSet
->
nodeList
[
hash
])
pSet
->
nodeList
[
hash
]
->
prev
=
pNode
;
pSet
->
nodeList
[
hash
]
=
pNode
;
pSet
->
nodeList
[
hash
]
=
pNode
;
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is added,
count:%d"
,
rsetId
,
p
,
rid
,
pSet
->
count
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is added,
hash:%d, count:%d"
,
rsetId
,
p
,
rid
,
hash
,
pSet
->
count
);
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
...
@@ -225,6 +227,7 @@ void *taosAcquireRef(int rsetId, int64_t rid)
...
@@ -225,6 +227,7 @@ void *taosAcquireRef(int rsetId, int64_t rid)
}
}
hash
=
rid
%
pSet
->
max
;
hash
=
rid
%
pSet
->
max
;
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" try to acquire, hash:%d count:%d"
,
rsetId
,
p
,
rid
,
hash
,
pSet
->
count
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
pNode
=
pSet
->
nodeList
[
hash
];
pNode
=
pSet
->
nodeList
[
hash
];
...
@@ -241,14 +244,14 @@ void *taosAcquireRef(int rsetId, int64_t rid)
...
@@ -241,14 +244,14 @@ void *taosAcquireRef(int rsetId, int64_t rid)
if
(
pNode
->
removed
==
0
)
{
if
(
pNode
->
removed
==
0
)
{
pNode
->
count
++
;
pNode
->
count
++
;
p
=
pNode
->
p
;
p
=
pNode
->
p
;
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is acquired
"
,
rsetId
,
pNode
->
p
,
rid
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is acquired
, hash:%d"
,
rsetId
,
pNode
->
p
,
rid
,
hash
);
}
else
{
}
else
{
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is already removed, failed to acquire
"
,
rsetId
,
pNode
->
p
,
rid
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is already removed, failed to acquire
, hash:%d"
,
rsetId
,
pNode
->
p
,
rid
,
hash
);
}
}
}
else
{
}
else
{
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
uTrace
(
"rsetId:%d rid:%"
PRId64
" is not there, failed to acquire
"
,
rsetId
,
rid
);
uTrace
(
"rsetId:%d rid:%"
PRId64
" is not there, failed to acquire
, hash:%d"
,
rsetId
,
rid
,
hash
);
}
}
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
...
@@ -292,6 +295,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
...
@@ -292,6 +295,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
int
hash
=
0
;
int
hash
=
0
;
if
(
rid
>
0
)
{
if
(
rid
>
0
)
{
hash
=
rid
%
pSet
->
max
;
hash
=
rid
%
pSet
->
max
;
uTrace
(
"rsetId:%d rid:%"
PRId64
" try to iterate, hash:%d"
,
rsetId
,
rid
,
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
pNode
=
pSet
->
nodeList
[
hash
];
pNode
=
pSet
->
nodeList
[
hash
];
...
@@ -301,7 +305,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
...
@@ -301,7 +305,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
}
}
if
(
pNode
==
NULL
)
{
if
(
pNode
==
NULL
)
{
uError
(
"rsetId:%d rid:%"
PRId64
" not there, quit
"
,
rsetId
,
rid
);
uError
(
"rsetId:%d rid:%"
PRId64
" not there, quit
, hash:%d"
,
rsetId
,
rid
,
hash
);
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
return
NULL
;
return
NULL
;
...
@@ -329,7 +333,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
...
@@ -329,7 +333,7 @@ void *taosIterateRef(int rsetId, int64_t rid) {
pNode
->
count
++
;
// acquire it
pNode
->
count
++
;
// acquire it
newP
=
pNode
->
p
;
newP
=
pNode
->
p
;
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
taosUnlockList
(
pSet
->
lockedBy
+
hash
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is returned
"
,
rsetId
,
newP
,
rid
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
" is returned
, hash:%d"
,
rsetId
,
newP
,
rid
,
hash
);
}
else
{
}
else
{
uTrace
(
"rsetId:%d the list is over"
,
rsetId
);
uTrace
(
"rsetId:%d the list is over"
,
rsetId
);
}
}
...
@@ -399,6 +403,7 @@ static int taosDecRefCount(int rsetId, int64_t rid, int remove) {
...
@@ -399,6 +403,7 @@ static int taosDecRefCount(int rsetId, int64_t rid, int remove) {
}
}
hash
=
rid
%
pSet
->
max
;
hash
=
rid
%
pSet
->
max
;
uTrace
(
"rsetId:%d rid:%"
PRId64
" try to release, hash:%d"
,
rsetId
,
rid
,
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
taosLockList
(
pSet
->
lockedBy
+
hash
);
pNode
=
pSet
->
nodeList
[
hash
];
pNode
=
pSet
->
nodeList
[
hash
];
...
@@ -426,14 +431,14 @@ static int taosDecRefCount(int rsetId, int64_t rid, int remove) {
...
@@ -426,14 +431,14 @@ static int taosDecRefCount(int rsetId, int64_t rid, int remove) {
(
*
pSet
->
fp
)(
pNode
->
p
);
(
*
pSet
->
fp
)(
pNode
->
p
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
"is removed,
count:%d, free mem: %p"
,
rsetId
,
pNode
->
p
,
rid
,
pSet
->
count
,
pNode
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
"is removed,
hash:%d count:%d, free mem: %p"
,
rsetId
,
pNode
->
p
,
rid
,
hash
,
pSet
->
count
,
pNode
);
free
(
pNode
);
free
(
pNode
);
released
=
1
;
released
=
1
;
}
else
{
}
else
{
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
"is released,
count:%d"
,
rsetId
,
pNode
->
p
,
rid
,
pNode
->
count
);
uTrace
(
"rsetId:%d p:%p rid:%"
PRId64
"is released,
hash:%d count:%d"
,
rsetId
,
pNode
->
p
,
rid
,
hash
,
pNode
->
count
);
}
}
}
else
{
}
else
{
uTrace
(
"rsetId:%d rid:%"
PRId64
" is not there, failed to release/remove
"
,
rsetId
,
rid
);
uTrace
(
"rsetId:%d rid:%"
PRId64
" is not there, failed to release/remove
, hash:%d"
,
rsetId
,
rid
,
hash
);
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
terrno
=
TSDB_CODE_REF_NOT_EXIST
;
code
=
-
1
;
code
=
-
1
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录