Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
14e591c8
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
14e591c8
编写于
7月 18, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mem leak
上级
ad0b0c38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
86 addition
and
11 deletion
+86
-11
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+3
-5
tests/script/tsim/stream/checkpointInterval0.sim
tests/script/tsim/stream/checkpointInterval0.sim
+83
-6
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
14e591c8
...
@@ -2594,8 +2594,6 @@ int32_t doStreamIntervalEncodeOpState(void** buf, int32_t len, SOperatorInfo* pO
...
@@ -2594,8 +2594,6 @@ int32_t doStreamIntervalEncodeOpState(void** buf, int32_t len, SOperatorInfo* pO
while
((
pIte
=
tSimpleHashIterate
(
pInfo
->
aggSup
.
pResultRowHashTable
,
pIte
,
&
iter
))
!=
NULL
)
{
while
((
pIte
=
tSimpleHashIterate
(
pInfo
->
aggSup
.
pResultRowHashTable
,
pIte
,
&
iter
))
!=
NULL
)
{
void
*
key
=
taosHashGetKey
(
pIte
,
&
keyLen
);
void
*
key
=
taosHashGetKey
(
pIte
,
&
keyLen
);
tlen
+=
encodeSWinKey
(
buf
,
key
);
tlen
+=
encodeSWinKey
(
buf
,
key
);
SRowBuffPos
*
pPos
=
*
(
void
**
)
pIte
;
tlen
+=
encodeSRowBuffPos
(
buf
,
pPos
);
}
}
// 2.twAggSup
// 2.twAggSup
...
@@ -2655,10 +2653,10 @@ void doStreamIntervalDecodeOpState(void* buf, int32_t len, SOperatorInfo* pOpera
...
@@ -2655,10 +2653,10 @@ void doStreamIntervalDecodeOpState(void* buf, int32_t len, SOperatorInfo* pOpera
buf
=
taosDecodeFixedI32
(
buf
,
&
mapSize
);
buf
=
taosDecodeFixedI32
(
buf
,
&
mapSize
);
for
(
int32_t
i
=
0
;
i
<
mapSize
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
mapSize
;
i
++
)
{
SWinKey
key
=
{
0
};
SWinKey
key
=
{
0
};
SRowBuffPos
*
pPos
=
taosMemoryCalloc
(
1
,
sizeof
(
SRowBuffPos
));
pPos
->
pKey
=
taosMemoryCalloc
(
1
,
sizeof
(
SWinKey
));
buf
=
decodeSWinKey
(
buf
,
&
key
);
buf
=
decodeSWinKey
(
buf
,
&
key
);
buf
=
decodeSRowBuffPos
(
buf
,
pPos
);
SRowBuffPos
*
pPos
=
NULL
;
int32_t
resSize
=
pInfo
->
aggSup
.
resultRowSize
;
pInfo
->
stateStore
.
streamStateAddIfNotExist
(
pInfo
->
pState
,
&
key
,
(
void
**
)
&
pPos
,
&
resSize
);
tSimpleHashPut
(
pInfo
->
aggSup
.
pResultRowHashTable
,
&
key
,
sizeof
(
SWinKey
),
&
pPos
,
POINTER_BYTES
);
tSimpleHashPut
(
pInfo
->
aggSup
.
pResultRowHashTable
,
&
key
,
sizeof
(
SWinKey
),
&
pPos
,
POINTER_BYTES
);
}
}
...
...
tests/script/tsim/stream/checkpointInterval0.sim
浏览文件 @
14e591c8
...
@@ -14,6 +14,7 @@ sql use test;
...
@@ -14,6 +14,7 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
sql create table t1(ts timestamp, a int, b int , c int, d double);
sql create stream streams0 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt as select _wstart, count(*) c1, sum(a) from t1 interval(10s);
sql create stream streams0 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt as select _wstart, count(*) c1, sum(a) from t1 interval(10s);
sql create stream streams1 trigger window_close IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt1 as select _wstart, count(*) c1, sum(a) from t1 interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791213001,2,2,3,1.1);
sql insert into t1 values(1648791213001,2,2,3,1.1);
...
@@ -45,6 +46,23 @@ if $data02 != 3 then
...
@@ -45,6 +46,23 @@ if $data02 != 3 then
goto loop0
goto loop0
endi
endi
$loop_count = 0
loop01:
sleep 1000
sql select * from streamt1;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 0 then
print =====rows=$rows expect 1
goto loop01
endi
print waiting for checkpoint generation 1 ......
print waiting for checkpoint generation 1 ......
sleep 25000
sleep 25000
...
@@ -126,6 +144,36 @@ if $data12 != 4 then
...
@@ -126,6 +144,36 @@ if $data12 != 4 then
goto loop2
goto loop2
endi
endi
$loop_count = 0
loop3:
sleep 1000
print select * from streamt1;
sql select * from streamt1;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 1 then
print =====rows=$rows expect 2
goto loop3
endi
# row 0
if $data01 != 3 then
print =====data01=$data01
goto loop3
endi
if $data02 != 6 then
print =====data02=$data02
goto loop3
endi
print step 2
print step 2
print restart taosd 02 ......
print restart taosd 02 ......
...
@@ -136,7 +184,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -136,7 +184,7 @@ system sh/exec.sh -n dnode1 -s start
sql insert into t1 values(1648791223004,5,2,3,1.1);
sql insert into t1 values(1648791223004,5,2,3,1.1);
loop
20
:
loop
4
:
sleep 1000
sleep 1000
sql select * from streamt;
sql select * from streamt;
...
@@ -148,29 +196,58 @@ endi
...
@@ -148,29 +196,58 @@ endi
if $rows != 2 then
if $rows != 2 then
print =====rows=$rows expect 2
print =====rows=$rows expect 2
goto loop
20
goto loop
4
endi
endi
# row 0
# row 0
if $data01 != 3 then
if $data01 != 3 then
print =====data01=$data01
print =====data01=$data01
goto loop
20
goto loop
4
endi
endi
if $data02 != 6 then
if $data02 != 6 then
print =====data02=$data02
print =====data02=$data02
goto loop
20
goto loop
4
endi
endi
# row 1
# row 1
if $data11 != 2 then
if $data11 != 2 then
print =====data11=$data11
print =====data11=$data11
goto loop
20
goto loop
4
endi
endi
if $data12 != 9 then
if $data12 != 9 then
print =====data12=$data12
print =====data12=$data12
goto loop20
goto loop4
endi
$loop_count = 0
loop5:
sleep 1000
print select * from streamt1;
sql select * from streamt1;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 1 then
print =====rows=$rows expect 2
goto loop5
endi
# row 0
if $data01 != 3 then
print =====data01=$data01
goto loop5
endi
if $data02 != 6 then
print =====data02=$data02
goto loop5
endi
endi
print end---------------------------------
print end---------------------------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录