Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
652f51fe
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
652f51fe
编写于
12月 10, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: control rpc qitem memory
上级
50b66df3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
11 deletion
+13
-11
include/util/tqueue.h
include/util/tqueue.h
+2
-2
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+1
-1
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
+2
-2
source/dnode/mgmt/mgmt_snode/src/smWorker.c
source/dnode/mgmt/mgmt_snode/src/smWorker.c
+2
-2
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+1
-1
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+1
-1
source/util/src/tqueue.c
source/util/src/tqueue.c
+4
-2
未找到文件。
include/util/tqueue.h
浏览文件 @
652f51fe
...
...
@@ -65,7 +65,7 @@ typedef struct STaosQnode {
STaosQnode
*
next
;
STaosQueue
*
queue
;
int64_t
timestamp
;
int
32
_t
dataSize
;
int
64
_t
dataSize
;
int32_t
size
;
int8_t
itype
;
int8_t
reserved
[
3
];
...
...
@@ -104,7 +104,7 @@ typedef struct STaosQall {
STaosQueue
*
taosOpenQueue
();
void
taosCloseQueue
(
STaosQueue
*
queue
);
void
taosSetQueueFp
(
STaosQueue
*
queue
,
FItem
itemFp
,
FItems
itemsFp
);
void
*
taosAllocateQitem
(
int32_t
size
,
EQItype
itype
,
int
32
_t
dataSize
);
void
*
taosAllocateQitem
(
int32_t
size
,
EQItype
itype
,
int
64
_t
dataSize
);
void
taosFreeQitem
(
void
*
pItem
);
void
taosWriteQitem
(
STaosQueue
*
queue
,
void
*
pItem
);
int32_t
taosReadQitem
(
STaosQueue
*
queue
,
void
**
ppItem
);
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
652f51fe
...
...
@@ -164,7 +164,7 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
pRpc
->
pCont
=
NULL
;
dTrace
(
"msg:%p, is created and will put into %s queue, type:%s
"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
)
);
dTrace
(
"msg:%p, is created and will put into %s queue, type:%s
len:%d"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
contLen
);
int32_t
code
=
mmPutMsgToWorker
(
pMgmt
,
pWorker
,
pMsg
);
if
(
code
!=
0
)
{
dTrace
(
"msg:%p, is freed"
,
pMsg
);
...
...
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
浏览文件 @
652f51fe
...
...
@@ -65,12 +65,12 @@ int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
switch
(
qtype
)
{
case
QUERY_QUEUE
:
dTrace
(
"msg:%p, is created and will put into qnode-query queue
"
,
pMsg
);
dTrace
(
"msg:%p, is created and will put into qnode-query queue
, len:%d"
,
pMsg
,
pRpc
->
contLen
);
taosWriteQitem
(
pMgmt
->
queryWorker
.
queue
,
pMsg
);
return
0
;
case
READ_QUEUE
:
case
FETCH_QUEUE
:
dTrace
(
"msg:%p, is created and will put into qnode-fetch queue
"
,
pMsg
);
dTrace
(
"msg:%p, is created and will put into qnode-fetch queue
, len:%d"
,
pMsg
,
pRpc
->
contLen
);
taosWriteQitem
(
pMgmt
->
fetchWorker
.
queue
,
pMsg
);
return
0
;
default:
...
...
source/dnode/mgmt/mgmt_snode/src/smWorker.c
浏览文件 @
652f51fe
...
...
@@ -139,8 +139,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
SSnode
*
pSnode
=
pMgmt
->
pSnode
;
if
(
pSnode
==
NULL
)
{
dError
(
"msg:%p failed to put into snode queue since %s, type:%s qtype:%d"
,
pMsg
,
terrstr
(),
TMSG_INFO
(
pMsg
->
msgType
),
qtype
);
dError
(
"msg:%p failed to put into snode queue since %s, type:%s qtype:%d
len:%d
"
,
pMsg
,
terrstr
(),
TMSG_INFO
(
pMsg
->
msgType
),
qtype
,
pRpc
->
contLen
);
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pRpc
->
pCont
);
pRpc
->
pCont
=
NULL
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
652f51fe
...
...
@@ -241,7 +241,7 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
}
SMsgHead
*
pHead
=
pRpc
->
pCont
;
dTrace
(
"vgId:%d, msg:%p is created, type:%s
"
,
pHead
->
vgId
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
dTrace
(
"vgId:%d, msg:%p is created, type:%s
len:%d"
,
pHead
->
vgId
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
contLen
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
652f51fe
...
...
@@ -145,7 +145,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
if
(
pMsg
==
NULL
)
goto
_OVER
;
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
dGTrace
(
"msg:%p, is created, type:%s handle:%p
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
),
pMsg
->
info
.
handle
);
dGTrace
(
"msg:%p, is created, type:%s handle:%p
len:%d"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
),
pMsg
->
info
.
handle
,
pRpc
->
contLen
);
code
=
dmProcessNodeMsg
(
pWrapper
,
pMsg
);
...
...
source/util/src/tqueue.c
浏览文件 @
652f51fe
...
...
@@ -109,7 +109,7 @@ int64_t taosQueueMemorySize(STaosQueue *queue) {
return
memOfItems
;
}
void
*
taosAllocateQitem
(
int32_t
size
,
EQItype
itype
,
int
32
_t
dataSize
)
{
void
*
taosAllocateQitem
(
int32_t
size
,
EQItype
itype
,
int
64
_t
dataSize
)
{
STaosQnode
*
pNode
=
taosMemoryCalloc
(
1
,
sizeof
(
STaosQnode
)
+
size
);
if
(
pNode
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -124,7 +124,9 @@ void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize) {
if
(
itype
==
RPC_QITEM
)
{
int64_t
alloced
=
atomic_add_fetch_64
(
&
tsRpcQueueMemoryUsed
,
size
+
dataSize
);
if
(
alloced
>
tsRpcQueueMemoryAllowed
)
{
uError
(
"failed to alloc qitem, size:%d alloc:%"
PRId64
" allowed:%"
PRId64
,
size
+
dataSize
,
alloced
,
tsRpcQueueMemoryUsed
);
uError
(
"failed to alloc qitem, size:%"
PRId64
" alloc:%"
PRId64
" allowed:%"
PRId64
,
size
+
dataSize
,
alloced
,
tsRpcQueueMemoryUsed
);
atomic_sub_fetch_64
(
&
tsRpcQueueMemoryUsed
,
size
+
dataSize
);
taosMemoryFree
(
pNode
);
terrno
=
TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE
;
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录