Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
cc2dfbf5
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc2dfbf5
编写于
4月 05, 2020
作者:
J
Jeff Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add code for write response
上级
ff41901d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
14 deletion
+32
-14
src/dnode/inc/vnode.h
src/dnode/inc/vnode.h
+5
-0
src/dnode/src/dnodeRead.c
src/dnode/src/dnodeRead.c
+1
-1
src/dnode/src/dnodeWrite.c
src/dnode/src/dnodeWrite.c
+3
-2
src/dnode/src/vnodeWrite.c
src/dnode/src/vnodeWrite.c
+23
-11
未找到文件。
src/dnode/inc/vnode.h
浏览文件 @
cc2dfbf5
...
...
@@ -20,6 +20,11 @@
extern
"C"
{
#endif
typedef
struct
{
int
len
;
void
*
rsp
;
}
SRspRet
;
int32_t
vnodeInitWrite
();
int32_t
vnodeCreate
(
SMDCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeDrop
(
int32_t
vgId
);
...
...
src/dnode/src/dnodeRead.c
浏览文件 @
cc2dfbf5
...
...
@@ -289,7 +289,7 @@ static void dnodeProcessRetrieveMsg(void *pVnode, SReadMsg *pMsg) {
dnodeContinueExecuteQuery
(
pVnode
,
pQInfo
,
pMsg
);
}
else
{
// no further execution invoked, release the ref to vnode
dnodeProcessReadResult
(
pVnode
,
pMsg
);
dnodeReleaseVnod
e
(
pVnode
);
vnodeReleas
e
(
pVnode
);
}
}
...
...
src/dnode/src/dnodeWrite.c
浏览文件 @
cc2dfbf5
...
...
@@ -34,6 +34,7 @@ typedef struct {
}
SWriteWorker
;
typedef
struct
{
SRspRet
rspRet
;
void
*
pCont
;
int32_t
contLen
;
SRpcMsg
rpcMsg
;
...
...
@@ -148,8 +149,8 @@ void dnodeSendRpcWriteRsp(void *pVnode, void *param, int32_t code) {
SRpcMsg
rpcRsp
=
{
.
handle
=
pWrite
->
rpcMsg
.
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
pCont
=
pWrite
->
rspRet
.
rsp
,
.
contLen
=
pWrite
->
rspRet
.
len
,
.
code
=
code
,
};
...
...
src/dnode/src/vnodeWrite.c
浏览文件 @
cc2dfbf5
...
...
@@ -29,11 +29,11 @@
#include "vnodeInt.h"
static
int32_t
(
*
vnodeProcessWriteMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SVnodeObj
*
,
void
*
,
void
*
);
static
int32_t
vnodeProcessSubmitMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
void
*
);
static
int32_t
vnodeProcessCreateTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
void
*
);
static
int32_t
vnodeProcessDropTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
void
*
);
static
int32_t
vnodeProcessAlterTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
void
*
);
static
int32_t
vnodeProcessDropStableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
void
*
);
static
int32_t
vnodeProcessSubmitMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
SRspRet
*
);
static
int32_t
vnodeProcessCreateTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
SRspRet
*
);
static
int32_t
vnodeProcessDropTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
SRspRet
*
);
static
int32_t
vnodeProcessAlterTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
SRspRet
*
);
static
int32_t
vnodeProcessDropStableMsg
(
SVnodeObj
*
pVnode
,
void
*
pMsg
,
SRspRet
*
);
int32_t
vnodeInitWrite
()
{
vnodeProcessWriteMsgFp
[
TSDB_MSG_TYPE_SUBMIT
]
=
vnodeProcessSubmitMsg
;
...
...
@@ -49,6 +49,9 @@ int32_t vnodeProcessWrite(void *param, int qtype, SWalHead *pHead, void *item) {
int32_t
code
=
0
;
SVnodeObj
*
pVnode
=
(
SVnodeObj
*
)
param
;
if
(
vnodeProcessWriteMsgFp
[
pHead
->
msgType
]
==
NULL
)
return
TSDB_CODE_MSG_NOT_PROCESSED
;
if
(
pVnode
->
status
==
VN_STATUS_DELETING
||
pVnode
->
status
==
VN_STATUS_CLOSING
)
return
TSDB_CODE_NOT_ACTIVE_VNODE
;
...
...
@@ -73,7 +76,7 @@ int32_t vnodeProcessWrite(void *param, int qtype, SWalHead *pHead, void *item) {
// write into WAL
code
=
walWrite
(
pVnode
->
wal
,
pHead
);
if
(
code
<
0
)
return
code
;
code
=
(
*
vnodeProcessWriteMsgFp
[
pHead
->
msgType
])(
pVnode
,
pHead
->
cont
,
item
);
if
(
code
<
0
)
return
code
;
...
...
@@ -86,7 +89,7 @@ int32_t vnodeProcessWrite(void *param, int qtype, SWalHead *pHead, void *item) {
return
code
;
}
static
int32_t
vnodeProcessSubmitMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
void
*
item
)
{
static
int32_t
vnodeProcessSubmitMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
int32_t
code
=
0
;
// save insert result into item
...
...
@@ -94,10 +97,19 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, void *item)
dTrace
(
"pVnode:%p vgId:%d, submit msg is processed"
,
pVnode
,
pVnode
->
vgId
);
code
=
tsdbInsertData
(
pVnode
->
tsdb
,
pCont
);
pRet
->
len
=
sizeof
(
SShellSubmitRspMsg
);
pRet
->
rsp
=
rpcMallocCont
(
pRet
->
len
);
SShellSubmitRspMsg
*
pRsp
=
pRet
->
rsp
;
pRsp
->
code
=
0
;
pRsp
->
numOfRows
=
htonl
(
1
);
pRsp
->
affectedRows
=
htonl
(
1
);
pRsp
->
numOfFailedBlocks
=
0
;
return
code
;
}
static
int32_t
vnodeProcessCreateTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
void
*
item
)
{
static
int32_t
vnodeProcessCreateTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
SMDCreateTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
...
...
@@ -153,7 +165,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, void *
return
code
;
}
static
int32_t
vnodeProcessDropTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
void
*
item
)
{
static
int32_t
vnodeProcessDropTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
SMDDropTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
...
...
@@ -168,7 +180,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, void *it
return
code
;
}
static
int32_t
vnodeProcessAlterTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
void
*
item
)
{
static
int32_t
vnodeProcessAlterTableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
SMDCreateTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
...
...
@@ -223,7 +235,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, void *i
return
code
;
}
static
int32_t
vnodeProcessDropStableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
void
*
item
)
{
static
int32_t
vnodeProcessDropStableMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
SMDDropSTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录