Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
332da703
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
332da703
编写于
3月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename msg
上级
bde9b439
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
385 addition
and
396 deletion
+385
-396
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+1
-13
source/dnode/mgmt/bnode/inc/bmWorker.h
source/dnode/mgmt/bnode/inc/bmWorker.h
+1
-1
source/dnode/mgmt/mnode/src/mmWorker.c
source/dnode/mgmt/mnode/src/mmWorker.c
+1
-1
source/dnode/mgmt/qnode/inc/qmWorker.h
source/dnode/mgmt/qnode/inc/qmWorker.h
+1
-1
source/dnode/mgmt/snode/inc/smWorker.h
source/dnode/mgmt/snode/inc/smWorker.h
+1
-1
source/dnode/mgmt/vnode/inc/vmWorker.h
source/dnode/mgmt/vnode/inc/vmWorker.h
+1
-1
source/dnode/mnode/impl/inc/mndInt.h
source/dnode/mnode/impl/inc/mndInt.h
+3
-3
source/dnode/mnode/impl/inc/mndTrans.h
source/dnode/mnode/impl/inc/mndTrans.h
+1
-1
source/dnode/mnode/impl/src/mndAcct.c
source/dnode/mnode/impl/src/mndAcct.c
+6
-6
source/dnode/mnode/impl/src/mndAuth.c
source/dnode/mnode/impl/src/mndAuth.c
+5
-5
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+18
-18
source/dnode/mnode/impl/src/mndCluster.c
source/dnode/mnode/impl/src/mndCluster.c
+5
-5
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+3
-3
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+29
-29
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+30
-30
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+21
-21
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+20
-20
source/dnode/mnode/impl/src/mndOffset.c
source/dnode/mnode/impl/src/mndOffset.c
+3
-3
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+33
-32
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+23
-23
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+15
-15
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+18
-18
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+29
-29
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+13
-13
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+22
-22
source/dnode/mnode/impl/src/mndTelem.c
source/dnode/mnode/impl/src/mndTelem.c
+2
-2
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+17
-17
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+14
-14
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+24
-24
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+23
-23
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+2
-2
未找到文件。
include/dnode/mnode/mnode.h
浏览文件 @
332da703
...
...
@@ -31,18 +31,6 @@ typedef int32_t (*PutReqToMWriteQFp)(SDnode *pDnode, struct SRpcMsg *rpcMsg);
typedef
int32_t
(
*
PutReqToMReadQFp
)(
SDnode
*
pDnode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendRedirectRspFp
)(
SDnode
*
pDnode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
struct
{
char
user
[
TSDB_USER_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
int32_t
acctId
;
SMnode
*
pMnode
;
int64_t
createdTime
;
SRpcMsg
rpcMsg
;
int32_t
contLen
;
void
*
pCont
;
}
SMndMsg
;
typedef
struct
{
int32_t
dnodeId
;
int64_t
clusterId
;
...
...
@@ -121,7 +109,7 @@ int32_t mndRetriveAuth(SMnode *pMnode, char *user, char *spi, char *encrypt, cha
* @param pMsg The request msg.
* @return int32_t 0 for success, -1 for failure.
*/
int32_t
mndProcessMsg
(
S
Mnd
Msg
*
pMsg
);
int32_t
mndProcessMsg
(
S
Node
Msg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/bnode/inc/bmWorker.h
浏览文件 @
332da703
...
...
@@ -28,7 +28,7 @@ void bmInitMsgFp(SMnodeMgmt *pMgmt);
void
bmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
bmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
bmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
void
bmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Mnd
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
bmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Node
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
bmConsumeParentQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
bmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
...
...
source/dnode/mgmt/mnode/src/mmWorker.c
浏览文件 @
332da703
...
...
@@ -29,7 +29,7 @@ static void mmProcessQueue(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
if
(
pMnode
!=
NULL
)
{
pMsg
->
pNode
=
pMnode
;
code
=
mndProcessMsg
((
S
Mnd
Msg
*
)
pMsg
);
code
=
mndProcessMsg
((
S
Node
Msg
*
)
pMsg
);
mmRelease
(
pMgmt
,
pMnode
);
}
...
...
source/dnode/mgmt/qnode/inc/qmWorker.h
浏览文件 @
332da703
...
...
@@ -28,7 +28,7 @@ void qmInitMsgFp(SMnodeMgmt *pMgmt);
void
qmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
qmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
qmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
void
qmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Mnd
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
qmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Node
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
qmConsumeParentQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
qmProcessWriteMsg
(
SDnode
*
pDnode
,
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
...
...
source/dnode/mgmt/snode/inc/smWorker.h
浏览文件 @
332da703
...
...
@@ -28,7 +28,7 @@ void smInitMsgFp(SMnodeMgmt *pMgmt);
void
smProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
smPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
smPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
void
smConsumeChildQueue
(
SDnode
*
pDnode
,
S
Mnd
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
smConsumeChildQueue
(
SDnode
*
pDnode
,
S
Node
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
smConsumeParentQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
smProcessWriteMsg
(
SDnode
*
pDnode
,
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
...
...
source/dnode/mgmt/vnode/inc/vmWorker.h
浏览文件 @
332da703
...
...
@@ -28,7 +28,7 @@ void vmInitMsgFp(SMnodeMgmt *pMgmt);
void
vmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
vmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
vmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
void
vmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Mnd
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
vmConsumeChildQueue
(
SDnode
*
pDnode
,
S
Node
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
vmConsumeParentQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
int32_t
vmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
...
...
source/dnode/mnode/impl/inc/mndInt.h
浏览文件 @
332da703
...
...
@@ -38,11 +38,11 @@ extern "C" {
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
typedef
int32_t
(
*
MndMsgFp
)(
S
Mnd
Msg
*
pMsg
);
typedef
int32_t
(
*
MndMsgFp
)(
S
Node
Msg
*
pMsg
);
typedef
int32_t
(
*
MndInitFp
)(
SMnode
*
pMnode
);
typedef
void
(
*
MndCleanupFp
)(
SMnode
*
pMnode
);
typedef
int32_t
(
*
ShowMetaFp
)(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
typedef
int32_t
(
*
ShowRetrieveFp
)(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
typedef
int32_t
(
*
ShowMetaFp
)(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
typedef
int32_t
(
*
ShowRetrieveFp
)(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
typedef
void
(
*
ShowFreeIterFp
)(
SMnode
*
pMnode
,
void
*
pIter
);
typedef
struct
SMnodeLoad
{
...
...
source/dnode/mnode/impl/inc/mndTrans.h
浏览文件 @
332da703
...
...
@@ -47,7 +47,7 @@ void mndTransSetRpcRsp(STrans *pTrans, void *pCont, int32_t contLen);
void
mndTransSetDbInfo
(
STrans
*
pTrans
,
SDbObj
*
pDb
);
int32_t
mndTransPrepare
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
void
mndTransProcessRsp
(
S
Mnd
Msg
*
pRsp
);
void
mndTransProcessRsp
(
S
Node
Msg
*
pRsp
);
void
mndTransPullup
(
SMnode
*
pMnode
);
#ifdef __cplusplus
...
...
source/dnode/mnode/impl/src/mndAcct.c
浏览文件 @
332da703
...
...
@@ -26,9 +26,9 @@ static SSdbRow *mndAcctActionDecode(SSdbRaw *pRaw);
static
int32_t
mndAcctActionInsert
(
SSdb
*
pSdb
,
SAcctObj
*
pAcct
);
static
int32_t
mndAcctActionDelete
(
SSdb
*
pSdb
,
SAcctObj
*
pAcct
);
static
int32_t
mndAcctActionUpdate
(
SSdb
*
pSdb
,
SAcctObj
*
pOld
,
SAcctObj
*
pNew
);
static
int32_t
mndProcessCreateAcctReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessAlterAcctReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropAcctReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateAcctReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessAlterAcctReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropAcctReq
(
S
Node
Msg
*
pReq
);
int32_t
mndInitAcct
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_ACCT
,
...
...
@@ -185,19 +185,19 @@ static int32_t mndAcctActionUpdate(SSdb *pSdb, SAcctObj *pOld, SAcctObj *pNew) {
return
0
;
}
static
int32_t
mndProcessCreateAcctReq
(
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndProcessCreateAcctReq
(
S
Node
Msg
*
pReq
)
{
terrno
=
TSDB_CODE_MND_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessAlterAcctReq
(
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndProcessAlterAcctReq
(
S
Node
Msg
*
pReq
)
{
terrno
=
TSDB_CODE_MND_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessDropAcctReq
(
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndProcessDropAcctReq
(
S
Node
Msg
*
pReq
)
{
terrno
=
TSDB_CODE_MND_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
...
...
source/dnode/mnode/impl/src/mndAuth.c
浏览文件 @
332da703
...
...
@@ -17,7 +17,7 @@
#include "mndAuth.h"
#include "mndUser.h"
static
int32_t
mndProcessAuthReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessAuthReq
(
S
Node
Msg
*
pReq
);
int32_t
mndInitAuth
(
SMnode
*
pMnode
)
{
mndSetMsgHandle
(
pMnode
,
TDMT_MND_AUTH
,
mndProcessAuthReq
);
...
...
@@ -45,7 +45,7 @@ int32_t mndRetriveAuth(SMnode *pMnode, char *user, char *spi, char *encrypt, cha
return
0
;
}
static
int32_t
mndProcessAuthReq
(
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndProcessAuthReq
(
S
Node
Msg
*
pReq
)
{
SAuthReq
authReq
=
{
0
};
if
(
tDeserializeSAuthReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
authReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
...
...
@@ -56,15 +56,15 @@ static int32_t mndProcessAuthReq(SMndMsg *pReq) {
memcpy
(
authRsp
.
user
,
authReq
.
user
,
TSDB_USER_LEN
);
int32_t
code
=
mndRetriveAuth
(
pReq
->
p
Mn
ode
,
authRsp
.
user
,
&
authRsp
.
spi
,
&
authRsp
.
encrypt
,
authRsp
.
secret
,
authRsp
.
ckey
);
mndRetriveAuth
(
pReq
->
p
N
ode
,
authRsp
.
user
,
&
authRsp
.
spi
,
&
authRsp
.
encrypt
,
authRsp
.
secret
,
authRsp
.
ckey
);
mTrace
(
"user:%s, auth req received, spi:%d encrypt:%d ruser:%s"
,
pReq
->
user
,
authRsp
.
spi
,
authRsp
.
encrypt
,
authRsp
.
user
);
int32_t
contLen
=
tSerializeSAuthReq
(
NULL
,
0
,
&
authRsp
);
void
*
pRsp
=
rpcMallocCont
(
contLen
);
tSerializeSAuthReq
(
pRsp
,
contLen
,
&
authRsp
);
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
contLen
;
return
code
;
}
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
332da703
...
...
@@ -29,12 +29,12 @@ static SSdbRow *mndBnodeActionDecode(SSdbRaw *pRaw);
static
int32_t
mndBnodeActionInsert
(
SSdb
*
pSdb
,
SBnodeObj
*
pObj
);
static
int32_t
mndBnodeActionDelete
(
SSdb
*
pSdb
,
SBnodeObj
*
pObj
);
static
int32_t
mndBnodeActionUpdate
(
SSdb
*
pSdb
,
SBnodeObj
*
pOld
,
SBnodeObj
*
pNew
);
static
int32_t
mndProcessCreateBnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropBnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateBnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessDropBnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndGetBnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveBnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateBnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropBnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCreateBnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessDropBnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndGetBnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveBnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextBnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitBnode
(
SMnode
*
pMnode
)
{
...
...
@@ -240,7 +240,7 @@ static int32_t mndSetCreateBnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
return
0
;
}
static
int32_t
mndCreateBnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateBnodeReq
*
pCreate
)
{
static
int32_t
mndCreateBnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateBnodeReq
*
pCreate
)
{
int32_t
code
=
-
1
;
SBnodeObj
bnodeObj
=
{
0
};
...
...
@@ -266,8 +266,8 @@ CREATE_BNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateBnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateBnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SBnodeObj
*
pObj
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -363,7 +363,7 @@ static int32_t mndSetDropBnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SBn
return
0
;
}
static
int32_t
mndDropBnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SBnodeObj
*
pObj
)
{
static
int32_t
mndDropBnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SBnodeObj
*
pObj
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_BNODE
,
&
pReq
->
rpcMsg
);
...
...
@@ -382,8 +382,8 @@ DROP_BNODE_OVER:
return
code
;
}
static
int32_t
mndProcessDropBnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropBnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SBnodeObj
*
pObj
=
NULL
;
...
...
@@ -430,18 +430,18 @@ DROP_BNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateBnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessCreateBnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessDropBnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropBnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndGetBnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetBnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -480,8 +480,8 @@ static int32_t mndGetBnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveBnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveBnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndCluster.c
浏览文件 @
332da703
...
...
@@ -26,8 +26,8 @@ static int32_t mndClusterActionInsert(SSdb *pSdb, SClusterObj *pCluster);
static
int32_t
mndClusterActionDelete
(
SSdb
*
pSdb
,
SClusterObj
*
pCluster
);
static
int32_t
mndClusterActionUpdate
(
SSdb
*
pSdb
,
SClusterObj
*
pOldCluster
,
SClusterObj
*
pNewCluster
);
static
int32_t
mndCreateDefaultCluster
(
SMnode
*
pMnode
);
static
int32_t
mndGetClusterMeta
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveClusters
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetClusterMeta
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveClusters
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextCluster
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitCluster
(
SMnode
*
pMnode
)
{
...
...
@@ -163,7 +163,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
return
sdbWrite
(
pMnode
->
pSdb
,
pRaw
);
}
static
int32_t
mndGetClusterMeta
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
static
int32_t
mndGetClusterMeta
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
pSchemas
;
...
...
@@ -201,8 +201,8 @@ static int32_t mndGetClusterMeta(SMndMsg *pMsg, SShowObj *pShow, STableMetaRsp *
return
0
;
}
static
int32_t
mndRetrieveClusters
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
static
int32_t
mndRetrieveClusters
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
332da703
...
...
@@ -34,9 +34,9 @@
static
int32_t
mndConsumerActionInsert
(
SSdb
*
pSdb
,
SMqConsumerObj
*
pConsumer
);
static
int32_t
mndConsumerActionDelete
(
SSdb
*
pSdb
,
SMqConsumerObj
*
pConsumer
);
static
int32_t
mndConsumerActionUpdate
(
SSdb
*
pSdb
,
SMqConsumerObj
*
pConsumer
,
SMqConsumerObj
*
pNewConsumer
);
static
int32_t
mndProcessConsumerMetaMsg
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndGetConsumerMeta
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConsumer
(
S
Mnd
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessConsumerMetaMsg
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndGetConsumerMeta
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConsumer
(
S
Node
Msg
*
pMsg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextConsumer
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitConsumer
(
SMnode
*
pMnode
)
{
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
332da703
...
...
@@ -31,14 +31,14 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw);
static
int32_t
mndDbActionInsert
(
SSdb
*
pSdb
,
SDbObj
*
pDb
);
static
int32_t
mndDbActionDelete
(
SSdb
*
pSdb
,
SDbObj
*
pDb
);
static
int32_t
mndDbActionUpdate
(
SSdb
*
pSdb
,
SDbObj
*
pOld
,
SDbObj
*
pNew
);
static
int32_t
mndProcessCreateDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessAlterDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessUseDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessSyncDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCompactDbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetDbMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveDbs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessAlterDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessUseDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessSyncDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCompactDbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetDbMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveDbs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextDb
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitDb
(
SMnode
*
pMnode
)
{
...
...
@@ -384,7 +384,7 @@ static int32_t mndSetCreateDbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
return
0
;
}
static
int32_t
mndCreateDb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCreateDbReq
*
pCreate
,
SUserObj
*
pUser
)
{
static
int32_t
mndCreateDb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCreateDbReq
*
pCreate
,
SUserObj
*
pUser
)
{
SDbObj
dbObj
=
{
0
};
memcpy
(
dbObj
.
name
,
pCreate
->
db
,
TSDB_DB_FNAME_LEN
);
memcpy
(
dbObj
.
acct
,
pUser
->
acct
,
TSDB_USER_LEN
);
...
...
@@ -458,8 +458,8 @@ CREATE_DB_OVER:
return
code
;
}
static
int32_t
mndProcessCreateDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -622,7 +622,7 @@ static int32_t mndSetUpdateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
return
0
;
}
static
int32_t
mndUpdateDb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDbObj
*
pOld
,
SDbObj
*
pNew
)
{
static
int32_t
mndUpdateDb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDbObj
*
pOld
,
SDbObj
*
pNew
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_ALTER_DB
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
UPDATE_DB_OVER
;
...
...
@@ -642,8 +642,8 @@ UPDATE_DB_OVER:
return
code
;
}
static
int32_t
mndProcessAlterDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessAlterDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -802,7 +802,7 @@ static int32_t mndSetDropDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *p
return
0
;
}
static
int32_t
mndDropDb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDbObj
*
pDb
)
{
static
int32_t
mndDropDb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDbObj
*
pDb
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_DB
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
DROP_DB_OVER
;
...
...
@@ -837,8 +837,8 @@ DROP_DB_OVER:
return
code
;
}
static
int32_t
mndProcessDropDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -948,8 +948,8 @@ static void mndBuildDBVgroupInfo(SDbObj *pDb, SMnode *pMnode, SArray *pVgList) {
sdbCancelFetch
(
pSdb
,
pIter
);
}
static
int32_t
mndProcessUseDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessUseDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -1017,8 +1017,8 @@ static int32_t mndProcessUseDbReq(SMndMsg *pReq) {
tSerializeSUseDbRsp
(
pRsp
,
contLen
,
&
usedbRsp
);
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
contLen
;
USE_DB_OVER:
if
(
code
!=
0
)
{
...
...
@@ -1101,8 +1101,8 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs,
return
0
;
}
static
int32_t
mndProcessSyncDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessSyncDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -1142,8 +1142,8 @@ SYNC_DB_OVER:
return
code
;
}
static
int32_t
mndProcessCompactDbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCompactDbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -1183,8 +1183,8 @@ SYNC_DB_OVER:
return
code
;
}
static
int32_t
mndGetDbMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetDbMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -1324,8 +1324,8 @@ char *mnGetDbStr(char *src) {
return
pos
;
}
static
int32_t
mndRetrieveDbs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveDbs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SDbObj
*
pDb
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
332da703
...
...
@@ -49,17 +49,17 @@ static int32_t mndDnodeActionInsert(SSdb *pSdb, SDnodeObj *pDnode);
static
int32_t
mndDnodeActionDelete
(
SSdb
*
pSdb
,
SDnodeObj
*
pDnode
);
static
int32_t
mndDnodeActionUpdate
(
SSdb
*
pSdb
,
SDnodeObj
*
pOld
,
SDnodeObj
*
pNew
);
static
int32_t
mndProcessCreateDnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropDnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessConfigDnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessConfigDnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessStatusReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetConfigMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConfigs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateDnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropDnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessConfigDnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessConfigDnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessStatusReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetConfigMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConfigs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextConfig
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndGetDnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveDnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetDnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveDnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextDnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitDnode
(
SMnode
*
pMnode
)
{
...
...
@@ -296,8 +296,8 @@ static int32_t mndCheckClusterCfgPara(SMnode *pMnode, const SClusterCfg *pCfg) {
return
0
;
}
static
int32_t
mndProcessStatusReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessStatusReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SStatusReq
statusReq
=
{
0
};
SDnodeObj
*
pDnode
=
NULL
;
int32_t
code
=
-
1
;
...
...
@@ -424,8 +424,8 @@ static int32_t mndProcessStatusReq(SMndMsg *pReq) {
tSerializeSStatusRsp
(
pHead
,
contLen
,
&
statusRsp
);
taosArrayDestroy
(
statusRsp
.
pDnodeEps
);
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Cont
=
pHead
;
pReq
->
rsp
Len
=
contLen
;
pReq
->
p
Rsp
=
pHead
;
}
pDnode
->
lastAccessTime
=
curMs
;
...
...
@@ -437,7 +437,7 @@ PROCESS_STATUS_MSG_OVER:
return
code
;
}
static
int32_t
mndCreateDnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCreateDnodeReq
*
pCreate
)
{
static
int32_t
mndCreateDnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCreateDnodeReq
*
pCreate
)
{
SDnodeObj
dnodeObj
=
{
0
};
dnodeObj
.
id
=
sdbGetMaxId
(
pMnode
->
pSdb
,
SDB_DNODE
);
dnodeObj
.
createdTime
=
taosGetTimestampMs
();
...
...
@@ -471,8 +471,8 @@ static int32_t mndCreateDnode(SMnode *pMnode, SMndMsg *pReq, SCreateDnodeReq *pC
return
0
;
}
static
int32_t
mndProcessCreateDnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateDnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -521,7 +521,7 @@ CREATE_DNODE_OVER:
return
code
;
}
static
int32_t
mndDropDnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDnodeObj
*
pDnode
)
{
static
int32_t
mndDropDnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDnodeObj
*
pDnode
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_DNODE
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"dnode:%d, failed to drop since %s"
,
pDnode
->
id
,
terrstr
());
...
...
@@ -547,8 +547,8 @@ static int32_t mndDropDnode(SMnode *pMnode, SMndMsg *pReq, SDnodeObj *pDnode) {
return
0
;
}
static
int32_t
mndProcessDropDnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropDnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -596,8 +596,8 @@ DROP_DNODE_OVER:
return
code
;
}
static
int32_t
mndProcessConfigDnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessConfigDnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SMCfgDnodeReq
cfgReq
=
{
0
};
if
(
tDeserializeSMCfgDnodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
cfgReq
)
!=
0
)
{
...
...
@@ -628,11 +628,11 @@ static int32_t mndProcessConfigDnodeReq(SMndMsg *pReq) {
return
0
;
}
static
int32_t
mndProcessConfigDnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessConfigDnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mInfo
(
"app:%p config rsp from dnode"
,
pRsp
->
rpcMsg
.
ahandle
);
}
static
int32_t
mndGetConfigMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
static
int32_t
mndGetConfigMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
pSchemas
;
...
...
@@ -663,8 +663,8 @@ static int32_t mndGetConfigMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *p
return
0
;
}
static
int32_t
mndRetrieveConfigs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveConfigs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
totalRows
=
0
;
int32_t
numOfRows
=
0
;
char
*
cfgOpts
[
TSDB_CONFIG_NUMBER
]
=
{
0
};
...
...
@@ -709,8 +709,8 @@ static int32_t mndRetrieveConfigs(SMndMsg *pReq, SShowObj *pShow, char *data, in
static
void
mndCancelGetNextConfig
(
SMnode
*
pMnode
,
void
*
pIter
)
{}
static
int32_t
mndGetDnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetDnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -773,8 +773,8 @@ static int32_t mndGetDnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveDnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveDnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
332da703
...
...
@@ -29,13 +29,13 @@ static SSdbRow *mndFuncActionDecode(SSdbRaw *pRaw);
static
int32_t
mndFuncActionInsert
(
SSdb
*
pSdb
,
SFuncObj
*
pFunc
);
static
int32_t
mndFuncActionDelete
(
SSdb
*
pSdb
,
SFuncObj
*
pFunc
);
static
int32_t
mndFuncActionUpdate
(
SSdb
*
pSdb
,
SFuncObj
*
pOld
,
SFuncObj
*
pNew
);
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCreateFuncReq
*
pCreate
);
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SFuncObj
*
pFunc
);
static
int32_t
mndProcessCreateFuncReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropFuncReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessRetrieveFuncReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetFuncMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveFuncs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCreateFuncReq
*
pCreate
);
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SFuncObj
*
pFunc
);
static
int32_t
mndProcessCreateFuncReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropFuncReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessRetrieveFuncReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetFuncMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveFuncs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextFunc
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitFunc
(
SMnode
*
pMnode
)
{
...
...
@@ -181,7 +181,7 @@ static void mndReleaseFunc(SMnode *pMnode, SFuncObj *pFunc) {
sdbRelease
(
pSdb
,
pFunc
);
}
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCreateFuncReq
*
pCreate
)
{
static
int32_t
mndCreateFunc
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCreateFuncReq
*
pCreate
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
NULL
;
...
...
@@ -234,7 +234,7 @@ CREATE_FUNC_OVER:
return
code
;
}
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SFuncObj
*
pFunc
)
{
static
int32_t
mndDropFunc
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SFuncObj
*
pFunc
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_FUNC
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
DROP_FUNC_OVER
;
...
...
@@ -262,8 +262,8 @@ DROP_FUNC_OVER:
return
code
;
}
static
int32_t
mndProcessCreateFuncReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateFuncReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SFuncObj
*
pFunc
=
NULL
;
...
...
@@ -339,8 +339,8 @@ CREATE_FUNC_OVER:
return
code
;
}
static
int32_t
mndProcessDropFuncReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropFuncReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SFuncObj
*
pFunc
=
NULL
;
...
...
@@ -394,8 +394,8 @@ DROP_FUNC_OVER:
return
code
;
}
static
int32_t
mndProcessRetrieveFuncReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessRetrieveFuncReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SRetrieveFuncReq
retrieveReq
=
{
0
};
SRetrieveFuncRsp
retrieveRsp
=
{
0
};
...
...
@@ -451,8 +451,8 @@ static int32_t mndProcessRetrieveFuncReq(SMndMsg *pReq) {
tSerializeSRetrieveFuncRsp
(
pRsp
,
contLen
,
&
retrieveRsp
);
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
contLen
;
code
=
0
;
...
...
@@ -463,8 +463,8 @@ RETRIEVE_FUNC_OVER:
return
code
;
}
static
int32_t
mndGetFuncMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetFuncMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -545,8 +545,8 @@ static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int16_t le
return
tDataTypes
[
type
].
name
;
}
static
int32_t
mndRetrieveFuncs
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveFuncs
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SFuncObj
*
pFunc
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
332da703
...
...
@@ -30,13 +30,13 @@ static SSdbRow *mndMnodeActionDecode(SSdbRaw *pRaw);
static
int32_t
mndMnodeActionInsert
(
SSdb
*
pSdb
,
SMnodeObj
*
pObj
);
static
int32_t
mndMnodeActionDelete
(
SSdb
*
pSdb
,
SMnodeObj
*
pObj
);
static
int32_t
mndMnodeActionUpdate
(
SSdb
*
pSdb
,
SMnodeObj
*
pOld
,
SMnodeObj
*
pNew
);
static
int32_t
mndProcessCreateMnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropMnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateMnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessAlterMnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessDropMnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndGetMnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveMnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateMnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropMnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCreateMnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessAlterMnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessDropMnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndGetMnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveMnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextMnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitMnode
(
SMnode
*
pMnode
)
{
...
...
@@ -355,7 +355,7 @@ static int32_t mndSetCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDno
return
0
;
}
static
int32_t
mndCreateMnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateMnodeReq
*
pCreate
)
{
static
int32_t
mndCreateMnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateMnodeReq
*
pCreate
)
{
int32_t
code
=
-
1
;
SMnodeObj
mnodeObj
=
{
0
};
...
...
@@ -380,8 +380,8 @@ CREATE_MNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateMnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateMnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SMnodeObj
*
pObj
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -527,7 +527,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
return
0
;
}
static
int32_t
mndDropMnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SMnodeObj
*
pObj
)
{
static
int32_t
mndDropMnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SMnodeObj
*
pObj
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_MNODE
,
&
pReq
->
rpcMsg
);
...
...
@@ -547,8 +547,8 @@ DROP_MNODE_OVER:
return
code
;
}
static
int32_t
mndProcessDropMnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropMnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SMnodeObj
*
pObj
=
NULL
;
...
...
@@ -595,23 +595,23 @@ DROP_MNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateMnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessCreateMnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessAlterMnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessAlterMnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessDropMnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropMnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndGetMnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetMnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -663,8 +663,8 @@ static int32_t mndGetMnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveMnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveMnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndOffset.c
浏览文件 @
332da703
...
...
@@ -32,7 +32,7 @@
static
int32_t
mndOffsetActionInsert
(
SSdb
*
pSdb
,
SMqOffsetObj
*
pOffset
);
static
int32_t
mndOffsetActionDelete
(
SSdb
*
pSdb
,
SMqOffsetObj
*
pOffset
);
static
int32_t
mndOffsetActionUpdate
(
SSdb
*
pSdb
,
SMqOffsetObj
*
pOffset
,
SMqOffsetObj
*
pNewOffset
);
static
int32_t
mndProcessCommitOffsetReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCommitOffsetReq
(
S
Node
Msg
*
pReq
);
int32_t
mndInitOffset
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_OFFSET
,
...
...
@@ -152,10 +152,10 @@ int32_t mndCreateOffset(STrans *pTrans, const char *cgroup, const char *topicNam
return
0
;
}
static
int32_t
mndProcessCommitOffsetReq
(
S
Mnd
Msg
*
pMsg
)
{
static
int32_t
mndProcessCommitOffsetReq
(
S
Node
Msg
*
pMsg
)
{
char
key
[
TSDB_PARTITION_KEY_LEN
];
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
char
*
msgStr
=
pMsg
->
rpcMsg
.
pCont
;
SMqCMCommitOffsetReq
commitOffsetReq
;
SCoder
decoder
;
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
332da703
...
...
@@ -50,14 +50,14 @@ static SConnObj *mndAcquireConn(SMnode *pMnode, int32_t connId);
static
void
mndReleaseConn
(
SMnode
*
pMnode
,
SConnObj
*
pConn
);
static
void
*
mndGetNextConn
(
SMnode
*
pMnode
,
SCacheIter
*
pIter
);
static
void
mndCancelGetNextConn
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndProcessHeartBeatReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessConnectReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessKillQueryReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessKillConnReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetConnsMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConns
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetQueryMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveQueries
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessHeartBeatReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessConnectReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessKillQueryReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessKillConnReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetConnsMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveConns
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetQueryMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveQueries
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextQuery
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitProfile
(
SMnode
*
pMnode
)
{
...
...
@@ -177,8 +177,8 @@ static void mndCancelGetNextConn(SMnode *pMnode, void *pIter) {
}
}
static
int32_t
mndProcessConnectReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessConnectReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SUserObj
*
pUser
=
NULL
;
SDbObj
*
pDb
=
NULL
;
SConnObj
*
pConn
=
NULL
;
...
...
@@ -206,8 +206,9 @@ static int32_t mndProcessConnectReq(SMndMsg *pReq) {
}
if
(
connReq
.
db
[
0
])
{
snprintf
(
pReq
->
db
,
TSDB_DB_FNAME_LEN
,
"%d%s%s"
,
pUser
->
acctId
,
TS_PATH_DELIMITER
,
connReq
.
db
);
pDb
=
mndAcquireDb
(
pMnode
,
pReq
->
db
);
char
db
[
TSDB_DB_FNAME_LEN
];
snprintf
(
db
,
TSDB_DB_FNAME_LEN
,
"%d%s%s"
,
pUser
->
acctId
,
TS_PATH_DELIMITER
,
connReq
.
db
);
pDb
=
mndAcquireDb
(
pMnode
,
db
);
if
(
pDb
==
NULL
)
{
terrno
=
TSDB_CODE_MND_INVALID_DB
;
mError
(
"user:%s, failed to login from %s while use db:%s since %s"
,
pReq
->
user
,
ip
,
connReq
.
db
,
terrstr
());
...
...
@@ -237,8 +238,8 @@ static int32_t mndProcessConnectReq(SMndMsg *pReq) {
if
(
pRsp
==
NULL
)
goto
CONN_OVER
;
tSerializeSConnectRsp
(
pRsp
,
contLen
,
&
connectRsp
);
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Cont
=
pRsp
;
pReq
->
rsp
Len
=
contLen
;
pReq
->
p
Rsp
=
pRsp
;
mDebug
(
"user:%s, login from %s, conn:%d, app:%s"
,
info
.
user
,
ip
,
pConn
->
id
,
connReq
.
app
);
...
...
@@ -338,8 +339,8 @@ static SClientHbRsp *mndMqHbBuildRsp(SMnode *pMnode, SClientHbReq *pReq) {
return
NULL
;
}
static
int32_t
mndProcessHeartBeatReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessHeartBeatReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SClientHbBatchReq
batchReq
=
{
0
};
if
(
tDeserializeSClientHbBatchReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
batchReq
)
!=
0
)
{
...
...
@@ -423,12 +424,12 @@ static int32_t mndProcessHeartBeatReq(SMndMsg *pReq) {
}
taosArrayDestroy
(
batchRsp
.
rsps
);
pReq
->
cont
Len
=
tlen
;
pReq
->
p
Cont
=
buf
;
pReq
->
rsp
Len
=
tlen
;
pReq
->
p
Rsp
=
buf
;
return
0
;
#if 0
SMnode *pMnode = pReq->p
Mn
ode;
SMnode *pMnode = pReq->p
N
ode;
SProfileMgmt *pMgmt = &pMnode->profileMgmt;
SHeartBeatReq *pHeartbeat = pReq->rpcMsg.pCont;
...
...
@@ -495,13 +496,13 @@ static int32_t mndProcessHeartBeatReq(SMndMsg *pReq) {
mndReleaseConn(pMnode, pConn);
pReq->contLen = sizeof(SConnectRsp);
pReq->p
Cont
= pRsp;
pReq->p
Rsp
= pRsp;
return 0;
#endif
}
static
int32_t
mndProcessKillQueryReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessKillQueryReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SProfileMgmt
*
pMgmt
=
&
pMnode
->
profileMgmt
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
...
...
@@ -534,8 +535,8 @@ static int32_t mndProcessKillQueryReq(SMndMsg *pReq) {
}
}
static
int32_t
mndProcessKillConnReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessKillConnReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SProfileMgmt
*
pMgmt
=
&
pMnode
->
profileMgmt
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
...
...
@@ -566,8 +567,8 @@ static int32_t mndProcessKillConnReq(SMndMsg *pReq) {
}
}
static
int32_t
mndGetConnsMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetConnsMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SProfileMgmt
*
pMgmt
=
&
pMnode
->
profileMgmt
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
...
...
@@ -641,8 +642,8 @@ static int32_t mndGetConnsMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveConns
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveConns
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
numOfRows
=
0
;
SConnObj
*
pConn
=
NULL
;
int32_t
cols
=
0
;
...
...
@@ -700,8 +701,8 @@ static int32_t mndRetrieveConns(SMndMsg *pReq, SShowObj *pShow, char *data, int3
return
numOfRows
;
}
static
int32_t
mndGetQueryMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetQueryMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SProfileMgmt
*
pMgmt
=
&
pMnode
->
profileMgmt
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
...
...
@@ -815,8 +816,8 @@ static int32_t mndGetQueryMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveQueries
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveQueries
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
numOfRows
=
0
;
SConnObj
*
pConn
=
NULL
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
332da703
...
...
@@ -29,14 +29,14 @@ static SSdbRow *mndQnodeActionDecode(SSdbRaw *pRaw);
static
int32_t
mndQnodeActionInsert
(
SSdb
*
pSdb
,
SQnodeObj
*
pObj
);
static
int32_t
mndQnodeActionDelete
(
SSdb
*
pSdb
,
SQnodeObj
*
pObj
);
static
int32_t
mndQnodeActionUpdate
(
SSdb
*
pSdb
,
SQnodeObj
*
pOld
,
SQnodeObj
*
pNew
);
static
int32_t
mndProcessCreateQnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropQnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateQnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessDropQnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndGetQnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveQnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateQnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropQnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCreateQnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessDropQnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndGetQnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveQnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextQnode
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndProcessQnodeListReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessQnodeListReq
(
S
Node
Msg
*
pReq
);
int32_t
mndInitQnode
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_QNODE
,
...
...
@@ -242,7 +242,7 @@ static int32_t mndSetCreateQnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
return
0
;
}
static
int32_t
mndCreateQnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateQnodeReq
*
pCreate
)
{
static
int32_t
mndCreateQnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateQnodeReq
*
pCreate
)
{
int32_t
code
=
-
1
;
SQnodeObj
qnodeObj
=
{
0
};
...
...
@@ -268,8 +268,8 @@ CREATE_QNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateQnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateQnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SQnodeObj
*
pObj
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -365,7 +365,7 @@ static int32_t mndSetDropQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQn
return
0
;
}
static
int32_t
mndDropQnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SQnodeObj
*
pObj
)
{
static
int32_t
mndDropQnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SQnodeObj
*
pObj
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_QNODE
,
&
pReq
->
rpcMsg
);
...
...
@@ -384,8 +384,8 @@ DROP_QNODE_OVER:
return
code
;
}
static
int32_t
mndProcessDropQnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropQnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SQnodeObj
*
pObj
=
NULL
;
...
...
@@ -432,11 +432,11 @@ DROP_QNODE_OVER:
return
code
;
}
static
int32_t
mndProcessQnodeListReq
(
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndProcessQnodeListReq
(
S
Node
Msg
*
pReq
)
{
int32_t
code
=
-
1
;
SQnodeListReq
qlistReq
=
{
0
};
int32_t
numOfRows
=
0
;
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SQnodeObj
*
pObj
=
NULL
;
SQnodeListRsp
qlistRsp
=
{
0
};
...
...
@@ -482,8 +482,8 @@ static int32_t mndProcessQnodeListReq(SMndMsg *pReq) {
tSerializeSQnodeListRsp
(
pRsp
,
rspLen
,
&
qlistRsp
);
pReq
->
cont
Len
=
rspLen
;
pReq
->
p
Cont
=
pRsp
;
pReq
->
rsp
Len
=
rspLen
;
pReq
->
p
Rsp
=
pRsp
;
code
=
0
;
QNODE_LIST_OVER:
...
...
@@ -493,18 +493,18 @@ QNODE_LIST_OVER:
return
code
;
}
static
int32_t
mndProcessCreateQnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessCreateQnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessDropQnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropQnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndGetQnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetQnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -543,8 +543,8 @@ static int32_t mndGetQnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveQnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveQnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
332da703
...
...
@@ -22,10 +22,10 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowReq *pReq);
static
void
mndFreeShowObj
(
SShowObj
*
pShow
);
static
SShowObj
*
mndAcquireShowObj
(
SMnode
*
pMnode
,
int64_t
showId
);
static
void
mndReleaseShowObj
(
SShowObj
*
pShow
,
bool
forceRemove
);
static
int32_t
mndProcessShowReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessRetrieveReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessShowReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessRetrieveReq
(
S
Node
Msg
*
pReq
);
static
bool
mndCheckRetrieveFinished
(
SShowObj
*
pShow
);
static
int32_t
mndProcessRetrieveSysTableReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessRetrieveSysTableReq
(
S
Node
Msg
*
pReq
);
int32_t
mndInitShow
(
SMnode
*
pMnode
)
{
SShowMgmt
*
pMgmt
=
&
pMnode
->
showMgmt
;
...
...
@@ -117,8 +117,8 @@ static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove) {
taosCacheRelease
(
pMgmt
->
cache
,
(
void
**
)(
&
pShow
),
forceRemove
);
}
static
int32_t
mndProcessShowReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessShowReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SShowMgmt
*
pMgmt
=
&
pMnode
->
showMgmt
;
int32_t
code
=
-
1
;
SShowReq
showReq
=
{
0
};
...
...
@@ -161,8 +161,8 @@ static int32_t mndProcessShowReq(SMndMsg *pReq) {
int32_t
bufLen
=
tSerializeSShowRsp
(
NULL
,
0
,
&
showRsp
);
void
*
pBuf
=
rpcMallocCont
(
bufLen
);
tSerializeSShowRsp
(
pBuf
,
bufLen
,
&
showRsp
);
pReq
->
cont
Len
=
bufLen
;
pReq
->
p
Cont
=
pBuf
;
pReq
->
rsp
Len
=
bufLen
;
pReq
->
p
Rsp
=
pBuf
;
mndReleaseShowObj
(
pShow
,
false
);
}
else
{
mndReleaseShowObj
(
pShow
,
true
);
...
...
@@ -178,8 +178,8 @@ SHOW_OVER:
return
code
;
}
static
int32_t
mndProcessRetrieveReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessRetrieveReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SShowMgmt
*
pMgmt
=
&
pMnode
->
showMgmt
;
int32_t
rowsToRead
=
0
;
int32_t
size
=
0
;
...
...
@@ -248,8 +248,8 @@ static int32_t mndProcessRetrieveReq(SMndMsg *pReq) {
pRsp
->
numOfRows
=
htonl
(
rowsRead
);
pRsp
->
precision
=
TSDB_TIME_PRECISION_MILLI
;
// millisecond time precision
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
size
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
size
;
if
(
rowsRead
==
0
||
rowsToRead
==
0
||
(
rowsRead
==
rowsToRead
&&
pShow
->
numOfRows
==
pShow
->
numOfReads
))
{
pRsp
->
completed
=
1
;
...
...
@@ -263,8 +263,8 @@ static int32_t mndProcessRetrieveReq(SMndMsg *pReq) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
mndProcessRetrieveSysTableReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessRetrieveSysTableReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SShowMgmt
*
pMgmt
=
&
pMnode
->
showMgmt
;
int32_t
rowsToRead
=
0
;
int32_t
size
=
0
;
...
...
@@ -348,8 +348,8 @@ static int32_t mndProcessRetrieveSysTableReq(SMndMsg *pReq) {
pRsp
->
numOfRows
=
htonl
(
rowsRead
);
pRsp
->
precision
=
TSDB_TIME_PRECISION_MILLI
;
// millisecond time precision
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
size
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
size
;
if
(
rowsRead
==
0
||
rowsToRead
==
0
||
(
rowsRead
==
rowsToRead
&&
pShow
->
numOfRows
==
pShow
->
numOfReads
))
{
pRsp
->
completed
=
1
;
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
332da703
...
...
@@ -29,12 +29,12 @@ static SSdbRow *mndSnodeActionDecode(SSdbRaw *pRaw);
static
int32_t
mndSnodeActionInsert
(
SSdb
*
pSdb
,
SSnodeObj
*
pObj
);
static
int32_t
mndSnodeActionDelete
(
SSdb
*
pSdb
,
SSnodeObj
*
pObj
);
static
int32_t
mndSnodeActionUpdate
(
SSdb
*
pSdb
,
SSnodeObj
*
pOld
,
SSnodeObj
*
pNew
);
static
int32_t
mndProcessCreateSnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropSnodeReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateSnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessDropSnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndGetSnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveSnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateSnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropSnodeReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCreateSnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessDropSnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndGetSnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveSnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextSnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitSnode
(
SMnode
*
pMnode
)
{
...
...
@@ -240,7 +240,7 @@ static int32_t mndSetCreateSnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
return
0
;
}
static
int32_t
mndCreateSnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateSnodeReq
*
pCreate
)
{
static
int32_t
mndCreateSnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDnodeObj
*
pDnode
,
SMCreateSnodeReq
*
pCreate
)
{
int32_t
code
=
-
1
;
SSnodeObj
snodeObj
=
{
0
};
...
...
@@ -267,8 +267,8 @@ CREATE_SNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateSnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateSnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SSnodeObj
*
pObj
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
@@ -365,7 +365,7 @@ static int32_t mndSetDropSnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SSn
return
0
;
}
static
int32_t
mndDropSnode
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SSnodeObj
*
pObj
)
{
static
int32_t
mndDropSnode
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SSnodeObj
*
pObj
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_SNODE
,
&
pReq
->
rpcMsg
);
...
...
@@ -385,8 +385,8 @@ DROP_SNODE_OVER:
return
code
;
}
static
int32_t
mndProcessDropSnodeReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropSnodeReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SSnodeObj
*
pObj
=
NULL
;
...
...
@@ -433,18 +433,18 @@ DROP_SNODE_OVER:
return
code
;
}
static
int32_t
mndProcessCreateSnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessCreateSnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessDropSnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropSnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndGetSnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetSnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -483,8 +483,8 @@ static int32_t mndGetSnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveSnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveSnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
332da703
...
...
@@ -33,15 +33,15 @@ static SSdbRow *mndStbActionDecode(SSdbRaw *pRaw);
static
int32_t
mndStbActionInsert
(
SSdb
*
pSdb
,
SStbObj
*
pStb
);
static
int32_t
mndStbActionDelete
(
SSdb
*
pSdb
,
SStbObj
*
pStb
);
static
int32_t
mndStbActionUpdate
(
SSdb
*
pSdb
,
SStbObj
*
pOld
,
SStbObj
*
pNew
);
static
int32_t
mndProcessMCreateStbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessMAlterStbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessMDropStbReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessVCreateStbRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessVAlterStbRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessVDropStbRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessTableMetaReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetStbMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveStb
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessMCreateStbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessMAlterStbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessMDropStbReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessVCreateStbRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessVAlterStbRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessVDropStbRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessTableMetaReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetStbMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveStb
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextStb
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitStb
(
SMnode
*
pMnode
)
{
...
...
@@ -490,7 +490,7 @@ static int32_t mndSetCreateStbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
return
0
;
}
static
int32_t
mndCreateStb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SMCreateStbReq
*
pCreate
,
SDbObj
*
pDb
)
{
static
int32_t
mndCreateStb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SMCreateStbReq
*
pCreate
,
SDbObj
*
pDb
)
{
SStbObj
stbObj
=
{
0
};
memcpy
(
stbObj
.
name
,
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
memcpy
(
stbObj
.
db
,
pDb
->
name
,
TSDB_DB_FNAME_LEN
);
...
...
@@ -551,8 +551,8 @@ CREATE_STB_OVER:
return
code
;
}
static
int32_t
mndProcessMCreateStbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessMCreateStbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SStbObj
*
pTopicStb
=
NULL
;
SStbObj
*
pStb
=
NULL
;
...
...
@@ -623,7 +623,7 @@ CREATE_STB_OVER:
return
code
;
}
static
int32_t
mndProcessVCreateStbRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessVCreateStbRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
...
...
@@ -980,7 +980,7 @@ static int32_t mndSetAlterStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
return
0
;
}
static
int32_t
mndAlterStb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
const
SMAltertbReq
*
pAlter
,
SDbObj
*
pDb
,
SStbObj
*
pOld
)
{
static
int32_t
mndAlterStb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
const
SMAltertbReq
*
pAlter
,
SDbObj
*
pDb
,
SStbObj
*
pOld
)
{
SStbObj
stbObj
=
{
0
};
taosRLockLatch
(
&
pOld
->
lock
);
memcpy
(
&
stbObj
,
pOld
,
sizeof
(
SStbObj
));
...
...
@@ -1043,8 +1043,8 @@ ALTER_STB_OVER:
return
code
;
}
static
int32_t
mndProcessMAlterStbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessMAlterStbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SDbObj
*
pDb
=
NULL
;
SStbObj
*
pStb
=
NULL
;
...
...
@@ -1096,7 +1096,7 @@ ALTER_STB_OVER:
return
code
;
}
static
int32_t
mndProcessVAlterStbRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessVAlterStbRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
...
...
@@ -1160,7 +1160,7 @@ static int32_t mndSetDropStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
return
0
;
}
static
int32_t
mndDropStb
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
)
{
static
int32_t
mndDropStb
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_STB
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
DROP_STB_OVER
;
...
...
@@ -1180,8 +1180,8 @@ DROP_STB_OVER:
return
code
;
}
static
int32_t
mndProcessMDropStbReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessMDropStbReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SDbObj
*
pDb
=
NULL
;
...
...
@@ -1237,7 +1237,7 @@ DROP_STB_OVER:
return
code
;
}
static
int32_t
mndProcessVDropStbRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessVDropStbRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
...
...
@@ -1311,8 +1311,8 @@ static int32_t mndBuildStbSchema(SMnode *pMnode, const char *dbFName, const char
return
code
;
}
static
int32_t
mndProcessTableMetaReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessTableMetaReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
STableInfoReq
infoReq
=
{
0
};
STableMetaRsp
metaRsp
=
{
0
};
...
...
@@ -1347,8 +1347,8 @@ static int32_t mndProcessTableMetaReq(SMndMsg *pReq) {
}
tSerializeSTableMetaRsp
(
pRsp
,
rspLen
,
&
metaRsp
);
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
rspLen
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
rspLen
;
code
=
0
;
mDebug
(
"stb:%s.%s, meta is retrieved"
,
infoReq
.
dbFName
,
infoReq
.
tbName
);
...
...
@@ -1436,8 +1436,8 @@ static int32_t mndGetNumOfStbs(SMnode *pMnode, char *dbName, int32_t *pNumOfStbs
return
0
;
}
static
int32_t
mndGetStbMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetStbMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
if
(
mndGetNumOfStbs
(
pMnode
,
pShow
->
db
,
&
pShow
->
numOfRows
)
!=
0
)
{
...
...
@@ -1499,8 +1499,8 @@ static void mndExtractTableName(char *tableId, char *name) {
}
}
static
int32_t
mndRetrieveStb
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveStb
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SStbObj
*
pStb
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
332da703
...
...
@@ -31,12 +31,12 @@
static
int32_t
mndStreamActionInsert
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
static
int32_t
mndStreamActionDelete
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
static
int32_t
mndStreamActionUpdate
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
,
SStreamObj
*
pNewStream
);
static
int32_t
mndProcessCreateStreamReq
(
S
Mnd
Msg
*
pReq
);
/*static int32_t mndProcessDropStreamReq(S
Mnd
Msg *pReq);*/
/*static int32_t mndProcessDropStreamInRsp(S
Mnd
Msg *pRsp);*/
static
int32_t
mndProcessStreamMetaReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetStreamMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveStream
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateStreamReq
(
S
Node
Msg
*
pReq
);
/*static int32_t mndProcessDropStreamReq(S
Node
Msg *pReq);*/
/*static int32_t mndProcessDropStreamInRsp(S
Node
Msg *pRsp);*/
static
int32_t
mndProcessStreamMetaReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetStreamMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveStream
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextStream
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitStream
(
SMnode
*
pMnode
)
{
...
...
@@ -208,7 +208,7 @@ static int32_t mndCheckCreateStreamReq(SCMCreateStreamReq *pCreate) {
return
0
;
}
static
int32_t
mndCreateStream
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCMCreateStreamReq
*
pCreate
,
SDbObj
*
pDb
)
{
static
int32_t
mndCreateStream
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCMCreateStreamReq
*
pCreate
,
SDbObj
*
pDb
)
{
mDebug
(
"stream:%s to create"
,
pCreate
->
name
);
SStreamObj
streamObj
=
{
0
};
tstrncpy
(
streamObj
.
name
,
pCreate
->
name
,
TSDB_STREAM_FNAME_LEN
);
...
...
@@ -247,8 +247,8 @@ static int32_t mndCreateStream(SMnode *pMnode, SMndMsg *pReq, SCMCreateStreamReq
return
0
;
}
static
int32_t
mndProcessCreateStreamReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateStreamReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SStreamObj
*
pStream
=
NULL
;
SDbObj
*
pDb
=
NULL
;
...
...
@@ -339,8 +339,8 @@ static int32_t mndGetNumOfStreams(SMnode *pMnode, char *dbName, int32_t *pNumOfS
return
0
;
}
static
int32_t
mndGetStreamMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetStreamMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
if
(
mndGetNumOfStreams
(
pMnode
,
pShow
->
db
,
&
pShow
->
numOfRows
)
!=
0
)
{
...
...
@@ -383,8 +383,8 @@ static int32_t mndGetStreamMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *p
return
0
;
}
static
int32_t
mndRetrieveStream
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveStream
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SStreamObj
*
pStream
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
332da703
...
...
@@ -48,14 +48,14 @@ static int32_t mndSubActionInsert(SSdb *pSdb, SMqSubscribeObj *);
static
int32_t
mndSubActionDelete
(
SSdb
*
pSdb
,
SMqSubscribeObj
*
);
static
int32_t
mndSubActionUpdate
(
SSdb
*
pSdb
,
SMqSubscribeObj
*
pOldSub
,
SMqSubscribeObj
*
pNewSub
);
static
int32_t
mndProcessSubscribeReq
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeRsp
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeInternalReq
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeInternalRsp
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessMqTimerMsg
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessGetSubEpReq
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessDoRebalanceMsg
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessResetOffsetReq
(
S
Mnd
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeReq
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeRsp
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeInternalReq
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessSubscribeInternalRsp
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessMqTimerMsg
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessGetSubEpReq
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessDoRebalanceMsg
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndProcessResetOffsetReq
(
S
Node
Msg
*
pMsg
);
static
int32_t
mndPersistMqSetConnReq
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
const
SMqTopicObj
*
pTopic
,
const
char
*
cgroup
,
const
SMqConsumerEp
*
pConsumerEp
);
...
...
@@ -211,8 +211,8 @@ static int32_t mndPersistCancelConnReq(SMnode *pMnode, STrans *pTrans, const SMq
}
#if 0
static int32_t mndProcessResetOffsetReq(S
Mnd
Msg *pMsg) {
SMnode *pMnode = pMsg->p
Mn
ode;
static int32_t mndProcessResetOffsetReq(S
Node
Msg *pMsg) {
SMnode *pMnode = pMsg->p
N
ode;
uint8_t *str = pMsg->rpcMsg.pCont;
SMqCMResetOffsetReq req;
...
...
@@ -249,14 +249,14 @@ static int32_t mndProcessResetOffsetReq(SMndMsg *pMsg) {
}
#endif
static
int32_t
mndProcessGetSubEpReq
(
S
Mnd
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
static
int32_t
mndProcessGetSubEpReq
(
S
Node
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
SMqCMGetSubEpReq
*
pReq
=
(
SMqCMGetSubEpReq
*
)
pMsg
->
rpcMsg
.
pCont
;
SMqCMGetSubEpRsp
rsp
=
{
0
};
int64_t
consumerId
=
be64toh
(
pReq
->
consumerId
);
int32_t
epoch
=
ntohl
(
pReq
->
epoch
);
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMsg
->
p
Mn
ode
,
consumerId
);
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMsg
->
p
N
ode
,
consumerId
);
if
(
pConsumer
==
NULL
)
{
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_EXIST
;
return
-
1
;
...
...
@@ -327,8 +327,8 @@ static int32_t mndProcessGetSubEpReq(SMndMsg *pMsg) {
tEncodeSMqCMGetSubEpRsp
(
&
abuf
,
&
rsp
);
tDeleteSMqCMGetSubEpRsp
(
&
rsp
);
mndReleaseConsumer
(
pMnode
,
pConsumer
);
pMsg
->
p
Cont
=
buf
;
pMsg
->
cont
Len
=
tlen
;
pMsg
->
p
Rsp
=
buf
;
pMsg
->
rsp
Len
=
tlen
;
return
0
;
}
...
...
@@ -356,8 +356,8 @@ static SMqRebSubscribe *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
return
pRebSub
;
}
static
int32_t
mndProcessMqTimerMsg
(
S
Mnd
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
static
int32_t
mndProcessMqTimerMsg
(
S
Node
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SMqConsumerObj
*
pConsumer
;
void
*
pIter
=
NULL
;
...
...
@@ -428,8 +428,8 @@ static int32_t mndProcessMqTimerMsg(SMndMsg *pMsg) {
return
0
;
}
static
int32_t
mndProcessDoRebalanceMsg
(
S
Mnd
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
static
int32_t
mndProcessDoRebalanceMsg
(
S
Node
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
SMqDoRebalanceMsg
*
pReq
=
pMsg
->
rpcMsg
.
pCont
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_REBALANCE
,
&
pMsg
->
rpcMsg
);
void
*
pIter
=
NULL
;
...
...
@@ -994,8 +994,8 @@ void mndReleaseSubscribe(SMnode *pMnode, SMqSubscribeObj *pSub) {
sdbRelease
(
pSdb
,
pSub
);
}
static
int32_t
mndProcessSubscribeReq
(
S
Mnd
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
static
int32_t
mndProcessSubscribeReq
(
S
Node
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
char
*
msgStr
=
pMsg
->
rpcMsg
.
pCont
;
SCMSubscribeReq
subscribe
;
tDeserializeSCMSubscribeReq
(
msgStr
,
&
subscribe
);
...
...
@@ -1156,7 +1156,7 @@ static int32_t mndProcessSubscribeReq(SMndMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessSubscribeInternalRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessSubscribeInternalRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndTelem.c
浏览文件 @
332da703
...
...
@@ -79,8 +79,8 @@ static char* mndBuildTelemetryReport(SMnode* pMnode) {
return
pCont
;
}
static
int32_t
mndProcessTelemTimer
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessTelemTimer
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
STelemMgmt
*
pMgmt
=
&
pMnode
->
telemMgmt
;
if
(
!
pMgmt
->
enable
)
return
0
;
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
332da703
...
...
@@ -31,12 +31,12 @@
static
int32_t
mndTopicActionInsert
(
SSdb
*
pSdb
,
SMqTopicObj
*
pTopic
);
static
int32_t
mndTopicActionDelete
(
SSdb
*
pSdb
,
SMqTopicObj
*
pTopic
);
static
int32_t
mndTopicActionUpdate
(
SSdb
*
pSdb
,
SMqTopicObj
*
pTopic
,
SMqTopicObj
*
pNewTopic
);
static
int32_t
mndProcessCreateTopicReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropTopicReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropTopicInRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessTopicMetaReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetTopicMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveTopic
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateTopicReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropTopicReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropTopicInRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessTopicMetaReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetTopicMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveTopic
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextTopic
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitTopic
(
SMnode
*
pMnode
)
{
...
...
@@ -236,7 +236,7 @@ static int32_t mndCheckCreateTopicReq(SCMCreateTopicReq *pCreate) {
return
0
;
}
static
int32_t
mndCreateTopic
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SCMCreateTopicReq
*
pCreate
,
SDbObj
*
pDb
)
{
static
int32_t
mndCreateTopic
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SCMCreateTopicReq
*
pCreate
,
SDbObj
*
pDb
)
{
mDebug
(
"topic:%s to create"
,
pCreate
->
name
);
SMqTopicObj
topicObj
=
{
0
};
tstrncpy
(
topicObj
.
name
,
pCreate
->
name
,
TSDB_TOPIC_FNAME_LEN
);
...
...
@@ -276,8 +276,8 @@ static int32_t mndCreateTopic(SMnode *pMnode, SMndMsg *pReq, SCMCreateTopicReq *
return
0
;
}
static
int32_t
mndProcessCreateTopicReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateTopicReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SMqTopicObj
*
pTopic
=
NULL
;
SDbObj
*
pDb
=
NULL
;
...
...
@@ -341,7 +341,7 @@ CREATE_TOPIC_OVER:
return
code
;
}
static
int32_t
mndDropTopic
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SMqTopicObj
*
pTopic
)
{
static
int32_t
mndDropTopic
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SMqTopicObj
*
pTopic
)
{
// TODO: cannot drop when subscribed
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_TOPIC
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
...
...
@@ -368,8 +368,8 @@ static int32_t mndDropTopic(SMnode *pMnode, SMndMsg *pReq, SMqTopicObj *pTopic)
return
0
;
}
static
int32_t
mndProcessDropTopicReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropTopicReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SMDropTopicReq
dropReq
=
{
0
};
if
(
tDeserializeSMDropTopicReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
...
...
@@ -403,7 +403,7 @@ static int32_t mndProcessDropTopicReq(SMndMsg *pReq) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessDropTopicInRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropTopicInRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
...
...
@@ -435,8 +435,8 @@ static int32_t mndGetNumOfTopics(SMnode *pMnode, char *dbName, int32_t *pNumOfTo
return
0
;
}
static
int32_t
mndGetTopicMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetTopicMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
if
(
mndGetNumOfTopics
(
pMnode
,
pShow
->
db
,
&
pShow
->
numOfRows
)
!=
0
)
{
...
...
@@ -479,8 +479,8 @@ static int32_t mndGetTopicMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveTopic
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveTopic
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SMqTopicObj
*
pTopic
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
332da703
...
...
@@ -55,11 +55,11 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans);
static
void
mndTransExecute
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
void
mndTransSendRpcRsp
(
STrans
*
pTrans
);
static
int32_t
mndProcessTransReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessKillTransReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessTransReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessKillTransReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetTransMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveTrans
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetTransMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveTrans
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextTrans
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitTrans
(
SMnode
*
pMnode
)
{
...
...
@@ -774,8 +774,8 @@ static void mndTransSendRpcRsp(STrans *pTrans) {
}
}
void
mndTransProcessRsp
(
S
Mnd
Msg
*
pRsp
)
{
SMnode
*
pMnode
=
pRsp
->
p
Mn
ode
;
void
mndTransProcessRsp
(
S
Node
Msg
*
pRsp
)
{
SMnode
*
pMnode
=
pRsp
->
p
N
ode
;
int64_t
signature
=
(
int64_t
)(
pRsp
->
rpcMsg
.
ahandle
);
int32_t
transId
=
(
int32_t
)(
signature
>>
32
);
int32_t
action
=
(
int32_t
)((
signature
<<
32
)
>>
32
);
...
...
@@ -1157,8 +1157,8 @@ static void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
mndTransSendRpcRsp
(
pTrans
);
}
static
int32_t
mndProcessTransReq
(
S
Mnd
Msg
*
pReq
)
{
mndTransPullup
(
pReq
->
p
Mn
ode
);
static
int32_t
mndProcessTransReq
(
S
Node
Msg
*
pReq
)
{
mndTransPullup
(
pReq
->
p
N
ode
);
return
0
;
}
...
...
@@ -1199,8 +1199,8 @@ static int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans) {
return
0
;
}
static
int32_t
mndProcessKillTransReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessKillTransReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SKillTransReq
killReq
=
{
0
};
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
...
...
@@ -1257,8 +1257,8 @@ void mndTransPullup(SMnode *pMnode) {
sdbWriteFile
(
pMnode
->
pSdb
);
}
static
int32_t
mndGetTransMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetTransMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -1320,8 +1320,8 @@ static int32_t mndGetTransMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveTrans
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveTrans
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
STrans
*
pTrans
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
332da703
...
...
@@ -30,13 +30,13 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw);
static
int32_t
mndUserActionInsert
(
SSdb
*
pSdb
,
SUserObj
*
pUser
);
static
int32_t
mndUserActionDelete
(
SSdb
*
pSdb
,
SUserObj
*
pUser
);
static
int32_t
mndUserActionUpdate
(
SSdb
*
pSdb
,
SUserObj
*
pOld
,
SUserObj
*
pNew
);
static
int32_t
mndCreateUser
(
SMnode
*
pMnode
,
char
*
acct
,
SCreateUserReq
*
pCreate
,
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessCreateUserReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessAlterUserReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessDropUserReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndProcessGetUserAuthReq
(
S
Mnd
Msg
*
pReq
);
static
int32_t
mndGetUserMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveUsers
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndCreateUser
(
SMnode
*
pMnode
,
char
*
acct
,
SCreateUserReq
*
pCreate
,
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessCreateUserReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessAlterUserReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessDropUserReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndProcessGetUserAuthReq
(
S
Node
Msg
*
pReq
);
static
int32_t
mndGetUserMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveUsers
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextUser
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitUser
(
SMnode
*
pMnode
)
{
...
...
@@ -261,7 +261,7 @@ void mndReleaseUser(SMnode *pMnode, SUserObj *pUser) {
sdbRelease
(
pSdb
,
pUser
);
}
static
int32_t
mndCreateUser
(
SMnode
*
pMnode
,
char
*
acct
,
SCreateUserReq
*
pCreate
,
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndCreateUser
(
SMnode
*
pMnode
,
char
*
acct
,
SCreateUserReq
*
pCreate
,
S
Node
Msg
*
pReq
)
{
SUserObj
userObj
=
{
0
};
taosEncryptPass_c
((
uint8_t
*
)
pCreate
->
pass
,
strlen
(
pCreate
->
pass
),
userObj
.
pass
);
tstrncpy
(
userObj
.
user
,
pCreate
->
user
,
TSDB_USER_LEN
);
...
...
@@ -295,8 +295,8 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate
return
0
;
}
static
int32_t
mndProcessCreateUserReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessCreateUserReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SUserObj
*
pOperUser
=
NULL
;
...
...
@@ -349,7 +349,7 @@ CREATE_USER_OVER:
return
code
;
}
static
int32_t
mndUpdateUser
(
SMnode
*
pMnode
,
SUserObj
*
pOld
,
SUserObj
*
pNew
,
S
Mnd
Msg
*
pReq
)
{
static
int32_t
mndUpdateUser
(
SMnode
*
pMnode
,
SUserObj
*
pOld
,
SUserObj
*
pNew
,
S
Node
Msg
*
pReq
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_ALTER_USER
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"user:%s, failed to update since %s"
,
pOld
->
user
,
terrstr
());
...
...
@@ -397,8 +397,8 @@ static SHashObj *mndDupDbHash(SHashObj *pOld) {
return
pNew
;
}
static
int32_t
mndProcessAlterUserReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessAlterUserReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SUserObj
*
pOperUser
=
NULL
;
...
...
@@ -510,7 +510,7 @@ ALTER_USER_OVER:
return
code
;
}
static
int32_t
mndDropUser
(
SMnode
*
pMnode
,
S
Mnd
Msg
*
pReq
,
SUserObj
*
pUser
)
{
static
int32_t
mndDropUser
(
SMnode
*
pMnode
,
S
Node
Msg
*
pReq
,
SUserObj
*
pUser
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_USER
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"user:%s, failed to drop since %s"
,
pUser
->
user
,
terrstr
());
...
...
@@ -536,8 +536,8 @@ static int32_t mndDropUser(SMnode *pMnode, SMndMsg *pReq, SUserObj *pUser) {
return
0
;
}
static
int32_t
mndProcessDropUserReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessDropUserReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SUserObj
*
pOperUser
=
NULL
;
...
...
@@ -585,8 +585,8 @@ DROP_USER_OVER:
return
code
;
}
static
int32_t
mndProcessGetUserAuthReq
(
S
Mnd
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndProcessGetUserAuthReq
(
S
Node
Msg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
int32_t
code
=
-
1
;
SUserObj
*
pUser
=
NULL
;
SGetUserAuthReq
authReq
=
{
0
};
...
...
@@ -635,8 +635,8 @@ static int32_t mndProcessGetUserAuthReq(SMndMsg *pReq) {
tSerializeSGetUserAuthRsp
(
pRsp
,
contLen
,
&
authRsp
);
pReq
->
p
Cont
=
pRsp
;
pReq
->
cont
Len
=
contLen
;
pReq
->
p
Rsp
=
pRsp
;
pReq
->
rsp
Len
=
contLen
;
code
=
0
;
GET_AUTH_OVER:
...
...
@@ -647,8 +647,8 @@ GET_AUTH_OVER:
return
code
;
}
static
int32_t
mndGetUserMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetUserMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -693,8 +693,8 @@ static int32_t mndGetUserMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pMe
return
0
;
}
static
int32_t
mndRetrieveUsers
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveUsers
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SUserObj
*
pUser
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
332da703
...
...
@@ -29,17 +29,17 @@ static int32_t mndVgroupActionInsert(SSdb *pSdb, SVgObj *pVgroup);
static
int32_t
mndVgroupActionDelete
(
SSdb
*
pSdb
,
SVgObj
*
pVgroup
);
static
int32_t
mndVgroupActionUpdate
(
SSdb
*
pSdb
,
SVgObj
*
pOld
,
SVgObj
*
pNew
);
static
int32_t
mndProcessCreateVnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessAlterVnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessDropVnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessSyncVnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndProcessCompactVnodeRsp
(
S
Mnd
Msg
*
pRsp
);
static
int32_t
mndGetVgroupMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveVgroups
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateVnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessAlterVnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessDropVnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessSyncVnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndProcessCompactVnodeRsp
(
S
Node
Msg
*
pRsp
);
static
int32_t
mndGetVgroupMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveVgroups
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextVgroup
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndGetVnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveVnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetVnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveVnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextVnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitVgroup
(
SMnode
*
pMnode
)
{
...
...
@@ -452,24 +452,24 @@ SEpSet mndGetVgroupEpset(SMnode *pMnode, SVgObj *pVgroup) {
return
epset
;
}
static
int32_t
mndProcessCreateVnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessCreateVnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessAlterVnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessAlterVnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessDropVnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
static
int32_t
mndProcessDropVnodeRsp
(
S
Node
Msg
*
pRsp
)
{
mndTransProcessRsp
(
pRsp
);
return
0
;
}
static
int32_t
mndProcessSyncVnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
return
0
;
}
static
int32_t
mndProcessSyncVnodeRsp
(
S
Node
Msg
*
pRsp
)
{
return
0
;
}
static
int32_t
mndProcessCompactVnodeRsp
(
S
Mnd
Msg
*
pRsp
)
{
return
0
;
}
static
int32_t
mndProcessCompactVnodeRsp
(
S
Node
Msg
*
pRsp
)
{
return
0
;
}
static
bool
mndGetVgroupMaxReplicaFp
(
SMnode
*
pMnode
,
void
*
pObj
,
void
*
p1
,
void
*
p2
,
void
*
p3
)
{
SVgObj
*
pVgroup
=
pObj
;
...
...
@@ -500,8 +500,8 @@ static int32_t mndGetVgroupMaxReplica(SMnode *pMnode, char *dbName, int8_t *pRep
return
0
;
}
static
int32_t
mndGetVgroupMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetVgroupMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
if
(
mndGetVgroupMaxReplica
(
pMnode
,
pShow
->
db
,
&
pShow
->
replica
,
&
pShow
->
numOfRows
)
!=
0
)
{
...
...
@@ -551,8 +551,8 @@ static int32_t mndGetVgroupMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *p
return
0
;
}
static
int32_t
mndRetrieveVgroups
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveVgroups
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SVgObj
*
pVgroup
=
NULL
;
...
...
@@ -624,8 +624,8 @@ int32_t mndGetVnodesNum(SMnode *pMnode, int32_t dnodeId) {
return
numOfVnodes
;
}
static
int32_t
mndGetVnodeMeta
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndGetVnodeMeta
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -664,8 +664,8 @@ static int32_t mndGetVnodeMeta(SMndMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
return
0
;
}
static
int32_t
mndRetrieveVnodes
(
S
Mnd
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
Mn
ode
;
static
int32_t
mndRetrieveVnodes
(
S
Node
Msg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
p
N
ode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
SVgObj
*
pVgroup
=
NULL
;
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
332da703
...
...
@@ -386,8 +386,8 @@ void mndDestroy(const char *path) {
mDebug
(
"mnode is destroyed"
);
}
int32_t
mndProcessMsg
(
S
Mnd
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
Mn
ode
;
int32_t
mndProcessMsg
(
S
Node
Msg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
p
N
ode
;
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
void
*
ahandle
=
pMsg
->
rpcMsg
.
ahandle
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录