Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fabd96de
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看板
提交
fabd96de
编写于
3月 29, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: coverity scan for sma
上级
eb301a1d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
286 addition
and
32 deletion
+286
-32
source/dnode/vnode/src/inc/sma.h
source/dnode/vnode/src/inc/sma.h
+10
-0
source/dnode/vnode/src/sma/smaCommit.c
source/dnode/vnode/src/sma/smaCommit.c
+3
-15
source/dnode/vnode/src/sma/smaEnv.c
source/dnode/vnode/src/sma/smaEnv.c
+1
-5
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+30
-10
tests/script/tsim/sma/rsmaPersistenceRecovery.sim
tests/script/tsim/sma/rsmaPersistenceRecovery.sim
+242
-2
未找到文件。
source/dnode/vnode/src/inc/sma.h
浏览文件 @
fabd96de
...
@@ -159,9 +159,11 @@ struct SRSmaInfo {
...
@@ -159,9 +159,11 @@ struct SRSmaInfo {
void
*
taskInfo
[
TSDB_RETENTION_L2
];
// qTaskInfo_t
void
*
taskInfo
[
TSDB_RETENTION_L2
];
// qTaskInfo_t
STaosQueue
*
queue
;
// buffer queue of SubmitReq
STaosQueue
*
queue
;
// buffer queue of SubmitReq
STaosQall
*
qall
;
// buffer qall of SubmitReq
STaosQall
*
qall
;
// buffer qall of SubmitReq
#if 0
void *iTaskInfo[TSDB_RETENTION_L2]; // immutable qTaskInfo_t
void *iTaskInfo[TSDB_RETENTION_L2]; // immutable qTaskInfo_t
STaosQueue *iQueue; // immutable buffer queue of SubmitReq
STaosQueue *iQueue; // immutable buffer queue of SubmitReq
STaosQall *iQall; // immutable buffer qall of SubmitReq
STaosQall *iQall; // immutable buffer qall of SubmitReq
#endif
};
};
#define RSMA_INFO_HEAD_LEN offsetof(SRSmaInfo, items)
#define RSMA_INFO_HEAD_LEN offsetof(SRSmaInfo, items)
...
@@ -209,6 +211,14 @@ static FORCE_INLINE void tdUnRefSmaStat(SSma *pSma, SSmaStat *pStat) {
...
@@ -209,6 +211,14 @@ static FORCE_INLINE void tdUnRefSmaStat(SSma *pSma, SSmaStat *pStat) {
smaDebug
(
"vgId:%d, unref sma stat:%p, val:%d"
,
SMA_VID
(
pSma
),
pStat
,
ref
);
smaDebug
(
"vgId:%d, unref sma stat:%p, val:%d"
,
SMA_VID
(
pSma
),
pStat
,
ref
);
}
}
static
FORCE_INLINE
void
tdSmaLoopsCheck
(
int32_t
*
pCnt
,
int32_t
limit
)
{
++
(
*
pCnt
);
if
(
*
pCnt
>
limit
)
{
sched_yield
();
*
pCnt
=
0
;
}
}
int32_t
smaPreClose
(
SSma
*
pSma
);
int32_t
smaPreClose
(
SSma
*
pSma
);
// rsma
// rsma
...
...
source/dnode/vnode/src/sma/smaCommit.c
浏览文件 @
fabd96de
...
@@ -150,11 +150,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
...
@@ -150,11 +150,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
atomic_store_8
(
RSMA_TRIGGER_STAT
(
pRSmaStat
),
TASK_TRIGGER_STAT_PAUSED
);
atomic_store_8
(
RSMA_TRIGGER_STAT
(
pRSmaStat
),
TASK_TRIGGER_STAT_PAUSED
);
if
(
isCommit
)
{
if
(
isCommit
)
{
while
(
atomic_val_compare_exchange_8
(
RSMA_COMMIT_STAT
(
pRSmaStat
),
0
,
1
)
!=
0
)
{
while
(
atomic_val_compare_exchange_8
(
RSMA_COMMIT_STAT
(
pRSmaStat
),
0
,
1
)
!=
0
)
{
++
nLoops
;
tdSmaLoopsCheck
(
&
nLoops
,
1000
);
if
(
nLoops
>
1000
)
{
sched_yield
();
nLoops
=
0
;
}
}
}
pRSmaStat
->
commitAppliedVer
=
pSma
->
pVnode
->
state
.
applied
;
pRSmaStat
->
commitAppliedVer
=
pSma
->
pVnode
->
state
.
applied
;
...
@@ -173,11 +169,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
...
@@ -173,11 +169,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
}
else
{
}
else
{
smaDebug
(
"vgId:%d, rsma commit%d, fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
),
isCommit
);
smaDebug
(
"vgId:%d, rsma commit%d, fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
),
isCommit
);
}
}
++
nLoops
;
tdSmaLoopsCheck
(
&
nLoops
,
1000
);
if
(
nLoops
>
1000
)
{
sched_yield
();
nLoops
=
0
;
}
}
}
/**
/**
...
@@ -189,11 +181,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
...
@@ -189,11 +181,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
(
void
*
)
taosGetSelfPthreadId
());
(
void
*
)
taosGetSelfPthreadId
());
nLoops
=
0
;
nLoops
=
0
;
while
(
atomic_load_64
(
&
pRSmaStat
->
nBufItems
)
>
0
)
{
while
(
atomic_load_64
(
&
pRSmaStat
->
nBufItems
)
>
0
)
{
++
nLoops
;
tdSmaLoopsCheck
(
&
nLoops
,
1000
);
if
(
nLoops
>
1000
)
{
sched_yield
();
nLoops
=
0
;
}
}
}
if
(
!
isCommit
)
goto
_exit
;
if
(
!
isCommit
)
goto
_exit
;
...
...
source/dnode/vnode/src/sma/smaEnv.c
浏览文件 @
fabd96de
...
@@ -278,11 +278,7 @@ static void tdDestroyRSmaStat(void *pRSmaStat) {
...
@@ -278,11 +278,7 @@ static void tdDestroyRSmaStat(void *pRSmaStat) {
}
else
{
}
else
{
smaDebug
(
"vgId:%d, rsma fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
));
}
}
++
nLoops
;
tdSmaLoopsCheck
(
&
nLoops
,
1000
);
if
(
nLoops
>
1000
)
{
sched_yield
();
nLoops
=
0
;
}
}
}
// step 3:
// step 3:
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
fabd96de
...
@@ -99,27 +99,38 @@ void *tdFreeRSmaInfo(SSma *pSma, SRSmaInfo *pInfo, bool isDeepFree) {
...
@@ -99,27 +99,38 @@ void *tdFreeRSmaInfo(SSma *pSma, SRSmaInfo *pInfo, bool isDeepFree) {
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty taskInfo"
,
SMA_VID
(
pSma
),
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty taskInfo"
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
+
1
);
pInfo
->
suid
,
i
+
1
);
}
}
#if 0
if (pInfo->iTaskInfo[i]) {
if (pInfo->iTaskInfo[i]) {
tdRSmaQTaskInfoFree(&pInfo->iTaskInfo[i], SMA_VID(pSma), i + 1);
tdRSmaQTaskInfoFree(&pInfo->iTaskInfo[i], SMA_VID(pSma), i + 1);
} else {
} else {
smaDebug("vgId:%d, table %" PRIi64 " no need to destroy rsma info level %d since empty iTaskInfo",
smaDebug("vgId:%d, table %" PRIi64 " no need to destroy rsma info level %d since empty iTaskInfo",
SMA_VID(pSma), pInfo->suid, i + 1);
SMA_VID(pSma), pInfo->suid, i + 1);
}
}
#endif
}
}
if
(
isDeepFree
)
{
if
(
isDeepFree
)
{
taosMemoryFreeClear
(
pInfo
->
pTSchema
);
taosMemoryFreeClear
(
pInfo
->
pTSchema
);
}
}
if
(
isDeepFree
)
{
if
(
isDeepFree
)
{
if
(
pInfo
->
queue
)
taosCloseQueue
(
pInfo
->
queue
);
if
(
pInfo
->
queue
)
{
if
(
pInfo
->
qall
)
taosFreeQall
(
pInfo
->
qall
);
taosCloseQueue
(
pInfo
->
queue
);
if
(
pInfo
->
iQueue
)
taosCloseQueue
(
pInfo
->
iQueue
);
pInfo
->
queue
=
NULL
;
if
(
pInfo
->
iQall
)
taosFreeQall
(
pInfo
->
iQall
);
}
pInfo
->
queue
=
NULL
;
if
(
pInfo
->
qall
)
{
pInfo
->
qall
=
NULL
;
taosFreeQall
(
pInfo
->
qall
);
pInfo
->
iQueue
=
NULL
;
pInfo
->
qall
=
NULL
;
pInfo
->
iQall
=
NULL
;
}
#if 0
if (pInfo->iQueue) {
taosCloseQueue(pInfo->iQueue);
pInfo->iQueue = NULL;
}
if (pInfo->iQall) {
taosFreeQall(pInfo->iQall);
pInfo->iQall = NULL;
}
#endif
}
}
taosMemoryFree
(
pInfo
);
taosMemoryFree
(
pInfo
);
...
@@ -376,13 +387,14 @@ int32_t tdRSmaProcessCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con
...
@@ -376,13 +387,14 @@ int32_t tdRSmaProcessCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con
if
(
!
(
pRSmaInfo
->
qall
=
taosAllocateQall
()))
{
if
(
!
(
pRSmaInfo
->
qall
=
taosAllocateQall
()))
{
goto
_err
;
goto
_err
;
}
}
#if 0
if (!(pRSmaInfo->iQueue = taosOpenQueue())) {
if (!(pRSmaInfo->iQueue = taosOpenQueue())) {
goto _err;
goto _err;
}
}
if (!(pRSmaInfo->iQall = taosAllocateQall())) {
if (!(pRSmaInfo->iQall = taosAllocateQall())) {
goto _err;
goto _err;
}
}
#endif
if
(
tdSetRSmaInfoItemParams
(
pSma
,
param
,
pStat
,
pRSmaInfo
,
0
)
<
0
)
{
if
(
tdSetRSmaInfoItemParams
(
pSma
,
param
,
pStat
,
pRSmaInfo
,
0
)
<
0
)
{
goto
_err
;
goto
_err
;
}
}
...
@@ -803,7 +815,11 @@ static int32_t tdRsmaPrintSubmitReq(SSma *pSma, SSubmitReq *pReq) {
...
@@ -803,7 +815,11 @@ static int32_t tdRsmaPrintSubmitReq(SSma *pSma, SSubmitReq *pReq) {
static
int32_t
tdExecuteRSmaImpl
(
SSma
*
pSma
,
const
void
*
pMsg
,
int32_t
msgSize
,
int32_t
inputType
,
SRSmaInfo
*
pInfo
,
static
int32_t
tdExecuteRSmaImpl
(
SSma
*
pSma
,
const
void
*
pMsg
,
int32_t
msgSize
,
int32_t
inputType
,
SRSmaInfo
*
pInfo
,
ERsmaExecType
type
,
int8_t
level
)
{
ERsmaExecType
type
,
int8_t
level
)
{
int32_t
idx
=
level
-
1
;
int32_t
idx
=
level
-
1
;
#if 0
void *qTaskInfo = (type == RSMA_EXEC_COMMIT) ? RSMA_INFO_IQTASK(pInfo, idx) : RSMA_INFO_QTASK(pInfo, idx);
void *qTaskInfo = (type == RSMA_EXEC_COMMIT) ? RSMA_INFO_IQTASK(pInfo, idx) : RSMA_INFO_QTASK(pInfo, idx);
#else
void
*
qTaskInfo
=
RSMA_INFO_QTASK
(
pInfo
,
idx
);
#endif
if
(
!
qTaskInfo
)
{
if
(
!
qTaskInfo
)
{
smaDebug
(
"vgId:%d, no qTaskInfo to execute rsma %"
PRIi8
" task for suid:%"
PRIu64
,
SMA_VID
(
pSma
),
level
,
smaDebug
(
"vgId:%d, no qTaskInfo to execute rsma %"
PRIi8
" task for suid:%"
PRIu64
,
SMA_VID
(
pSma
),
level
,
pInfo
->
suid
);
pInfo
->
suid
);
...
@@ -836,6 +852,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t msgSize,
...
@@ -836,6 +852,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t msgSize,
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
#if 0
static int32_t tdCloneQTaskInfo(SSma *pSma, qTaskInfo_t dstTaskInfo, qTaskInfo_t srcTaskInfo, SRSmaParam *param,
static int32_t tdCloneQTaskInfo(SSma *pSma, qTaskInfo_t dstTaskInfo, qTaskInfo_t srcTaskInfo, SRSmaParam *param,
tb_uid_t suid, int8_t idx) {
tb_uid_t suid, int8_t idx) {
int32_t code = 0;
int32_t code = 0;
...
@@ -884,6 +901,7 @@ _exit:
...
@@ -884,6 +901,7 @@ _exit:
}
}
return code;
return code;
}
}
#endif
/**
/**
* @brief Clone qTaskInfo of SRSmaInfo
* @brief Clone qTaskInfo of SRSmaInfo
...
@@ -920,6 +938,7 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
...
@@ -920,6 +938,7 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
if
(
TABLE_IS_ROLLUP
(
mr
.
me
.
flags
))
{
if
(
TABLE_IS_ROLLUP
(
mr
.
me
.
flags
))
{
param
=
&
mr
.
me
.
stbEntry
.
rsmaParam
;
param
=
&
mr
.
me
.
stbEntry
.
rsmaParam
;
#if 0
for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) {
for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) {
if (!pInfo->iTaskInfo[i]) {
if (!pInfo->iTaskInfo[i]) {
continue;
continue;
...
@@ -928,6 +947,7 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
...
@@ -928,6 +947,7 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
TSDB_CHECK_CODE(code, lino, _exit);
TSDB_CHECK_CODE(code, lino, _exit);
}
}
smaDebug("vgId:%d, rsma clone env success for %" PRIi64, SMA_VID(pSma), pInfo->suid);
smaDebug("vgId:%d, rsma clone env success for %" PRIi64, SMA_VID(pSma), pInfo->suid);
#endif
}
else
{
}
else
{
code
=
TSDB_CODE_RSMA_INVALID_SCHEMA
;
code
=
TSDB_CODE_RSMA_INVALID_SCHEMA
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
tests/script/tsim/sma/rsmaPersistenceRecovery.sim
浏览文件 @
fabd96de
...
@@ -10,17 +10,19 @@ sql use d0
...
@@ -10,17 +10,19 @@ sql use d0
print =============== create super table and register rsma
print =============== create super table and register rsma
sql create table if not exists stb (ts timestamp, c1 int, c2 float) tags (city binary(20),district binary(20)) rollup(max) max_delay 5s,5s watermark 2s,3s;
sql create table if not exists stb (ts timestamp, c1 int, c2 float) tags (city binary(20),district binary(20)) rollup(max) max_delay 5s,5s watermark 2s,3s;
sql create table if not exists stb1 (ts timestamp, c1 int, c2 float) tags (city binary(20),district binary(20)) rollup(max) max_delay 5s,5s watermark 2s,3s;
sql show stables
sql show stables
if $rows !=
1
then
if $rows !=
2
then
return -1
return -1
endi
endi
print =============== create child table
print =============== create child table
sql create table ct1 using stb tags("BeiJing", "ChaoYang");
sql create table ct1 using stb tags("BeiJing", "ChaoYang");
sql create table ct_1 using stb1 tags("BeiJing", "ChaoYang");
sql show tables
sql show tables
if $rows !=
1
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
@@ -28,6 +30,9 @@ print =============== insert data and trigger rollup
...
@@ -28,6 +30,9 @@ print =============== insert data and trigger rollup
sql insert into ct1 values(now, 10, 10.0);
sql insert into ct1 values(now, 10, 10.0);
sql insert into ct1 values(now+1s, 1, 1.0);
sql insert into ct1 values(now+1s, 1, 1.0);
sql insert into ct1 values(now+2s, 100, 100.0);
sql insert into ct1 values(now+2s, 100, 100.0);
sql insert into ct_1 values(now, 10, 10.0);
sql insert into ct_1 values(now+1s, 1, 1.0);
sql insert into ct_1 values(now+2s, 100, 100.0);
print =============== wait maxdelay 5+2 seconds for results
print =============== wait maxdelay 5+2 seconds for results
sleep 7000
sleep 7000
...
@@ -41,6 +46,20 @@ if $rows > 2 then
...
@@ -41,6 +46,20 @@ if $rows > 2 then
return -1
return -1
endi
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 2 file result $data01 != 100 or 10
return -1
endi
endi
sql select * from ct_1;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 2 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 100 then
if $data01 != 10 then
if $data01 != 10 then
...
@@ -65,6 +84,21 @@ if $data01 != 100 then
...
@@ -65,6 +84,21 @@ if $data01 != 100 then
endi
endi
endi
endi
sql select * from ct_1 where ts > now-8d;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 1 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 1 file result $data01 != 100 or 10
return -1
endi
endi
print =============== select * from retention level 0 from memory
print =============== select * from retention level 0 from memory
sql select * from ct1 where ts > now-3d;
sql select * from ct1 where ts > now-3d;
print $data00 $data01 $data02
print $data00 $data01 $data02
...
@@ -81,6 +115,21 @@ if $data01 != 10 then
...
@@ -81,6 +115,21 @@ if $data01 != 10 then
return -1
return -1
endi
endi
sql select * from ct_1 where ts > now-3d;
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows < 1 then
print retention level 0 file rows $rows < 1
return -1
endi
if $data01 != 10 then
print retention level 0 file result $data01 != 10
return -1
endi
#===================================================================
#===================================================================
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
@@ -97,6 +146,22 @@ if $rows > 2 then
...
@@ -97,6 +146,22 @@ if $rows > 2 then
endi
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 2 file result $data01 != 100 or 10
return -1
endi
endi
sql select * from ct_1;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 2 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 100 then
if $data01 != 10 then
if $data01 != 10 then
print retention level 2 file result $data01 != 100 or 10
print retention level 2 file result $data01 != 100 or 10
...
@@ -120,6 +185,21 @@ if $data01 != 100 then
...
@@ -120,6 +185,21 @@ if $data01 != 100 then
endi
endi
endi
endi
sql select * from ct_1 where ts > now-8d;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 1 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 1 file result $data01 != 100 or 10
return -1
endi
endi
print =============== select * from retention level 0 from memory after reboot
print =============== select * from retention level 0 from memory after reboot
sql select * from ct1 where ts > now-3d;
sql select * from ct1 where ts > now-3d;
print $data00 $data01 $data02
print $data00 $data01 $data02
...
@@ -136,6 +216,21 @@ if $data01 != 10 then
...
@@ -136,6 +216,21 @@ if $data01 != 10 then
return -1
return -1
endi
endi
sql select * from ct_1 where ts > now-3d;
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows < 1 then
print retention level 0 file rows $rows < 1
return -1
endi
if $data01 != 10 then
print retention level 0 file result $data01 != 10
return -1
endi
#==================== flush database to trigger commit data to file
#==================== flush database to trigger commit data to file
sql flush database d0;
sql flush database d0;
...
@@ -158,6 +253,21 @@ if $data01 != 100 then
...
@@ -158,6 +253,21 @@ if $data01 != 100 then
endi
endi
endi
endi
sql select * from ct_1;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 2 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 2 file result $data01 != 100 or 10
return -1
endi
endi
print =============== select * from retention level 1 from file
print =============== select * from retention level 1 from file
sql select * from ct1 where ts > now-8d;
sql select * from ct1 where ts > now-8d;
print $data00 $data01 $data02
print $data00 $data01 $data02
...
@@ -174,6 +284,21 @@ if $data01 != 100 then
...
@@ -174,6 +284,21 @@ if $data01 != 100 then
endi
endi
endi
endi
sql select * from ct_1 where ts > now-8d;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 1 file rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 1 file result $data01 != 100 or 10
return -1
endi
endi
print =============== select * from retention level 0 from file
print =============== select * from retention level 0 from file
sql select * from ct1 where ts > now-3d;
sql select * from ct1 where ts > now-3d;
print $data00 $data01 $data02
print $data00 $data01 $data02
...
@@ -189,9 +314,25 @@ if $data01 != 10 then
...
@@ -189,9 +314,25 @@ if $data01 != 10 then
return -1
return -1
endi
endi
sql select * from ct_1 where ts > now-3d;
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows < 1 then
print retention level 0 file rows $rows < 1
return -1
endi
if $data01 != 10 then
print retention level 0 file result $data01 != 10
return -1
endi
print =============== insert after rsma qtaskinfo recovery
print =============== insert after rsma qtaskinfo recovery
sql insert into ct1 values(now, 50, 500.0);
sql insert into ct1 values(now, 50, 500.0);
sql insert into ct1 values(now+1s, 40, 40.0);
sql insert into ct1 values(now+1s, 40, 40.0);
sql insert into ct_1 values(now, 50, 500.0);
sql insert into ct_1 values(now+1s, 40, 40.0);
print =============== wait maxdelay 5+2 seconds for results
print =============== wait maxdelay 5+2 seconds for results
sleep 7000
sleep 7000
...
@@ -219,6 +360,28 @@ if $data02 != 500.00000 then
...
@@ -219,6 +360,28 @@ if $data02 != 500.00000 then
endi
endi
endi
endi
sql select * from ct_1;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 2 file/mem rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 2 file/mem result $data01 != 100 or 10
return -1
endi
endi
if $data02 != 500.00000 then
if $data02 != 100.00000 then
print retention level 1 file/mem result $data02 != 500.00000 or 100.00000
return -1
endi
endi
print =============== select * from retention level 1 from file and memory after rsma qtaskinfo recovery
print =============== select * from retention level 1 from file and memory after rsma qtaskinfo recovery
sql select * from ct1 where ts > now-8d;
sql select * from ct1 where ts > now-8d;
print $data00 $data01 $data02
print $data00 $data01 $data02
...
@@ -242,6 +405,28 @@ if $data02 != 500.00000 then
...
@@ -242,6 +405,28 @@ if $data02 != 500.00000 then
endi
endi
endi
endi
sql select * from ct_1 where ts > now-8d;
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows > 2 then
print retention level 1 file/mem rows $rows > 2
return -1
endi
if $data01 != 100 then
if $data01 != 10 then
print retention level 1 file/mem result $data01 != 100 or 10
return -1
endi
endi
if $data02 != 500.00000 then
if $data02 != 100.00000 then
print retention level 1 file/mem result $data02 != 500.00000 or 100.00000
return -1
endi
endi
print =============== select * from retention level 0 from file and memory after rsma qtaskinfo recovery
print =============== select * from retention level 0 from file and memory after rsma qtaskinfo recovery
sql select * from ct1 where ts > now-3d;
sql select * from ct1 where ts > now-3d;
...
@@ -292,6 +477,61 @@ if $data42 != 40.00000 then
...
@@ -292,6 +477,61 @@ if $data42 != 40.00000 then
return -1
return -1
endi
endi
sql select * from ct_1 where ts > now-3d;
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
print $data30 $data31 $data32
print $data40 $data41 $data42
if $rows < 1 then
print retention level 0 file/mem rows $rows < 1
return -1
endi
if $data01 != 10 then
print retention level 0 file/mem result $data01 != 10
return -1
endi
if $data11 != 1 then
print retention level 0 file/mem result $data11 != 1
return -1
endi
if $data21 != 100 then
print retention level 0 file/mem result $data21 != 100
return -1
endi
if $data31 != 50 then
print retention level 0 file/mem result $data31 != 50
return -1
endi
if $data32 != 500.00000 then
print retention level 0 file/mem result $data32 != 500.00000
return -1
endi
if $data41 != 40 then
print retention level 0 file/mem result $data41 != 40
return -1
endi
if $data42 != 40.00000 then
print retention level 0 file/mem result $data42 != 40.00000
return -1
endi
print =============== drop stb1
sql drop table stb1;
sql flush database d0;
print =============== select * from retention level 0 from file and memory after rsma qtaskinfo recovery
sql_error select * from ct_1 where ts > now-3d;
sql_error select * from ct_1 where ts > now-8d;
sql_error select * from ct_1;
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录