Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ca0d858a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ca0d858a
编写于
6月 22, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: add gtid for trace
上级
54cb6b3e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
38 addition
and
31 deletion
+38
-31
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+38
-31
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
ca0d858a
...
...
@@ -30,8 +30,8 @@ static inline void vmSendRsp(SRpcMsg *pMsg, int32_t code) {
static
void
vmProcessMgmtQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, get from vnode-mgmt queue"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_MON_VM_INFO
:
...
...
@@ -48,50 +48,52 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
break
;
default:
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
dError
(
"msg:%p, not processed in vnode-mgmt queue"
,
pMsg
);
d
G
Error
(
"msg:%p, not processed in vnode-mgmt queue"
,
pMsg
);
}
if
(
IsReq
(
pMsg
))
{
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dError
(
"msg:%p, failed to process since %s"
,
pMsg
,
terrstr
());
d
G
Error
(
"msg:%p, failed to process since %s"
,
pMsg
,
terrstr
());
}
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
d
G
Trace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
void
vmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dTrace
(
"vgId:%d, msg:%p get from vnode-query queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p get from vnode-query queue"
,
pVnode
->
vgId
,
pMsg
);
int32_t
code
=
vnodeProcessQueryMsg
(
pVnode
->
pImpl
,
pMsg
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dError
(
"vgId:%d, msg:%p failed to query since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
d
G
Error
(
"vgId:%d, msg:%p failed to query since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
d
G
Trace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
void
vmProcessFetchQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dTrace
(
"vgId:%d, msg:%p get from vnode-fetch queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p get from vnode-fetch queue"
,
pVnode
->
vgId
,
pMsg
);
int32_t
code
=
vnodeProcessFetchMsg
(
pVnode
->
pImpl
,
pMsg
,
pInfo
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dError
(
"vgId:%d, msg:%p failed to fetch since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
d
G
Error
(
"vgId:%d, msg:%p failed to fetch since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
d
G
Trace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -102,16 +104,17 @@ static void vmProcessSyncQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOf
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
if
(
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
)
==
0
)
continue
;
dTrace
(
"vgId:%d, msg:%p get from vnode-sync queue"
,
pVnode
->
vgId
,
pMsg
);
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"vgId:%d, msg:%p get from vnode-sync queue"
,
pVnode
->
vgId
,
pMsg
);
int32_t
code
=
vnodeProcessSyncReq
(
pVnode
->
pImpl
,
pMsg
,
NULL
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dError
(
"vgId:%d, msg:%p failed to sync since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
d
G
Error
(
"vgId:%d, msg:%p failed to sync since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
d
G
Trace
(
"vgId:%d, msg:%p is freed, code:0x%x"
,
pVnode
->
vgId
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -123,22 +126,24 @@ static void vmProcessMergeQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
if
(
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
)
==
0
)
continue
;
dTrace
(
"vgId:%d, msg:%p get from vnode-merge queue"
,
pVnode
->
vgId
,
pMsg
);
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"vgId:%d, msg:%p get from vnode-merge queue"
,
pVnode
->
vgId
,
pMsg
);
int32_t
code
=
vnodeProcessFetchMsg
(
pVnode
->
pImpl
,
pMsg
,
pInfo
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dError
(
"vgId:%d, msg:%p failed to merge since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
d
G
Error
(
"vgId:%d, msg:%p failed to merge since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
d
G
Trace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
}
static
int32_t
vmPutMsgToQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
,
EQueueType
qtype
)
{
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
SMsgHead
*
pHead
=
pMsg
->
pCont
;
int32_t
code
=
0
;
...
...
@@ -147,7 +152,7 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
{
dError
(
"vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s"
,
pHead
->
vgId
,
pMsg
,
terrstr
(),
d
G
Error
(
"vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s"
,
pHead
->
vgId
,
pMsg
,
terrstr
(),
TMSG_INFO
(
pMsg
->
msgType
));
return
terrno
!=
0
?
terrno
:
-
1
;
}
...
...
@@ -155,23 +160,23 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
switch
(
qtype
)
{
case
QUERY_QUEUE
:
vnodePreprocessQueryMsg
(
pVnode
->
pImpl
,
pMsg
);
dTrace
(
"vgId:%d, msg:%p put into vnode-query queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p put into vnode-query queue"
,
pVnode
->
vgId
,
pMsg
);
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
break
;
case
FETCH_QUEUE
:
dTrace
(
"vgId:%d, msg:%p put into vnode-fetch queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p put into vnode-fetch queue"
,
pVnode
->
vgId
,
pMsg
);
taosWriteQitem
(
pVnode
->
pFetchQ
,
pMsg
);
break
;
case
WRITE_QUEUE
:
dTrace
(
"vgId:%d, msg:%p put into vnode-write queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p put into vnode-write queue"
,
pVnode
->
vgId
,
pMsg
);
taosWriteQitem
(
pVnode
->
pWriteQ
,
pMsg
);
break
;
case
SYNC_QUEUE
:
dTrace
(
"vgId:%d, msg:%p put into vnode-sync queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p put into vnode-sync queue"
,
pVnode
->
vgId
,
pMsg
);
taosWriteQitem
(
pVnode
->
pSyncQ
,
pMsg
);
break
;
case
APPLY_QUEUE
:
dTrace
(
"vgId:%d, msg:%p put into vnode-apply queue"
,
pVnode
->
vgId
,
pMsg
);
d
G
Trace
(
"vgId:%d, msg:%p put into vnode-apply queue"
,
pVnode
->
vgId
,
pMsg
);
taosWriteQitem
(
pVnode
->
pApplyQ
,
pMsg
);
break
;
default:
...
...
@@ -193,13 +198,15 @@ int32_t vmPutMsgToQueryQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return vmPutMsg
int32_t
vmPutMsgToFetchQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
vmPutMsgToQueue
(
pMgmt
,
pMsg
,
FETCH_QUEUE
);
}
int32_t
vmPutMsgToMgmtQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into vnode-mgmt queue"
,
pMsg
);
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, put into vnode-mgmt queue"
,
pMsg
);
taosWriteQitem
(
pMgmt
->
mgmtWorker
.
queue
,
pMsg
);
return
0
;
}
int32_t
vmPutMsgToMonitorQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into vnode-monitor queue"
,
pMsg
);
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, put into vnode-monitor queue"
,
pMsg
);
taosWriteQitem
(
pMgmt
->
monitorWorker
.
queue
,
pMsg
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录