Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
7bcd7447
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看板
提交
7bcd7447
编写于
8月 13, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] return error code in tsdb to client during the data retrieval.
上级
607d4fd2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
16 deletion
+37
-16
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+2
-2
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+5
-0
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+19
-6
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+11
-8
未找到文件。
src/dnode/src/dnodeVRead.c
浏览文件 @
7bcd7447
...
...
@@ -211,8 +211,8 @@ static void *dnodeProcessReadQueue(void *param) {
dnodeSendRpcReadRsp
(
pVnode
,
pReadMsg
,
code
);
}
else
{
if
(
code
==
TSDB_CODE_QRY_HAS_RSP
)
{
dnodeSendRpcReadRsp
(
pVnode
,
pReadMsg
,
TSDB_CODE_SUCCESS
);
}
else
{
dnodeSendRpcReadRsp
(
pVnode
,
pReadMsg
,
pReadMsg
->
rpcMsg
.
code
);
}
else
{
// code == TSDB_CODE_NOT_READY, do not return msg to client
dnodeDispatchNonRspMsg
(
pVnode
,
pReadMsg
,
code
);
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
7bcd7447
...
...
@@ -2338,6 +2338,11 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
continue
;
}
if
(
terrno
!=
TSDB_CODE_SUCCESS
)
{
// load data block failed, abort query
longjmp
(
pRuntimeEnv
->
env
,
terrno
);
break
;
}
// query start position can not move into tableApplyFunctionsOnBlock due to limit/offset condition
pQuery
->
pos
=
QUERY_IS_ASC_QUERY
(
pQuery
)
?
0
:
blockInfo
.
rows
-
1
;
int32_t
numOfRes
=
tableApplyFunctionsOnBlock
(
pRuntimeEnv
,
&
blockInfo
,
pStatis
,
binarySearchForKey
,
pDataBlock
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
7bcd7447
...
...
@@ -679,7 +679,13 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
if
(
pCheckInfo
->
pDataCols
==
NULL
)
{
STsdbMeta
*
pMeta
=
tsdbGetMeta
(
pRepo
);
pCheckInfo
->
pDataCols
=
tdNewDataCols
(
pMeta
->
maxRowBytes
,
pMeta
->
maxCols
,
pRepo
->
config
.
maxRowsPerFileBlock
);
if
(
pCheckInfo
->
pDataCols
==
NULL
)
{
tsdbError
(
"%p failed to malloc buf, %p"
,
pQueryHandle
,
pQueryHandle
->
qinfo
);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
blockLoaded
;
}
}
STSchema
*
pSchema
=
tsdbGetTableSchema
(
pCheckInfo
->
pTableObj
);
...
...
@@ -745,7 +751,11 @@ static void handleDataMergeIfNeeded(STsdbQueryHandle* pQueryHandle, SCompBlock*
return
;
}
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
,
cur
->
slot
);
// return error, add test cases
if
(
!
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
,
cur
->
slot
))
{
}
doMergeTwoLevelData
(
pQueryHandle
,
pCheckInfo
,
pBlock
);
}
else
{
/*
...
...
@@ -1714,9 +1724,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
STableCheckInfo
info
=
{
.
lastKey
=
pSecQueryHandle
->
window
.
skey
,
//.tableId = pCheckInfo->tableId,
.
pTableObj
=
pCheckInfo
->
pTableObj
,
};
info
.
tableId
=
pCheckInfo
->
tableId
;
taosArrayPush
(
pSecQueryHandle
->
pTableCheckInfo
,
&
info
);
...
...
@@ -1726,8 +1736,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
tsdbInitCompBlockLoadInfo
(
&
pSecQueryHandle
->
compBlockLoadInfo
);
pSecQueryHandle
->
defaultLoadColumn
=
taosArrayClone
(
pQueryHandle
->
defaultLoadColumn
);
bool
ret
=
tsdbNextDataBlock
((
void
*
)
pSecQueryHandle
);
assert
(
ret
);
if
(
!
tsdbNextDataBlock
((
void
*
)
pSecQueryHandle
))
{
return
false
;
}
tsdbRetrieveDataBlockInfo
((
void
*
)
pSecQueryHandle
,
&
blockInfo
);
tsdbRetrieveDataBlock
((
void
*
)
pSecQueryHandle
,
pSecQueryHandle
->
defaultLoadColumn
);
...
...
@@ -1770,7 +1781,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
bool
exists
=
true
;
int32_t
code
=
getDataBlocksInFiles
(
pQueryHandle
,
&
exists
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
fals
e
;
return
cod
e
;
}
if
(
exists
)
{
...
...
@@ -2048,8 +2059,10 @@ SArray* tsdbRetrieveDataBlock(TsdbQueryHandleT* pQueryHandle, SArray* pIdList) {
return
pHandle
->
pColumns
;
}
else
{
// only load the file block
SCompBlock
*
pBlock
=
pBlockInfo
->
compBlock
;
doLoadFileDataBlock
(
pHandle
,
pBlock
,
pCheckInfo
,
pHandle
->
cur
.
slot
);
if
(
!
doLoadFileDataBlock
(
pHandle
,
pBlock
,
pCheckInfo
,
pHandle
->
cur
.
slot
))
{
return
NULL
;
}
// todo refactor
int32_t
numOfRows
=
copyDataFromFileBlock
(
pHandle
,
pHandle
->
outputCapacity
,
0
,
0
,
pBlock
->
numOfRows
-
1
);
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
7bcd7447
...
...
@@ -93,8 +93,11 @@ static int32_t vnodeDumpQueryResult(SRspRet *pRet, void* pVnode, void** handle,
vDebug
(
"QInfo:%p exec completed, free handle:%d"
,
*
handle
,
*
freeHandle
);
}
}
else
{
pRet
->
rsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableRsp
));
memset
(
pRet
->
rsp
,
0
,
sizeof
(
SRetrieveTableRsp
));
SRetrieveTableRsp
*
pRsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableRsp
));
memset
(
pRsp
,
0
,
sizeof
(
SRetrieveTableRsp
));
pRsp
->
completed
=
true
;
pRet
->
rsp
=
pRsp
;
*
freeHandle
=
true
;
}
...
...
@@ -200,18 +203,18 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
vDebug
(
"vgId:%d, QInfo:%p, start to build retrieval rsp after query paused, %p"
,
pVnode
->
vgId
,
*
qhandle
,
pReadMsg
->
rpcMsg
.
handle
);
code
=
vnodeDumpQueryResult
(
&
pReadMsg
->
rspRet
,
pVnode
,
qhandle
,
&
freehandle
);
// todo test the error code case
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
TSDB_CODE_QRY_HAS_RSP
;
}
// set the real rsp error code
pReadMsg
->
rpcMsg
.
code
=
vnodeDumpQueryResult
(
&
pReadMsg
->
rspRet
,
pVnode
,
qhandle
,
&
freehandle
);
// NOTE: set return code to be TSDB_CODE_QRY_HAS_RSP to notify dnode to return msg to client
code
=
TSDB_CODE_QRY_HAS_RSP
;
}
else
{
freehandle
=
qQueryCompleted
(
*
qhandle
);
}
// NOTE: if the qhandle is not put into vread queue or query is completed, free the qhandle.
//
if not build result, free it not by forced.
//
If the building of result is not required, simply free it. Otherwise, mandatorily free the qhandle
if
(
freehandle
||
(
!
buildRes
))
{
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
qhandle
,
freehandle
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录