Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
182a5ee4
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看板
提交
182a5ee4
编写于
3月 29, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
681dbc01
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
41 addition
and
33 deletion
+41
-33
include/common/tmsgcb.h
include/common/tmsgcb.h
+9
-5
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+9
-9
include/util/tprocess.h
include/util/tprocess.h
+2
-2
source/common/src/tmsgcb.c
source/common/src/tmsgcb.c
+6
-2
source/dnode/mgmt/container/inc/dnd.h
source/dnode/mgmt/container/inc/dnd.h
+2
-2
source/dnode/mgmt/container/inc/dndInt.h
source/dnode/mgmt/container/inc/dndInt.h
+1
-1
source/dnode/mgmt/container/src/dndTransport.c
source/dnode/mgmt/container/src/dndTransport.c
+4
-4
source/dnode/mgmt/dnode/inc/dm.h
source/dnode/mgmt/dnode/inc/dm.h
+1
-1
source/dnode/mgmt/dnode/src/dmInt.c
source/dnode/mgmt/dnode/src/dmInt.c
+1
-1
source/util/src/tprocess.c
source/util/src/tprocess.c
+6
-6
未找到文件。
include/common/tmsgcb.h
浏览文件 @
182a5ee4
...
...
@@ -25,6 +25,7 @@ extern "C" {
typedef
struct
SRpcMsg
SRpcMsg
;
typedef
struct
SEpSet
SEpSet
;
typedef
struct
SMgmtWrapper
SMgmtWrapper
;
typedef
enum
{
QUERY_QUEUE
,
FETCH_QUEUE
,
...
...
@@ -38,10 +39,11 @@ typedef enum {
typedef
int32_t
(
*
PutToQueueFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
GetQueueSizeFp
)(
SMgmtWrapper
*
pWrapper
,
int32_t
vgId
,
EQueueType
qtype
);
typedef
int32_t
(
*
SendReqFp
)(
SMgmtWrapper
*
pWrapper
,
SEpSet
*
epSet
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
SendReqFp
)(
SMgmtWrapper
*
pWrapper
,
const
SEpSet
*
epSet
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
SendMnodeReqFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
void
(
*
SendRspFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
);
typedef
void
(
*
RegisterBrokenLinkArgFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
typedef
void
(
*
SendRspFp
)(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
typedef
void
(
*
RegisterBrokenLinkArgFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
typedef
void
(
*
ReleaseHandleFp
)(
SMgmtWrapper
*
pWrapper
,
void
*
handle
,
int8_t
type
);
typedef
struct
{
SMgmtWrapper
*
pWrapper
;
...
...
@@ -51,14 +53,16 @@ typedef struct {
SendMnodeReqFp
sendMnodeReqFp
;
SendRspFp
sendRspFp
;
RegisterBrokenLinkArgFp
registerBrokenLinkArgFp
;
ReleaseHandleFp
releaseHandleFp
;
}
SMsgCb
;
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
pMsgCb
,
EQueueType
qtype
,
SRpcMsg
*
pReq
);
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
pMsgCb
,
int32_t
vgId
,
EQueueType
qtype
);
int32_t
tmsgSendReq
(
const
SMsgCb
*
pMsgCb
,
SEpSet
*
epSet
,
SRpcMsg
*
pReq
);
int32_t
tmsgSendReq
(
const
SMsgCb
*
pMsgCb
,
const
SEpSet
*
epSet
,
SRpcMsg
*
pReq
);
int32_t
tmsgSendMnodeReq
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pReq
);
void
tmsgSendRsp
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pRsp
);
void
tmsgSendRsp
(
const
SMsgCb
*
pMsgCb
,
const
SRpcMsg
*
pRsp
);
void
tmsgRegisterBrokenLinkArg
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pMsg
);
void
tmsgReleaseHandle
(
const
SMsgCb
*
pMsgCb
,
void
*
handle
,
int8_t
type
);
#ifdef __cplusplus
}
...
...
include/libs/transport/trpc.h
浏览文件 @
182a5ee4
...
...
@@ -107,20 +107,20 @@ void rpcClose(void *);
void
*
rpcMallocCont
(
int
contLen
);
void
rpcFreeCont
(
void
*
pCont
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
contLen
);
void
rpcSendRequest
(
void
*
thandle
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
);
void
rpcSendRequestWithCtx
(
void
*
thandle
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
,
SRpcCtx
*
ctx
);
// Because taosd supports multi-process mode
// These functions should not be used on the server side
// Please use tmsg<xx> functions, which are defined in tmsgcb.h
void
rpcSendRequest
(
void
*
thandle
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
);
void
rpcSendResponse
(
const
SRpcMsg
*
pMsg
);
void
rpcRegisterBrokenLinkArg
(
SRpcMsg
*
msg
);
void
rpcReleaseHandle
(
void
*
handle
,
int8_t
type
);
// just release client conn to rpc instance, no close sock
// These functions will not be called in the child process
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SEpSet
*
pEpSet
);
void
rpcSendRequestWithCtx
(
void
*
thandle
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
,
SRpcCtx
*
ctx
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
void
rpcCancelRequest
(
int64_t
rid
);
void
rpcRegisterBrokenLinkArg
(
SRpcMsg
*
msg
);
// just release client conn to rpc instance, no close sock
void
rpcReleaseHandle
(
void
*
handle
,
int8_t
type
);
//
void
rpcRefHandle
(
void
*
handle
,
int8_t
type
);
void
rpcUnrefHandle
(
void
*
handle
,
int8_t
type
);
#ifdef __cplusplus
}
...
...
include/util/tprocess.h
浏览文件 @
182a5ee4
...
...
@@ -55,9 +55,9 @@ int32_t taosProcRun(SProcObj *pProc);
void
taosProcStop
(
SProcObj
*
pProc
);
bool
taosProcIsChild
(
SProcObj
*
pProc
);
int32_t
taosProcChildId
(
SProcObj
*
pProc
);
int32_t
taosProcPutToChildQ
(
SProcObj
*
pProc
,
void
*
pHead
,
int16_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
,
int32_t
taosProcPutToChildQ
(
SProcObj
*
pProc
,
const
void
*
pHead
,
int16_t
headLen
,
const
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
ftype
);
int32_t
taosProcPutToParentQ
(
SProcObj
*
pProc
,
void
*
pHead
,
int16_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
,
int32_t
taosProcPutToParentQ
(
SProcObj
*
pProc
,
const
void
*
pHead
,
int16_t
headLen
,
const
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
ftype
);
#ifdef __cplusplus
...
...
source/common/src/tmsgcb.c
浏览文件 @
182a5ee4
...
...
@@ -24,7 +24,7 @@ int32_t tmsgGetQueueSize(const SMsgCb* pMsgCb, int32_t vgId, EQueueType qtype) {
return
(
*
pMsgCb
->
qsizeFp
)(
pMsgCb
->
pWrapper
,
vgId
,
qtype
);
}
int32_t
tmsgSendReq
(
const
SMsgCb
*
pMsgCb
,
SEpSet
*
epSet
,
SRpcMsg
*
pReq
)
{
int32_t
tmsgSendReq
(
const
SMsgCb
*
pMsgCb
,
const
SEpSet
*
epSet
,
SRpcMsg
*
pReq
)
{
return
(
*
pMsgCb
->
sendReqFp
)(
pMsgCb
->
pWrapper
,
epSet
,
pReq
);
}
...
...
@@ -32,8 +32,12 @@ int32_t tmsgSendMnodeReq(const SMsgCb* pMsgCb, SRpcMsg* pReq) {
return
(
*
pMsgCb
->
sendMnodeReqFp
)(
pMsgCb
->
pWrapper
,
pReq
);
}
void
tmsgSendRsp
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pRsp
)
{
return
(
*
pMsgCb
->
sendRspFp
)(
pMsgCb
->
pWrapper
,
pRsp
);
}
void
tmsgSendRsp
(
const
SMsgCb
*
pMsgCb
,
const
SRpcMsg
*
pRsp
)
{
return
(
*
pMsgCb
->
sendRspFp
)(
pMsgCb
->
pWrapper
,
pRsp
);
}
void
tmsgRegisterBrokenLinkArg
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pMsg
)
{
(
*
pMsgCb
->
registerBrokenLinkArgFp
)(
pMsgCb
->
pWrapper
,
pMsg
);
}
void
tmsgReleaseHandle
(
const
SMsgCb
*
pMsgCb
,
void
*
handle
,
int8_t
type
)
{
(
*
pMsgCb
->
releaseHandleFp
)(
pMsgCb
->
pWrapper
,
handle
,
type
);
}
\ No newline at end of file
source/dnode/mgmt/container/inc/dnd.h
浏览文件 @
182a5ee4
...
...
@@ -137,8 +137,8 @@ void dndReportStartup(SDnode *pDnode, const char *pName, const char *pDesc
void
dndSendMonitorReport
(
SDnode
*
pDnode
);
int32_t
dndSendReqToMnode
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
dndSendReqToDnode
(
SMgmtWrapper
*
pWrapper
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
);
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
);
int32_t
dndSendReqToDnode
(
SMgmtWrapper
*
pWrapper
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
);
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
void
dndRegisterBrokenLinkArg
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
dndProcessNodeMsg
(
SDnode
*
pDnode
,
SNodeMsg
*
pMsg
);
...
...
source/dnode/mgmt/container/inc/dndInt.h
浏览文件 @
182a5ee4
...
...
@@ -56,7 +56,7 @@ void dndCleanupServer(SDnode *pDnode);
int32_t
dndInitClient
(
SDnode
*
pDnode
);
void
dndCleanupClient
(
SDnode
*
pDnode
);
int32_t
dndInitMsgHandle
(
SDnode
*
pDnode
);
void
dndSendRpcRsp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
);
void
dndSendRpcRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/container/src/dndTransport.c
浏览文件 @
182a5ee4
...
...
@@ -309,7 +309,7 @@ int32_t dndInitMsgHandle(SDnode *pDnode) {
return
0
;
}
static
int32_t
dndSendRpcReq
(
STransMgmt
*
pMgmt
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
)
{
static
int32_t
dndSendRpcReq
(
STransMgmt
*
pMgmt
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
)
{
if
(
pMgmt
->
clientRpc
==
NULL
)
{
terrno
=
TSDB_CODE_DND_OFFLINE
;
return
-
1
;
...
...
@@ -319,7 +319,7 @@ static int32_t dndSendRpcReq(STransMgmt *pMgmt, SEpSet *pEpSet, SRpcMsg *pReq) {
return
0
;
}
int32_t
dndSendReqToDnode
(
SMgmtWrapper
*
pWrapper
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
)
{
int32_t
dndSendReqToDnode
(
SMgmtWrapper
*
pWrapper
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
)
{
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
}
else
{
SDnode
*
pDnode
=
pWrapper
->
pDnode
;
...
...
@@ -348,7 +348,7 @@ int32_t dndSendReqToMnode(SMgmtWrapper *pWrapper, SRpcMsg *pReq) {
}
}
void
dndSendRpcRsp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
)
{
void
dndSendRpcRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
)
{
if
(
pRsp
->
code
==
TSDB_CODE_APP_NOT_READY
)
{
SMgmtWrapper
*
pDnodeWrapper
=
dndAcquireWrapper
(
pWrapper
->
pDnode
,
DNODE
);
if
(
pDnodeWrapper
!=
NULL
)
{
...
...
@@ -362,7 +362,7 @@ void dndSendRpcRsp(SMgmtWrapper *pWrapper, SRpcMsg *pRsp) {
}
}
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
)
{
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
)
{
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
int32_t
code
=
-
1
;
do
{
...
...
source/dnode/mgmt/dnode/inc/dm.h
浏览文件 @
182a5ee4
...
...
@@ -29,7 +29,7 @@ void dmInitMsgHandles(SMgmtWrapper *pWrapper);
void
dmGetMnodeEpSet
(
SDnodeMgmt
*
pMgmt
,
SEpSet
*
pEpSet
);
void
dmUpdateMnodeEpSet
(
SDnodeMgmt
*
pMgmt
,
SEpSet
*
pEpSet
);
void
dmSendRedirectRsp
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
void
dmSendRedirectRsp
(
SDnodeMgmt
*
pMgmt
,
const
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/dnode/src/dmInt.c
浏览文件 @
182a5ee4
...
...
@@ -54,7 +54,7 @@ void dmGetDnodeEp(SMgmtWrapper *pWrapper, int32_t dnodeId, char *pEp, char *pFqd
taosRUnLockLatch
(
&
pMgmt
->
latch
);
}
void
dmSendRedirectRsp
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
)
{
void
dmSendRedirectRsp
(
SDnodeMgmt
*
pMgmt
,
const
SRpcMsg
*
pReq
)
{
SDnode
*
pDnode
=
pMgmt
->
pDnode
;
SEpSet
epSet
=
{
0
};
...
...
source/util/src/tprocess.c
浏览文件 @
182a5ee4
...
...
@@ -207,8 +207,8 @@ static void taosProcCleanupQueue(SProcQueue *pQueue) {
}
}
static
int32_t
taosProcQueuePush
(
SProcQueue
*
pQueue
,
c
har
*
pHead
,
int16_t
rawHeadLen
,
char
*
pBody
,
int32_t
rawBodyLen
,
ProcFuncType
funcType
)
{
static
int32_t
taosProcQueuePush
(
SProcQueue
*
pQueue
,
c
onst
char
*
pHead
,
int16_t
rawHeadLen
,
const
char
*
pBody
,
int32_t
rawBodyLen
,
ProcFuncType
funcType
)
{
const
int32_t
headLen
=
CEIL8
(
rawHeadLen
);
const
int32_t
bodyLen
=
CEIL8
(
rawBodyLen
);
const
int32_t
fullLen
=
headLen
+
bodyLen
+
8
;
...
...
@@ -471,12 +471,12 @@ void taosProcCleanup(SProcObj *pProc) {
}
}
int32_t
taosProcPutToChildQ
(
SProcObj
*
pProc
,
void
*
pHead
,
int16_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
funcType
)
{
int32_t
taosProcPutToChildQ
(
SProcObj
*
pProc
,
const
void
*
pHead
,
int16_t
headLen
,
const
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
funcType
)
{
return
taosProcQueuePush
(
pProc
->
pChildQueue
,
pHead
,
headLen
,
pBody
,
bodyLen
,
funcType
);
}
int32_t
taosProcPutToParentQ
(
SProcObj
*
pProc
,
void
*
pHead
,
int16_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
funcType
)
{
int32_t
taosProcPutToParentQ
(
SProcObj
*
pProc
,
const
void
*
pHead
,
int16_t
headLen
,
const
void
*
pBody
,
int32_t
bodyLen
,
ProcFuncType
funcType
)
{
return
taosProcQueuePush
(
pProc
->
pParentQueue
,
pHead
,
headLen
,
pBody
,
bodyLen
,
funcType
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录