Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
863d30e5
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
863d30e5
编写于
4月 26, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt tq read
上级
2533b5c5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
20 deletion
+31
-20
include/libs/stream/tstreamFileState.h
include/libs/stream/tstreamFileState.h
+1
-0
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+21
-18
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+1
-1
source/libs/stream/src/streamState.c
source/libs/stream/src/streamState.c
+4
-1
source/libs/stream/src/tstreamFileState.c
source/libs/stream/src/tstreamFileState.c
+4
-0
未找到文件。
include/libs/stream/tstreamFileState.h
浏览文件 @
863d30e5
...
...
@@ -42,6 +42,7 @@ SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_
TSKEY
delMark
);
void
streamFileStateDestroy
(
SStreamFileState
*
pFileState
);
void
streamFileStateClear
(
SStreamFileState
*
pFileState
);
bool
needClearDiskBuff
(
SStreamFileState
*
pFileState
);
int32_t
getRowBuff
(
SStreamFileState
*
pFileState
,
void
*
pKey
,
int32_t
keyLen
,
void
**
pVal
,
int32_t
*
pVLen
);
int32_t
deleteRowBuff
(
SStreamFileState
*
pFileState
,
const
void
*
pKey
,
int32_t
keyLen
);
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
863d30e5
...
...
@@ -469,25 +469,28 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbD
pBlock
->
info
.
version
=
pReader
->
msg2
.
ver
;
if
(
pReader
->
cachedSchemaSuid
==
0
||
pReader
->
cachedSchemaVer
!=
sversion
||
pReader
->
cachedSchemaSuid
!=
suid
)
{
taosMemoryFree
(
pReader
->
pSchema
);
pReader
->
pSchema
=
metaGetTbTSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchema
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found tsschema for table: uid:%"
PRId64
" (suid:%"
PRId64
"), version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
suid
,
sversion
);
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
return
-
1
;
}
if
(
pReader
->
cachedSchemaVer
!=
sversion
)
{
taosMemoryFree
(
pReader
->
pSchema
);
pReader
->
pSchema
=
metaGetTbTSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchema
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found tsschema for table: uid:%"
PRId64
" (suid:%"
PRId64
"), version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
suid
,
sversion
);
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
return
-
1
;
}
tDeleteSSchemaWrapper
(
pReader
->
pSchemaWrapper
);
pReader
->
pSchemaWrapper
=
metaGetTableSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchemaWrapper
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found schema wrapper for table: suid:%"
PRId64
", version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
pReader
->
cachedSchemaVer
);
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
return
-
1
;
tDeleteSSchemaWrapper
(
pReader
->
pSchemaWrapper
);
pReader
->
pSchemaWrapper
=
metaGetTableSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchemaWrapper
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found schema wrapper for table: suid:%"
PRId64
", version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
pReader
->
cachedSchemaVer
);
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
return
-
1
;
}
pReader
->
cachedSchemaVer
=
sversion
;
}
STSchema
*
pTschema
=
pReader
->
pSchema
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
863d30e5
...
...
@@ -15,7 +15,7 @@
#include "streamInc.h"
#define STREAM_EXEC_MAX_BATCH_NUM
1024
#define STREAM_EXEC_MAX_BATCH_NUM
4096
bool
streamTaskShouldStop
(
const
SStreamStatus
*
pStatus
)
{
int32_t
status
=
atomic_load_8
((
int8_t
*
)
&
pStatus
->
taskStatus
);
...
...
source/libs/stream/src/streamState.c
浏览文件 @
863d30e5
...
...
@@ -363,7 +363,10 @@ int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key) {
int32_t
streamStateClear
(
SStreamState
*
pState
)
{
#ifdef USE_ROCKSDB
streamFileStateClear
(
pState
->
pFileState
);
return
streamStateClear_rocksdb
(
pState
);
if
(
needClearDiskBuff
(
pState
->
pFileState
))
{
streamStateClear_rocksdb
(
pState
);
}
return
0
;
#else
SWinKey
key
=
{.
ts
=
0
,
.
groupId
=
0
};
streamStatePut
(
pState
,
&
key
,
NULL
,
0
);
...
...
source/libs/stream/src/tstreamFileState.c
浏览文件 @
863d30e5
...
...
@@ -154,6 +154,10 @@ void streamFileStateClear(SStreamFileState* pFileState) {
clearExpiredRowBuff
(
pFileState
,
0
,
true
);
}
bool
needClearDiskBuff
(
SStreamFileState
*
pFileState
)
{
return
pFileState
->
flushMark
>
0
;
}
void
popUsedBuffs
(
SStreamFileState
*
pFileState
,
SStreamSnapshot
*
pFlushList
,
uint64_t
max
,
bool
used
)
{
uint64_t
i
=
0
;
SListIter
iter
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录