Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82a8ed2f
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
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看板
提交
82a8ed2f
编写于
12月 21, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-10431 send create stable msg to vnode
上级
a09c553a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
10 deletion
+30
-10
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+27
-7
source/dnode/mgmt/impl/test/stb/stb.cpp
source/dnode/mgmt/impl/test/stb/stb.cpp
+0
-2
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+1
-1
source/dnode/vnode/impl/src/vnodeWrite.c
source/dnode/vnode/impl/src/vnodeWrite.c
+2
-0
未找到文件。
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
82a8ed2f
...
...
@@ -813,19 +813,38 @@ static void dndProcessVnodeFetchQueue(SVnodeObj *pVnode, SRpcMsg *pMsg) {
}
static
void
dndProcessVnodeWriteQueue
(
SVnodeObj
*
pVnode
,
taos_qall
qall
,
int32_t
numOfMsgs
)
{
SRpcMsg
*
pRpcMsg
=
NULL
;
SArray
*
pArray
=
taosArrayInit
(
numOfMsgs
,
sizeof
(
SRpcMsg
));
SArray
*
pArray
=
taosArrayInit
(
numOfMsgs
,
sizeof
(
SRpcMsg
*
));
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
taosGetQitem
(
qall
,
(
void
**
)
&
pRpcMsg
)
;
void
*
ptr
=
taosArrayPush
(
pArray
,
pRpc
Msg
);
SRpcMsg
*
pMsg
=
NULL
;
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
);
void
*
ptr
=
taosArrayPush
(
pArray
,
&
p
Msg
);
assert
(
ptr
!=
NULL
);
taosFreeQitem
(
pRpcMsg
);
}
vnodeProcessWMsgs
(
pVnode
->
pImpl
,
pArray
);
for
(
size_t
i
=
0
;
i
<
numOfMsgs
;
i
++
)
{
SRpcMsg
*
pRsp
=
NULL
;
SRpcMsg
*
pMsg
=
*
(
SRpcMsg
**
)
taosArrayGet
(
pArray
,
i
);
int32_t
code
=
vnodeApplyWMsg
(
pVnode
->
pImpl
,
pMsg
,
&
pRsp
);
if
(
pRsp
!=
NULL
)
{
rpcSendResponse
(
pRsp
);
free
(
pRsp
);
}
else
{
if
(
code
!=
0
)
code
=
terrno
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
ahandle
=
pMsg
->
ahandle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
}
}
for
(
size_t
i
=
0
;
i
<
numOfMsgs
;
i
++
)
{
SRpcMsg
*
pMsg
=
*
(
SRpcMsg
**
)
taosArrayGet
(
pArray
,
i
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
taosArrayDestroy
(
pArray
);
}
static
void
dndProcessVnodeApplyQueue
(
SVnodeObj
*
pVnode
,
taos_qall
qall
,
int32_t
numOfMsgs
)
{
...
...
@@ -876,6 +895,7 @@ static int32_t dndWriteRpcMsgToVnodeQueue(taos_queue pQueue, SRpcMsg *pRpcMsg) {
static
SVnodeObj
*
dndAcquireVnodeFromMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
SMsgHead
*
pHead
=
(
SMsgHead
*
)
pMsg
->
pCont
;
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
pHead
->
vgId
);
...
...
source/dnode/mgmt/impl/test/stb/stb.cpp
浏览文件 @
82a8ed2f
...
...
@@ -270,8 +270,6 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
taosMsleep
(
100000
);
}
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_STB
,
"show stables"
,
4
,
"1.d1"
);
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
82a8ed2f
...
...
@@ -344,7 +344,7 @@ static int32_t mndSetCreateStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetVgroupEpset
(
pMnode
,
pVgroup
);
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SCreateStbInternalMsg
);
action
.
contLen
=
htonl
(
pMsg
->
head
.
contLen
);
action
.
msgType
=
TSDB_MSG_TYPE_CREATE_STB_IN
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
...
...
source/dnode/vnode/impl/src/vnodeWrite.c
浏览文件 @
82a8ed2f
...
...
@@ -70,6 +70,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
vnodeParseReq
(
pMsg
->
pCont
,
&
vReq
,
pMsg
->
msgType
);
switch
(
pMsg
->
msgType
)
{
case
TSDB_MSG_TYPE_CREATE_STB_IN
:
case
TSDB_MSG_TYPE_CREATE_TABLE
:
if
(
metaCreateTable
(
pVnode
->
pMeta
,
&
(
vReq
.
ctReq
))
<
0
)
{
// TODO: handle error
...
...
@@ -77,6 +78,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
// TODO: maybe need to clear the requst struct
break
;
case
TSDB_MSG_TYPE_DROP_STB_IN
:
case
TSDB_MSG_TYPE_DROP_TABLE
:
if
(
metaDropTable
(
pVnode
->
pMeta
,
vReq
.
dtReq
.
uid
)
<
0
)
{
// TODO: handle error
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录