Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
fa2a96e5
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看板
提交
fa2a96e5
编写于
6月 08, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-549] fix crash while vread return TSDB_CODE_NOT_READY errno
上级
353dc70f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
20 addition
and
14 deletion
+20
-14
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+3
-2
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/inc/vnode.h
src/inc/vnode.h
+0
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+16
-10
未找到文件。
src/dnode/src/dnodeVRead.c
浏览文件 @
fa2a96e5
...
...
@@ -192,13 +192,14 @@ void dnodeSendRpcReadRsp(void *pVnode, SReadMsg *pRead, int32_t code) {
if
(
code
==
TSDB_CODE_VND_ACTION_IN_PROGRESS
)
return
;
if
(
code
==
TSDB_CODE_VND_ACTION_NEED_REPROCESSED
)
{
dnodeContinueExecuteQuery
(
pVnode
,
pRead
->
rspRet
.
qhandle
,
pRead
);
code
=
TSDB_CODE_SUCCESS
;
}
SRpcMsg
rpcRsp
=
{
.
handle
=
pRead
->
rpcMsg
.
handle
,
.
pCont
=
pRead
->
rspRet
.
rsp
,
.
contLen
=
pRead
->
rspRet
.
len
,
.
code
=
pRead
->
rspRet
.
code
,
.
code
=
code
,
};
rpcSendResponse
(
&
rpcRsp
);
...
...
@@ -216,7 +217,7 @@ static void *dnodeProcessReadQueue(void *param) {
break
;
}
dTrace
(
"%p, msg:%s will be processed"
,
pReadMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pReadMsg
->
rpcMsg
.
msgType
]);
dTrace
(
"%p, msg:%s will be processed
in vread queue
"
,
pReadMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pReadMsg
->
rpcMsg
.
msgType
]);
int32_t
code
=
vnodeProcessRead
(
pVnode
,
pReadMsg
->
rpcMsg
.
msgType
,
pReadMsg
->
pCont
,
pReadMsg
->
contLen
,
&
pReadMsg
->
rspRet
);
dnodeSendRpcReadRsp
(
pVnode
,
pReadMsg
,
code
);
taosFreeQitem
(
pReadMsg
);
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
fa2a96e5
...
...
@@ -216,7 +216,7 @@ static void *dnodeProcessWriteQueue(void *param) {
pHead
->
msgType
=
pWrite
->
rpcMsg
.
msgType
;
pHead
->
version
=
0
;
pHead
->
len
=
pWrite
->
contLen
;
dTrace
(
"%p, msg:%s will be processed"
,
pWrite
->
rpcMsg
.
ahandle
,
taosMsg
[
pWrite
->
rpcMsg
.
msgType
]);
dTrace
(
"%p, msg:%s will be processed
in vwrite queue
"
,
pWrite
->
rpcMsg
.
ahandle
,
taosMsg
[
pWrite
->
rpcMsg
.
msgType
]);
}
else
{
pHead
=
(
SWalHead
*
)
item
;
}
...
...
src/inc/vnode.h
浏览文件 @
fa2a96e5
...
...
@@ -30,7 +30,6 @@ typedef enum _VN_STATUS {
typedef
struct
{
int
len
;
int
code
;
void
*
rsp
;
void
*
qhandle
;
//used by query and retrieve msg
}
SRspRet
;
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
fa2a96e5
...
...
@@ -39,15 +39,21 @@ void vnodeInitReadFp(void) {
int32_t
vnodeProcessRead
(
void
*
param
,
int
msgType
,
void
*
pCont
,
int32_t
contLen
,
SRspRet
*
ret
)
{
SVnodeObj
*
pVnode
=
(
SVnodeObj
*
)
param
;
if
(
vnodeProcessReadMsgFp
[
msgType
]
==
NULL
)
if
(
vnodeProcessReadMsgFp
[
msgType
]
==
NULL
)
{
vTrace
(
"vgId:%d, msgType:%s not processed, no handle"
,
pVnode
->
vgId
,
taosMsg
[
msgType
]);
return
TSDB_CODE_VND_MSG_NOT_PROCESSED
;
}
if
(
pVnode
->
status
==
TAOS_VN_STATUS_DELETING
||
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
if
(
pVnode
->
status
==
TAOS_VN_STATUS_DELETING
||
pVnode
->
status
==
TAOS_VN_STATUS_CLOSING
)
{
vTrace
(
"vgId:%d, msgType:%s not processed, vnode status is %d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
status
);
return
TSDB_CODE_VND_INVALID_VGROUP_ID
;
}
// TODO: Later, let slave to support query
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
if
(
pVnode
->
syncCfg
.
replica
>
1
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
vTrace
(
"vgId:%d, msgType:%s not processed, replica:%d role:%d"
,
pVnode
->
vgId
,
taosMsg
[
msgType
],
pVnode
->
syncCfg
.
replica
,
pVnode
->
role
);
return
TSDB_CODE_RPC_NOT_READY
;
}
return
(
*
vnodeProcessReadMsgFp
[
msgType
])(
pVnode
,
pCont
,
contLen
,
ret
);
}
...
...
@@ -60,11 +66,11 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
qinfo_t
pQInfo
=
NULL
;
if
(
contLen
!=
0
)
{
pRet
->
code
=
qCreateQueryInfo
(
pVnode
->
tsdb
,
pVnode
->
vgId
,
pQueryTableMsg
,
&
pQInfo
);
code
=
qCreateQueryInfo
(
pVnode
->
tsdb
,
pVnode
->
vgId
,
pQueryTableMsg
,
&
pQInfo
);
SQueryTableRsp
*
pRsp
=
(
SQueryTableRsp
*
)
rpcMallocCont
(
sizeof
(
SQueryTableRsp
));
pRsp
->
qhandle
=
htobe64
((
uint64_t
)
(
pQInfo
));
pRsp
->
code
=
pRet
->
code
;
pRsp
->
code
=
code
;
pRet
->
len
=
sizeof
(
SQueryTableRsp
);
pRet
->
rsp
=
pRsp
;
...
...
@@ -74,9 +80,11 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
assert
(
pCont
!=
NULL
);
pQInfo
=
pCont
;
code
=
TSDB_CODE_VND_ACTION_IN_PROGRESS
;
vTrace
(
"vgId:%d, QInfo:%p, dnode query msg in progress"
,
pVnode
->
vgId
,
pQInfo
);
}
if
(
pQInfo
!=
NULL
)
{
vTrace
(
"vgId:%d, QInfo:%p, do qTableQuery"
,
pVnode
->
vgId
,
pQInfo
);
qTableQuery
(
pQInfo
);
// do execute query
}
...
...
@@ -88,18 +96,16 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
void
*
pQInfo
=
(
void
*
)
htobe64
(
pRetrieve
->
qhandle
);
memset
(
pRet
,
0
,
sizeof
(
SRspRet
));
int32_t
code
=
TSDB_CODE_SUCCESS
;
vTrace
(
"vgId:%d, QInfo:%p, retrieve msg is received"
,
pVnode
->
vgId
,
pQInfo
);
pRet
->
code
=
qRetrieveQueryResultInfo
(
pQInfo
);
if
(
pRet
->
code
!=
TSDB_CODE_SUCCESS
)
{
int32_t
code
=
qRetrieveQueryResultInfo
(
pQInfo
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
//TODO
pRet
->
rsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableRsp
));
memset
(
pRet
->
rsp
,
0
,
sizeof
(
SRetrieveTableRsp
));
}
else
{
// todo check code and handle error in build result set
pRet
->
code
=
qDumpRetrieveResult
(
pQInfo
,
(
SRetrieveTableRsp
**
)
&
pRet
->
rsp
,
&
pRet
->
len
);
code
=
qDumpRetrieveResult
(
pQInfo
,
(
SRetrieveTableRsp
**
)
&
pRet
->
rsp
,
&
pRet
->
len
);
if
(
qHasMoreResultsToRetrieve
(
pQInfo
))
{
pRet
->
qhandle
=
pQInfo
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录