Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
3b2b2810
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b2b2810
编写于
6月 28, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-771] refCount while process sdbqueue
上级
a1ebea86
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
12 deletion
+34
-12
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+26
-9
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-1
tests/script/loop.sh
tests/script/loop.sh
+7
-2
未找到文件。
src/mnode/src/mnodeSdb.c
浏览文件 @
3b2b2810
...
...
@@ -551,16 +551,20 @@ static int sdbWrite(void *param, void *data, int type) {
// from app, oper is created
if
(
pOper
!=
NULL
)
{
sdbTrace
(
"record from app is disposed, version:%"
PRIu64
" result:%s"
,
pHead
->
version
,
tstrerror
(
code
));
sdbTrace
(
"record from app is disposed, table:%s action:%s record:%s version:%"
PRIu64
" result:%s"
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
,
tstrerror
(
code
));
return
code
;
}
// from wal or forward msg, oper not created, should add into hash
if
(
tsSdbObj
.
sync
!=
NULL
)
{
sdbTrace
(
"record from wal forward is disposed, version:%"
PRIu64
" confirm it"
,
pHead
->
version
);
sdbTrace
(
"record from wal forward is disposed, table:%s action:%s record:%s version:%"
PRIu64
" confirm it"
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
syncConfirmForward
(
tsSdbObj
.
sync
,
pHead
->
version
,
code
);
}
else
{
sdbTrace
(
"record from wal restore is disposed, version:%"
PRIu64
,
pHead
->
version
);
sdbTrace
(
"record from wal restore is disposed, table:%s action:%s record:%s version:%"
PRIu64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
}
if
(
action
==
SDB_ACTION_INSERT
)
{
...
...
@@ -626,9 +630,11 @@ int32_t sdbInsertRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, insert action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
);
sdbTrace
(
"app:%p:%p, table:%s record:%p:%s, insert action is add to sdb queue, "
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
sdbIncRef
(
pNewOper
->
table
,
pNewOper
->
pObj
);
taosWriteQitem
(
tsSdbWriteQueue
,
TAOS_QTYPE_RPC
,
pNewOper
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -674,9 +680,11 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, delete action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
);
sdbTrace
(
"app:%p:%p, table:%s record:%p:%s, delete action is add to sdb queue, "
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
sdbIncRef
(
pNewOper
->
table
,
pNewOper
->
pObj
);
taosWriteQitem
(
tsSdbWriteQueue
,
TAOS_QTYPE_RPC
,
pNewOper
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -722,9 +730,11 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
memcpy
(
pNewOper
,
pOper
,
sizeof
(
SSdbOper
));
if
(
pNewOper
->
pMsg
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, update action is add to sdb queue"
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
);
sdbTrace
(
"app:%p:%p, table:%s record:%p:%s, update action is add to sdb queue, "
,
pNewOper
->
pMsg
->
rpcMsg
.
ahandle
,
pNewOper
->
pMsg
,
pTable
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
}
sdbIncRef
(
pNewOper
->
table
,
pNewOper
->
pObj
);
taosWriteQitem
(
tsSdbWriteQueue
,
TAOS_QTYPE_RPC
,
pNewOper
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -943,7 +953,9 @@ static void *sdbWorkerFp(void *param) {
}
if
(
pOper
!=
NULL
&&
pOper
->
pMsg
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, will be processed in sdb queue"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
);
sdbTrace
(
"app:%p:%p, table:%s record:%p:%s version:%"
PRIu64
", will be processed in sdb queue"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
,
((
SSdbTable
*
)
pOper
->
table
)
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStr
(
pOper
->
table
,
pOper
->
pObj
),
pHead
->
version
);
}
int32_t
code
=
sdbWrite
(
pOper
,
pHead
,
type
);
...
...
@@ -959,15 +971,20 @@ static void *sdbWorkerFp(void *param) {
if
(
type
==
TAOS_QTYPE_RPC
)
{
pOper
=
(
SSdbOper
*
)
item
;
if
(
pOper
!=
NULL
&&
pOper
->
cb
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, will do callback func, index:%d"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
,
i
);
pOper
->
retCode
=
(
*
pOper
->
cb
)(
pOper
->
pMsg
,
pOper
->
retCode
);
}
if
(
pOper
!=
NULL
&&
pOper
->
pMsg
!=
NULL
)
{
sdbTrace
(
"app:%p:%p, msg is processed, result:%s"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
,
tstrerror
(
pOper
->
retCode
));
}
dnodeSendRpcMnodeWriteRsp
(
pOper
->
pMsg
,
pOper
->
retCode
);
if
(
pOper
!=
NULL
)
{
sdbDecRef
(
pOper
->
table
,
pOper
->
pObj
);
}
}
taosFreeQitem
(
item
);
}
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
3b2b2810
...
...
@@ -1420,7 +1420,7 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
continue
;
}
if
(
pTable
->
vgHash
==
NULL
)
{
mError
(
"app:%p:%p, stable:%s, no
t
vgroup exist while get stable vgroup info"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
mError
(
"app:%p:%p, stable:%s, no vgroup exist while get stable vgroup info"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
stableName
);
mnodeDecTableRef
(
pTable
);
...
...
tests/script/loop.sh
浏览文件 @
3b2b2810
...
...
@@ -11,8 +11,9 @@ set -e
CMD_NAME
=
LOOP_TIMES
=
5
SLEEP_TIME
=
0
while
getopts
"f:t:"
arg
while
getopts
"f:t:
s:
"
arg
do
case
$arg
in
f
)
...
...
@@ -21,6 +22,9 @@ do
t
)
LOOP_TIMES
=
$OPTARG
;;
s
)
SLEEP_TIME
=
$OPTARG
;;
?
)
echo
"unknow argument"
;;
...
...
@@ -29,6 +33,7 @@ done
echo
LOOP_TIMES
${
LOOP_TIMES
}
echo
CMD_NAME
${
CMD_NAME
}
echo
SLEEP_TIME
${
SLEEP_TIME
}
GREEN
=
'\033[1;32m'
GREEN_DARK
=
'\033[0;32m'
...
...
@@ -40,5 +45,5 @@ do
echo
-e
$GREEN
loop
$i
$NC
echo
-e
$GREEN
cmd
$CMD_NAME
$NC
$CMD_NAME
sleep
2
sleep
${
SLEEP_TIME
}
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录