Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
53b4c06d
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看板
提交
53b4c06d
编写于
1月 11, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add msg queue
上级
ab3378e0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
15 deletion
+31
-15
include/dnode/vnode/vnode.h
include/dnode/vnode/vnode.h
+1
-1
source/dnode/mgmt/impl/inc/dndVnodes.h
source/dnode/mgmt/impl/inc/dndVnodes.h
+2
-0
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+20
-6
source/dnode/mgmt/impl/src/dnode.c
source/dnode/mgmt/impl/src/dnode.c
+1
-3
source/dnode/vnode/impl/inc/vnodeDef.h
source/dnode/vnode/impl/inc/vnodeDef.h
+1
-1
source/dnode/vnode/impl/src/vnodeMgr.c
source/dnode/vnode/impl/src/vnodeMgr.c
+6
-4
未找到文件。
include/dnode/vnode/vnode.h
浏览文件 @
53b4c06d
...
@@ -32,7 +32,7 @@ extern "C" {
...
@@ -32,7 +32,7 @@ extern "C" {
/* ------------------------ TYPES EXPOSED ------------------------ */
/* ------------------------ TYPES EXPOSED ------------------------ */
typedef
struct
SVnode
SVnode
;
typedef
struct
SVnode
SVnode
;
typedef
struct
SDnode
SDnode
;
typedef
struct
SDnode
SDnode
;
typedef
void
(
*
PutReqToVQueryQFp
)(
SDnode
*
pDnode
,
struct
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
PutReqToVQueryQFp
)(
SDnode
*
pDnode
,
struct
SRpcMsg
*
pReq
);
typedef
struct
SVnodeCfg
{
typedef
struct
SVnodeCfg
{
int32_t
vgId
;
int32_t
vgId
;
...
...
source/dnode/mgmt/impl/inc/dndVnodes.h
浏览文件 @
53b4c06d
...
@@ -36,6 +36,8 @@ int32_t dndProcessAuthVnodeReq(SDnode *pDnode, SRpcMsg *pReq);
...
@@ -36,6 +36,8 @@ int32_t dndProcessAuthVnodeReq(SDnode *pDnode, SRpcMsg *pReq);
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndPutReqToVQueryQ
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
53b4c06d
...
@@ -802,7 +802,7 @@ static void dndProcessVnodeSyncQueue(SVnodeObj *pVnode, STaosQall *qall, int32_t
...
@@ -802,7 +802,7 @@ static void dndProcessVnodeSyncQueue(SVnodeObj *pVnode, STaosQall *qall, int32_t
}
}
}
}
static
int32_t
dndWriteRpcMsgToVnodeQueue
(
STaosQueue
*
pQueue
,
SRpcMsg
*
pRpcMsg
)
{
static
int32_t
dndWriteRpcMsgToVnodeQueue
(
STaosQueue
*
pQueue
,
SRpcMsg
*
pRpcMsg
,
bool
sendRsp
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
if
(
pQueue
==
NULL
)
{
if
(
pQueue
==
NULL
)
{
...
@@ -819,13 +819,15 @@ static int32_t dndWriteRpcMsgToVnodeQueue(STaosQueue *pQueue, SRpcMsg *pRpcMsg)
...
@@ -819,13 +819,15 @@ static int32_t dndWriteRpcMsgToVnodeQueue(STaosQueue *pQueue, SRpcMsg *pRpcMsg)
}
}
}
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
&&
sendRsp
)
{
if
(
pRpcMsg
->
msgType
&
1u
)
{
if
(
pRpcMsg
->
msgType
&
1u
)
{
SRpcMsg
rsp
=
{.
handle
=
pRpcMsg
->
handle
,
.
code
=
code
};
SRpcMsg
rsp
=
{.
handle
=
pRpcMsg
->
handle
,
.
code
=
code
};
rpcSendResponse
(
&
rsp
);
rpcSendResponse
(
&
rsp
);
}
}
rpcFreeCont
(
pRpcMsg
->
pCont
);
rpcFreeCont
(
pRpcMsg
->
pCont
);
}
}
return
code
;
}
}
static
SVnodeObj
*
dndAcquireVnodeFromMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
static
SVnodeObj
*
dndAcquireVnodeFromMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
...
@@ -848,7 +850,7 @@ static SVnodeObj *dndAcquireVnodeFromMsg(SDnode *pDnode, SRpcMsg *pMsg) {
...
@@ -848,7 +850,7 @@ static SVnodeObj *dndAcquireVnodeFromMsg(SDnode *pDnode, SRpcMsg *pMsg) {
void
dndProcessVnodeWriteMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
void
dndProcessVnodeWriteMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pWriteQ
,
pMsg
);
(
void
)
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pWriteQ
,
pMsg
,
true
);
dndReleaseVnode
(
pDnode
,
pVnode
);
dndReleaseVnode
(
pDnode
,
pVnode
);
}
}
}
}
...
@@ -856,7 +858,7 @@ void dndProcessVnodeWriteMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
...
@@ -856,7 +858,7 @@ void dndProcessVnodeWriteMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
void
dndProcessVnodeSyncMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
void
dndProcessVnodeSyncMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pSyncQ
,
pMsg
);
(
void
)
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pSyncQ
,
pMsg
,
true
);
dndReleaseVnode
(
pDnode
,
pVnode
);
dndReleaseVnode
(
pDnode
,
pVnode
);
}
}
}
}
...
@@ -864,7 +866,7 @@ void dndProcessVnodeSyncMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
...
@@ -864,7 +866,7 @@ void dndProcessVnodeSyncMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
void
dndProcessVnodeQueryMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
void
dndProcessVnodeQueryMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pQueryQ
,
pMsg
);
(
void
)
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pQueryQ
,
pMsg
,
true
);
dndReleaseVnode
(
pDnode
,
pVnode
);
dndReleaseVnode
(
pDnode
,
pVnode
);
}
}
}
}
...
@@ -872,11 +874,23 @@ void dndProcessVnodeQueryMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
...
@@ -872,11 +874,23 @@ void dndProcessVnodeQueryMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
void
dndProcessVnodeFetchMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
void
dndProcessVnodeFetchMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
SVnodeObj
*
pVnode
=
dndAcquireVnodeFromMsg
(
pDnode
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
if
(
pVnode
!=
NULL
)
{
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pFetchQ
,
pMsg
);
(
void
)
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pFetchQ
,
pMsg
,
true
);
dndReleaseVnode
(
pDnode
,
pVnode
);
dndReleaseVnode
(
pDnode
,
pVnode
);
}
}
}
}
int32_t
dndPutReqToVQueryQ
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
SMsgHead
*
pHead
=
pMsg
->
pCont
;
// pHead->vgId = htonl(pHead->vgId);
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
return
-
1
;
int32_t
code
=
dndWriteRpcMsgToVnodeQueue
(
pVnode
->
pFetchQ
,
pMsg
,
false
);
dndReleaseVnode
(
pDnode
,
pVnode
);
return
code
;
}
static
int32_t
dndPutMsgIntoVnodeApplyQueue
(
SDnode
*
pDnode
,
int32_t
vgId
,
SRpcMsg
*
pMsg
)
{
static
int32_t
dndPutMsgIntoVnodeApplyQueue
(
SDnode
*
pDnode
,
int32_t
vgId
,
SRpcMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
if
(
pVnode
==
NULL
)
return
-
1
;
if
(
pVnode
==
NULL
)
return
-
1
;
...
...
source/dnode/mgmt/impl/src/dnode.c
浏览文件 @
53b4c06d
...
@@ -153,8 +153,6 @@ static void dndCleanupEnv(SDnode *pDnode) {
...
@@ -153,8 +153,6 @@ static void dndCleanupEnv(SDnode *pDnode) {
taosStopCacheRefreshWorker
();
taosStopCacheRefreshWorker
();
}
}
static
void
dndPutMsgToVQueryQ
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
)
{
dndProcessVnodeQueryMsg
(
pDnode
,
pRpcMsg
,
NULL
);
}
SDnode
*
dndInit
(
SDnodeOpt
*
pOption
)
{
SDnode
*
dndInit
(
SDnodeOpt
*
pOption
)
{
taosIgnSIGPIPE
();
taosIgnSIGPIPE
();
taosBlockSIGPIPE
();
taosBlockSIGPIPE
();
...
@@ -204,7 +202,7 @@ SDnode *dndInit(SDnodeOpt *pOption) {
...
@@ -204,7 +202,7 @@ SDnode *dndInit(SDnodeOpt *pOption) {
.
locale
=
pDnode
->
opt
.
locale
,
.
locale
=
pDnode
->
opt
.
locale
,
.
charset
=
pDnode
->
opt
.
charset
,
.
charset
=
pDnode
->
opt
.
charset
,
.
nthreads
=
pDnode
->
opt
.
numOfCommitThreads
,
.
nthreads
=
pDnode
->
opt
.
numOfCommitThreads
,
.
putReqToVQueryQFp
=
dndPut
Msg
ToVQueryQ
,
.
putReqToVQueryQFp
=
dndPut
Req
ToVQueryQ
,
};
};
if
(
vnodeInit
(
&
vnodeOpt
)
!=
0
)
{
if
(
vnodeInit
(
&
vnodeOpt
)
!=
0
)
{
dError
(
"failed to init vnode env"
);
dError
(
"failed to init vnode env"
);
...
...
source/dnode/vnode/impl/inc/vnodeDef.h
浏览文件 @
53b4c06d
...
@@ -82,7 +82,7 @@ struct SVnode {
...
@@ -82,7 +82,7 @@ struct SVnode {
int
vnodeScheduleTask
(
SVnodeTask
*
task
);
int
vnodeScheduleTask
(
SVnodeTask
*
task
);
void
vnodePutReqToVQueryQ
(
SVnode
*
pVnode
,
struct
SRpcMsg
*
pReq
);
int32_t
vnodePutReqToVQueryQ
(
SVnode
*
pVnode
,
struct
SRpcMsg
*
pReq
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/vnode/impl/src/vnodeMgr.c
浏览文件 @
53b4c06d
...
@@ -90,10 +90,12 @@ int vnodeScheduleTask(SVnodeTask* pTask) {
...
@@ -90,10 +90,12 @@ int vnodeScheduleTask(SVnodeTask* pTask) {
return
0
;
return
0
;
}
}
void
vnodePutReqToVQueryQ
(
SVnode
*
pVnode
,
struct
SRpcMsg
*
pReq
)
{
int32_t
vnodePutReqToVQueryQ
(
SVnode
*
pVnode
,
struct
SRpcMsg
*
pReq
)
{
assert
(
vnodeMgr
.
putReqToVQueryQFp
);
if
(
pVnode
==
NULL
||
pVnode
->
pDnode
==
NULL
||
vnodeMgr
.
putReqToVQueryQFp
==
NULL
)
{
assert
(
pVnode
->
pDnode
);
terrno
=
TSDB_CODE_VND_APP_ERROR
;
(
*
vnodeMgr
.
putReqToVQueryQFp
)(
pVnode
->
pDnode
,
pReq
);
return
-
1
;
}
return
(
*
vnodeMgr
.
putReqToVQueryQFp
)(
pVnode
->
pDnode
,
pReq
);
}
}
/* ------------------------ STATIC METHODS ------------------------ */
/* ------------------------ STATIC METHODS ------------------------ */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录