Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
05c8a42d
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
未验证
提交
05c8a42d
编写于
5月 12, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
5月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1879 from taosdata/hotfix/syncCrash
forward to peer only the data packet is from client or CQ
上级
d7e03ac0
3366f4af
变更
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
浏览文件 @
05c8a42d
...
...
@@ -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
浏览文件 @
05c8a42d
...
...
@@ -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
浏览文件 @
05c8a42d
...
...
@@ -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,22 +61,24 @@ 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
;
// write into WAL
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录