Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3366f4af
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3366f4af
编写于
5月 11, 2020
作者:
J
jtao1735
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
forward to peer only the data packet is from client or CQ
上级
d7e03ac0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
13 deletion
+12
-13
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+2
-2
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+3
-3
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+7
-8
未找到文件。
src/vnode/src/vnodeMain.c
浏览文件 @
3366f4af
...
...
@@ -405,9 +405,9 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
static
void
vnodeNotifyFileSynced
(
void
*
ahandle
)
{
SVnodeObj
*
pVnode
=
ahandle
;
vTrace
(
"
pVnode:%p vgId:%d, data file is synced"
,
pVnode
,
pVnode
->
vgId
);
vTrace
(
"
vgId:%d, data file is synced"
,
pVnode
->
vgId
);
// cl
so
e tsdb, then open tsdb
// cl
os
e tsdb, then open tsdb
}
static
int32_t
vnodeSaveCfg
(
SMDCreateVnodeMsg
*
pVnodeCfg
)
{
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
3366f4af
...
...
@@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
pRet
->
len
=
sizeof
(
SQueryTableRsp
);
pRet
->
rsp
=
pRsp
;
vTrace
(
"vgId:%d QInfo:%p, dnode query msg disposed"
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d
,
QInfo:%p, dnode query msg disposed"
,
pVnode
->
vgId
,
pQInfo
);
}
else
{
pQInfo
=
pCont
;
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
@@ -83,7 +83,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
int32_t
code
=
TSDB_CODE_SUCCESS
;
vTrace
(
"vgId:%d QInfo:%p, retrieve msg is received"
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d
,
QInfo:%p, retrieve msg is received"
,
pVnode
->
vgId
,
pQInfo
);
pRet
->
code
=
qRetrieveQueryResultInfo
(
pQInfo
);
if
(
pRet
->
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -104,6 +104,6 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
}
}
vTrace
(
"vgId:%d QInfo:%p, retrieve msg is disposed"
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d
,
QInfo:%p, retrieve msg is disposed"
,
pVnode
->
vgId
,
pQInfo
);
return
code
;
}
src/vnode/src/vnodeWrite.c
浏览文件 @
3366f4af
...
...
@@ -51,10 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if
(
vnodeProcessWriteMsgFp
[
pHead
->
msgType
]
==
NULL
)
return
TSDB_CODE_MSG_NOT_PROCESSED
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
&&
qtype
==
TAOS_QTYPE_RPC
)
return
TSDB_CODE_NOT_ACTIVE_VNODE
;
if
(
pHead
->
version
==
0
)
{
// from client
if
(
pHead
->
version
==
0
)
{
// from client or CQ
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
return
TSDB_CODE_NOT_ACTIVE_VNODE
;
...
...
@@ -64,12 +61,10 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
// assign version
pVnode
->
version
++
;
pHead
->
version
=
pVnode
->
version
;
}
else
{
}
else
{
// from wal or forward
// for data from WAL or forward, version may be smaller
if
(
pHead
->
version
<=
pVnode
->
version
)
return
0
;
}
// more status and role checking here
pVnode
->
version
=
pHead
->
version
;
...
...
@@ -77,9 +72,13 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
code
=
walWrite
(
pVnode
->
wal
,
pHead
);
if
(
code
<
0
)
return
code
;
int32_t
syncCode
=
syncForwardToPeer
(
pVnode
->
sync
,
pHead
,
item
);
// forward to peers if data is from RPC or CQ
int32_t
syncCode
=
0
;
if
(
qtype
==
TAOS_QTYPE_RPC
||
qtype
==
TAOS_QTYPE_CQ
)
syncCode
=
syncForwardToPeer
(
pVnode
->
sync
,
pHead
,
item
);
if
(
syncCode
<
0
)
return
syncCode
;
// write data locally
code
=
(
*
vnodeProcessWriteMsgFp
[
pHead
->
msgType
])(
pVnode
,
pHead
->
cont
,
item
);
if
(
code
<
0
)
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录