Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bd76ae52
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看板
未验证
提交
bd76ae52
编写于
7月 12, 2022
作者:
C
Cary Xu
提交者:
GitHub
7月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14811 from taosdata/feature/TD-11274-3.0
fix: use correct keep2 when set least ts for query
上级
94708723
0f7c2ebb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
10 deletion
+11
-10
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+7
-6
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+4
-4
未找到文件。
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
bd76ae52
...
...
@@ -65,9 +65,12 @@ struct SRSmaInfo {
static
SRSmaInfo
*
tdGetRSmaInfoByItem
(
SRSmaInfoItem
*
pItem
)
{
// adapt accordingly if definition of SRSmaInfo update
int32_t
rsmaInfoHeadLen
=
sizeof
(
int64_t
)
+
sizeof
(
STSchema
*
);
ASSERT
(
pItem
->
level
==
0
||
pItem
->
level
==
1
);
return
(
SRSmaInfo
*
)
POINTER_SHIFT
(
pItem
,
-
sizeof
(
SRSmaInfoItem
)
*
pItem
->
level
-
rsmaInfoHeadLen
);
SRSmaInfo
*
pResult
=
NULL
;
int32_t
rsmaInfoHeadLen
=
sizeof
(
int64_t
)
+
sizeof
(
STSchema
*
);
ASSERT
(
pItem
->
level
==
TSDB_RETENTION_L1
||
pItem
->
level
==
TSDB_RETENTION_L2
);
pResult
=
(
SRSmaInfo
*
)
POINTER_SHIFT
(
pItem
,
-
(
sizeof
(
SRSmaInfoItem
)
*
(
pItem
->
level
-
1
)
+
rsmaInfoHeadLen
));
ASSERT
(
pResult
->
pTSchema
->
numOfCols
>
1
);
return
pResult
;
}
struct
SRSmaQTaskInfoItem
{
...
...
@@ -276,7 +279,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
if
(
pItem
->
maxDelay
>
TSDB_MAX_ROLLUP_MAX_DELAY
)
{
pItem
->
maxDelay
=
TSDB_MAX_ROLLUP_MAX_DELAY
;
}
pItem
->
level
=
idx
;
pItem
->
level
=
idx
==
0
?
TSDB_RETENTION_L1
:
TSDB_RETENTION_L2
;
smaInfo
(
"vgId:%d table:%"
PRIi64
" level:%"
PRIi8
" maxdelay:%"
PRIi64
" watermark:%"
PRIi64
", finally maxdelay:%"
PRIi32
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
,
idx
+
1
,
param
->
maxdelay
[
idx
],
param
->
watermark
[
idx
],
pItem
->
maxDelay
);
...
...
@@ -1236,8 +1239,6 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
SRSmaInfo
*
pRSmaInfo
=
tdGetRSmaInfoByItem
(
pItem
);
ASSERT
(
pRSmaInfo
->
items
[
pItem
->
level
].
level
==
pItem
->
level
);
int8_t
fetchTriggerStat
=
atomic_val_compare_exchange_8
(
&
pItem
->
triggerStat
,
TASK_TRIGGER_STAT_ACTIVE
,
TASK_TRIGGER_STAT_INACTIVE
);
switch
(
fetchTriggerStat
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
bd76ae52
...
...
@@ -400,7 +400,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
pReader
->
idStr
=
(
idstr
!=
NULL
)
?
strdup
(
idstr
)
:
NULL
;
pReader
->
verRange
=
getQueryVerRange
(
pVnode
,
pCond
,
level
);
pReader
->
type
=
pCond
->
type
;
pReader
->
window
=
updateQueryTimeWindow
(
p
Vnode
->
pTsdb
,
&
pCond
->
twindows
);
pReader
->
window
=
updateQueryTimeWindow
(
p
Reader
->
pTsdb
,
&
pCond
->
twindows
);
ASSERT
(
pCond
->
numOfCols
>
0
);
...
...
@@ -2203,15 +2203,15 @@ static STsdb* getTsdbByRetentions(SVnode* pVnode, TSKEY winSKey, SRetention* ret
if
(
level
==
TSDB_RETENTION_L0
)
{
*
pLevel
=
TSDB_RETENTION_L0
;
tsdbDebug
(
"vgId:%d, r
ead handle %p r
sma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L0
,
str
);
tsdbDebug
(
"vgId:%d, rsma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L0
,
str
);
return
VND_RSMA0
(
pVnode
);
}
else
if
(
level
==
TSDB_RETENTION_L1
)
{
*
pLevel
=
TSDB_RETENTION_L1
;
tsdbDebug
(
"vgId:%d, r
ead handle %p r
sma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L1
,
str
);
tsdbDebug
(
"vgId:%d, rsma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L1
,
str
);
return
VND_RSMA1
(
pVnode
);
}
else
{
*
pLevel
=
TSDB_RETENTION_L2
;
tsdbDebug
(
"vgId:%d, r
ead handle %p r
sma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L2
,
str
);
tsdbDebug
(
"vgId:%d, rsma level %d is selected to query %s"
,
vgId
,
TSDB_RETENTION_L2
,
str
);
return
VND_RSMA2
(
pVnode
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录