enh: test case for rsma snapshot

This commit is contained in:
kailixu 2023-11-09 12:09:27 +08:00
parent 2eb884d66d
commit 1a950afdb8
3 changed files with 16 additions and 11 deletions

View File

@ -944,7 +944,7 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, int64_t version, void *pReq, void *pMsg,
return TDB_CODE_SUCCESS;
}
if (0 != (terrno = atomic_load_32(&SMA_RSMA_STAT(pSma)->execStat))) {
if ((terrno = atomic_load_32(&SMA_RSMA_STAT(pSma)->execStat))) {
smaError("vgId:%d, failed to process rsma submit since invalid exec code: %s", SMA_VID(pSma), terrstr());
goto _err;
}
@ -1224,9 +1224,9 @@ _checkpoint:
}
taosWLockLatch(&pMeta->lock);
if (0 != streamMetaSaveTask(pMeta, pTask)) {
if (streamMetaSaveTask(pMeta, pTask)) {
taosWUnLockLatch(&pMeta->lock);
code = terrno != 0 ? terrno : TSDB_CODE_OUT_OF_MEMORY;
code = terrno ? terrno : TSDB_CODE_OUT_OF_MEMORY;
taosHashCancelIterate(pInfoHash, infoHash);
TSDB_CHECK_CODE(code, lino, _exit);
}
@ -1239,9 +1239,9 @@ _checkpoint:
}
if (pMeta) {
taosWLockLatch(&pMeta->lock);
if (0 != streamMetaCommit(pMeta)) {
if (streamMetaCommit(pMeta)) {
taosWUnLockLatch(&pMeta->lock);
code = terrno != 0 ? terrno : TSDB_CODE_OUT_OF_MEMORY;
code = terrno ? terrno : TSDB_CODE_OUT_OF_MEMORY;
TSDB_CHECK_CODE(code, lino, _exit);
}
taosWUnLockLatch(&pMeta->lock);

View File

@ -195,7 +195,6 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
if (tDecodeU64(pDecoder, &pTask->dataRange.range.minVer)) return -1;
if (tDecodeU64(pDecoder, &pTask->dataRange.range.maxVer)) return -1;
if (tDecodeI64(pDecoder, &pTask->dataRange.window.skey)) return -1;
if (tDecodeI64(pDecoder, &pTask->dataRange.window.ekey)) return -1;

View File

@ -167,9 +167,6 @@ system sh/exec.sh -n dnode4 -s start
sleep 3000
print =============== query data of level 1
sql connect
sql use db
@ -181,12 +178,21 @@ if $rows != 100 then
return -1
endi
print =============== sleep 5s to wait the result
sleep 5000
print =============== query data of level 2
sql select * from ct1 where ts > now - 10d
print rows of level 2: $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows != 100 then
print rows of level 2: $rows
endi
print =============== query data of level 3
sql select * from ct1
print rows of level 3: $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
if $rows != 100 then
print rows of level 3: $rows
endi