Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8928dea5
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看板
提交
8928dea5
编写于
2月 19, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs found in regression test.
上级
960d40d4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
59 deletion
+13
-59
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
src/system/detail/inc/vnodeQueryImpl.h
src/system/detail/inc/vnodeQueryImpl.h
+1
-1
src/system/detail/inc/vnodeRead.h
src/system/detail/inc/vnodeRead.h
+0
-3
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+6
-49
src/system/detail/src/vnodeQueryProcess.c
src/system/detail/src/vnodeQueryProcess.c
+3
-3
未找到文件。
src/client/src/tscServer.c
浏览文件 @
8928dea5
...
...
@@ -2795,7 +2795,7 @@ int tscBuildMetricMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
condLen
=
0
;
if
(
pTagCond
->
numOfTagCond
>
0
)
{
SCond
*
pCond
=
tsGetMetricQueryCondPos
(
pTagCond
,
uid
);
if
(
pCond
!=
NULL
)
{
if
(
pCond
!=
NULL
&&
pCond
->
cond
!=
NULL
)
{
condLen
=
strlen
(
pCond
->
cond
)
+
1
;
bool
ret
=
taosMbsToUcs4
(
pCond
->
cond
,
condLen
,
pMsg
,
condLen
*
TSDB_NCHAR_SIZE
);
...
...
src/client/src/tscUtil.c
浏览文件 @
8928dea5
...
...
@@ -64,7 +64,7 @@ void tscGetMetricMetaCacheKey(SQueryInfo* pQueryInfo, char* str, uint64_t uid) {
size_t
redundantLen
=
20
;
size_t
bufSize
=
strlen
(
pMeterMetaInfo
->
name
)
+
tbnameCondLen
+
strlen
(
join
)
+
strlen
(
tagIdBuf
);
if
(
cond
!=
NULL
)
{
if
(
cond
!=
NULL
&&
cond
->
cond
!=
NULL
)
{
bufSize
+=
strlen
(
cond
->
cond
);
}
...
...
@@ -72,7 +72,7 @@ void tscGetMetricMetaCacheKey(SQueryInfo* pQueryInfo, char* str, uint64_t uid) {
char
*
tmp
=
calloc
(
1
,
bufSize
);
int32_t
keyLen
=
snprintf
(
tmp
,
bufSize
,
"%s,%s,%s,%d,%s,[%s],%d"
,
pMeterMetaInfo
->
name
,
(
cond
!=
NULL
?
cond
->
cond
:
NULL
),
(
tbnameCondLen
>
0
?
pTagCond
->
tbnameCond
.
cond
:
NULL
),
(
(
cond
!=
NULL
&&
cond
->
cond
!=
NULL
)
?
cond
->
cond
:
NULL
),
(
tbnameCondLen
>
0
?
pTagCond
->
tbnameCond
.
cond
:
NULL
),
pTagCond
->
relType
,
join
,
tagIdBuf
,
pQueryInfo
->
groupbyExpr
.
orderType
);
assert
(
keyLen
<=
bufSize
);
...
...
src/system/detail/inc/vnodeQueryImpl.h
浏览文件 @
8928dea5
...
...
@@ -178,7 +178,7 @@ SCacheBlock* getCacheDataBlock(SMeterObj* pMeterObj, SQueryRuntimeEnv* pRuntimeE
// SMeterDataInfo* pDataHeadInfoEx, SField* pFields,
// __block_search_fn_t searchFn);
void
applyIntervalQuery
OnBlock
(
STableQuerySupportObj
*
pSupporter
,
SMeterDataInfo
*
pMeterDataInfo
,
void
stableApplyFunctions
OnBlock
(
STableQuerySupportObj
*
pSupporter
,
SMeterDataInfo
*
pMeterDataInfo
,
SBlockInfo
*
pBlockInfo
,
SField
*
pFields
,
__block_search_fn_t
searchFn
);
int32_t
vnodeFilterQualifiedMeters
(
SQInfo
*
pQInfo
,
int32_t
vid
,
tSidSet
*
pSidSet
,
SMeterDataInfo
*
pMeterDataInfo
,
...
...
src/system/detail/inc/vnodeRead.h
浏览文件 @
8928dea5
...
...
@@ -190,10 +190,7 @@ typedef struct SMeterQueryInfo {
int64_t
skey
;
int64_t
ekey
;
int32_t
numOfRes
;
// int32_t reverseIndex; // reversed output indicator, start from (numOfRes-1)
// int16_t reverseFillRes; // denote if reverse fill the results in supplementary scan required or not
int16_t
queryRangeSet
;
// denote if the query range is set, only available for interval query
int16_t
lastResRows
;
int64_t
tag
;
STSCursor
cur
;
int32_t
sid
;
// for retrieve the page id list
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
8928dea5
...
...
@@ -2473,7 +2473,7 @@ static void validateQueryRangeAndData(SQueryRuntimeEnv *pRuntimeEnv, const TSKEY
!
QUERY_IS_ASC_QUERY
(
pQuery
)));
}
static
int32_t
a
pplyFunctionsOnBlock
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SBlockInfo
*
pBlockInfo
,
int64_t
*
pPrimaryColumn
,
static
int32_t
tableA
pplyFunctionsOnBlock
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SBlockInfo
*
pBlockInfo
,
int64_t
*
pPrimaryColumn
,
SField
*
pFields
,
__block_search_fn_t
searchFn
,
int32_t
*
numOfRes
,
SWindowResInfo
*
pWindowResInfo
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
@@ -2482,7 +2482,6 @@ static int32_t applyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SBlockInfo *
int32_t
step
=
GET_FORWARD_DIRECTION_FACTOR
(
pQuery
->
order
.
order
);
int32_t
forwardStep
=
getNumOfRowsInTimeWindow
(
pQuery
,
pBlockInfo
,
pPrimaryColumn
,
pQuery
->
pos
,
pQuery
->
ekey
,
searchFn
,
true
);
assert
(
forwardStep
>=
0
);
int32_t
newForwardStep
=
reviseForwardSteps
(
pRuntimeEnv
,
forwardStep
);
...
...
@@ -5220,7 +5219,7 @@ static void doHandleDataBlockImpl(SQueryRuntimeEnv *pRuntimeEnv, SBlockInfo *pbl
*
pblockInfo
=
getBlockBasicInfo
(
pRuntimeEnv
,
pBlock
,
BLK_FILE_BLOCK
);
if
(
blockLoadStatus
==
DISK_DATA_LOADED
)
{
*
forwardStep
=
a
pplyFunctionsOnBlock
(
pRuntimeEnv
,
pblockInfo
,
primaryKeys
,
pQuery
->
pFields
[
pQuery
->
slot
],
*
forwardStep
=
tableA
pplyFunctionsOnBlock
(
pRuntimeEnv
,
pblockInfo
,
primaryKeys
,
pQuery
->
pFields
[
pQuery
->
slot
],
searchFn
,
numOfRes
,
&
pRuntimeEnv
->
windowResInfo
);
}
else
{
*
forwardStep
=
pblockInfo
->
size
;
...
...
@@ -5233,7 +5232,7 @@ static void doHandleDataBlockImpl(SQueryRuntimeEnv *pRuntimeEnv, SBlockInfo *pbl
SCacheBlock
*
pBlock
=
getCacheDataBlock
(
pRuntimeEnv
->
pMeterObj
,
pRuntimeEnv
,
pQuery
->
slot
);
*
pblockInfo
=
getBlockBasicInfo
(
pRuntimeEnv
,
pBlock
,
BLK_CACHE_BLOCK
);
*
forwardStep
=
a
pplyFunctionsOnBlock
(
pRuntimeEnv
,
pblockInfo
,
primaryKeys
,
NULL
,
searchFn
,
numOfRes
,
*
forwardStep
=
tableA
pplyFunctionsOnBlock
(
pRuntimeEnv
,
pblockInfo
,
primaryKeys
,
NULL
,
searchFn
,
numOfRes
,
&
pRuntimeEnv
->
windowResInfo
);
pSummary
->
cacheTimeUs
+=
(
taosGetTimestampUs
()
-
start
);
...
...
@@ -6567,7 +6566,6 @@ SMeterQueryInfo *createMeterQueryInfo(STableQuerySupportObj *pSupporter, int32_t
pMeterQueryInfo
->
ekey
=
ekey
;
pMeterQueryInfo
->
lastKey
=
skey
;
pMeterQueryInfo
->
lastResRows
=
0
;
pMeterQueryInfo
->
sid
=
sid
;
pMeterQueryInfo
->
cur
.
vnodeIndex
=
-
1
;
...
...
@@ -7130,7 +7128,6 @@ int32_t setIntervalQueryExecutionContext(STableQuerySupportObj *pSupporter, int3
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pSupporter
->
runtimeEnv
;
assert
(
pMeterQueryInfo
->
lastKey
>
0
);
// if (IS_MASTER_SCAN(pRuntimeEnv)) {
// not enough disk space or memory buffer for intermediate results
if
(
setOutputBufferForIntervalQuery
(
pRuntimeEnv
,
pMeterQueryInfo
)
!=
TSDB_CODE_SUCCESS
)
{
return
-
1
;
...
...
@@ -7185,33 +7182,12 @@ void setIntervalQueryRange(SMeterQueryInfo *pMeterQueryInfo, STableQuerySupportO
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
if
(
pMeterQueryInfo
->
queryRangeSet
)
{
// assert((QUERY_IS_ASC_QUERY(pQuery) && pQuery->lastKey >= pQuery->skey) ||
// (!QUERY_IS_ASC_QUERY(pQuery) && pQuery->lastKey <= pQuery->skey));
//
// if ((pQuery->ekey < key && QUERY_IS_ASC_QUERY(pQuery)) || (pQuery->ekey > key && !QUERY_IS_ASC_QUERY(pQuery)))
// {
// /*
// * last query on this block of the meter is done, start next interval on this block
// * otherwise, keep the previous query range and proceed
// */
// getAlignedIntervalQueryRange(pRuntimeEnv, key, pSupporter->rawSKey, pSupporter->rawEKey);
// saveIntervalQueryRange(pRuntimeEnv, pMeterQueryInfo);
//
// // previous query does not be closed, save the results and close it
// if (pMeterQueryInfo->lastResRows > 0) {
// saveResult(pSupporter, pMeterQueryInfo, pMeterQueryInfo->lastResRows);
// }
// } else {
// /* current query not completed, continue. do nothing with respect to query range, */
// }
// pQuery->lastKey = key;
// pMeterQueryInfo->lastKey = key;
pQuery
->
lastKey
=
key
;
pMeterQueryInfo
->
lastKey
=
key
;
}
else
{
pQuery
->
skey
=
key
;
STimeWindow
win
=
{.
skey
=
key
,
pSupporter
->
rawEKey
};
assert
(
pMeterQueryInfo
->
lastResRows
==
0
);
// for too small query range, no data in this interval.
if
((
QUERY_IS_ASC_QUERY
(
pQuery
)
&&
(
pQuery
->
ekey
<
pQuery
->
skey
))
||
(
!
QUERY_IS_ASC_QUERY
(
pQuery
)
&&
(
pQuery
->
skey
<
pQuery
->
ekey
)))
{
...
...
@@ -7530,7 +7506,7 @@ void copyFromWindowResToSData(SQInfo *pQInfo, SWindowResult *result) {
assert
(
pQuery
->
pointsRead
<=
pQuery
->
pointsToRead
);
}
void
applyIntervalQuery
OnBlock
(
STableQuerySupportObj
*
pSupporter
,
SMeterDataInfo
*
pMeterDataInfo
,
void
stableApplyFunctions
OnBlock
(
STableQuerySupportObj
*
pSupporter
,
SMeterDataInfo
*
pMeterDataInfo
,
SBlockInfo
*
pBlockInfo
,
SField
*
pFields
,
__block_search_fn_t
searchFn
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pSupporter
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
@@ -7539,17 +7515,6 @@ void applyIntervalQueryOnBlock(STableQuerySupportObj *pSupporter, SMeterDataInfo
int64_t
*
pPrimaryKey
=
(
int64_t
*
)
pRuntimeEnv
->
primaryColBuffer
->
data
;
int32_t
blockStatus
=
pRuntimeEnv
->
blockStatus
;
/*
* for each block, we need to handle the previous query, since the determination of previous query being completed
* or not is based on the start key of current block.
*/
TSKEY
key
=
getNextAccessedKeyInData
(
pQuery
,
pPrimaryKey
,
pBlockInfo
,
blockStatus
);
if
(
pQuery
->
intervalTime
>
0
)
{
setIntervalQueryRange
(
pMeterQueryInfo
,
pSupporter
,
key
);
}
int32_t
forwardStep
=
getNumOfRowsInTimeWindow
(
pQuery
,
pBlockInfo
,
pPrimaryKey
,
pQuery
->
pos
,
pQuery
->
ekey
,
searchFn
,
true
);
...
...
@@ -7571,14 +7536,6 @@ void applyIntervalQueryOnBlock(STableQuerySupportObj *pSupporter, SMeterDataInfo
}
}
// get the true maximum timestamp within the query range to set the correct time window
// in the supplementary query
// int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order);
// if ((pQuery->lastKey > pBlockInfo->keyLast && QUERY_IS_ASC_QUERY(pQuery)) ||
// (pQuery->lastKey < pBlockInfo->keyFirst && !QUERY_IS_ASC_QUERY(pQuery))) {
// pMeterQueryInfo->ekey = pQuery->lastKey - step;
// }
updatelastkey
(
pQuery
,
pMeterQueryInfo
);
}
...
...
src/system/detail/src/vnodeQueryProcess.c
浏览文件 @
8928dea5
...
...
@@ -211,6 +211,7 @@ static void queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMeterInfo) {
setExecutionContext
(
pSupporter
,
pRuntimeEnv
->
windowResInfo
.
pResult
,
k
,
pMeterInfo
[
k
].
groupIdx
,
pMeterQueryInfo
);
}
else
{
setIntervalQueryRange
(
pMeterQueryInfo
,
pSupporter
,
key
);
int32_t
ret
=
setIntervalQueryExecutionContext
(
pSupporter
,
k
,
pMeterQueryInfo
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
pQInfo
->
killed
=
1
;
...
...
@@ -230,7 +231,7 @@ static void queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMeterInfo) {
pRuntimeEnv
->
blockStatus
);
totalBlocks
++
;
applyIntervalQuery
OnBlock
(
pSupporter
,
&
pMeterInfo
[
k
],
&
binfo
,
NULL
,
searchFn
);
stableApplyFunctions
OnBlock
(
pSupporter
,
&
pMeterInfo
[
k
],
&
binfo
,
NULL
,
searchFn
);
if
(
ALL_CACHE_BLOCKS_CHECKED
(
pQuery
))
{
break
;
...
...
@@ -431,7 +432,6 @@ static void queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMeterDataInfo
pOneMeterDataInfo
->
groupIdx
,
pMeterQueryInfo
);
}
else
/* if (pQuery->intervalTime > 0)*/
{
// interval query
setIntervalQueryRange
(
pMeterQueryInfo
,
pSupporter
,
nextKey
);
ret
=
setIntervalQueryExecutionContext
(
pSupporter
,
pOneMeterDataInfo
->
meterOrderIdx
,
pMeterQueryInfo
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pReqMeterDataInfo
);
// error code has been set
...
...
@@ -440,7 +440,7 @@ static void queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMeterDataInfo
}
}
applyIntervalQuery
OnBlock
(
pSupporter
,
pOneMeterDataInfo
,
&
binfo
,
pInfoEx
->
pBlock
.
fields
,
searchFn
);
stableApplyFunctions
OnBlock
(
pSupporter
,
pOneMeterDataInfo
,
&
binfo
,
pInfoEx
->
pBlock
.
fields
,
searchFn
);
}
tfree
(
pReqMeterDataInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录