Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b6c991f8
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
b6c991f8
编写于
8月 07, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support reopen stream state
上级
eeb97351
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
14 deletion
+15
-14
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+2
-2
source/dnode/vnode/src/tq/tqStreamStateSnap.c
source/dnode/vnode/src/tq/tqStreamStateSnap.c
+5
-1
source/dnode/vnode/src/vnd/vnodeSnapshot.c
source/dnode/vnode/src/vnd/vnodeSnapshot.c
+0
-3
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+8
-8
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
b6c991f8
...
@@ -611,8 +611,8 @@ SStreamTask* streamMetaAcquireTask(SStreamMeta* pMeta, int32_t taskId);
...
@@ -611,8 +611,8 @@ SStreamTask* streamMetaAcquireTask(SStreamMeta* pMeta, int32_t taskId);
void
streamMetaReleaseTask
(
SStreamMeta
*
pMeta
,
SStreamTask
*
pTask
);
void
streamMetaReleaseTask
(
SStreamMeta
*
pMeta
,
SStreamTask
*
pTask
);
void
streamMetaRemoveTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
);
void
streamMetaRemoveTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
);
int32_t
streamStateRebuild
(
SStreamMeta
*
pMeta
,
char
*
path
,
int64_t
chkpId
);
//
int32_t streamStateRebuild(SStreamMeta* pMeta, char* path, int64_t chkpId);
int32_t
stream
StateReopen
(
SStreamMeta
*
pMeta
,
int64_t
chkpId
);
int32_t
stream
MetaReopen
(
SStreamMeta
*
pMeta
,
int64_t
chkpId
);
int32_t
streamMetaBegin
(
SStreamMeta
*
pMeta
);
int32_t
streamMetaBegin
(
SStreamMeta
*
pMeta
);
int32_t
streamMetaCommit
(
SStreamMeta
*
pMeta
);
int32_t
streamMetaCommit
(
SStreamMeta
*
pMeta
);
...
...
source/dnode/vnode/src/tq/tqStreamStateSnap.c
浏览文件 @
b6c991f8
...
@@ -163,7 +163,11 @@ int32_t streamStateSnapWriterClose(SStreamStateWriter* pWriter, int8_t rollback)
...
@@ -163,7 +163,11 @@ int32_t streamStateSnapWriterClose(SStreamStateWriter* pWriter, int8_t rollback)
return
code
;
return
code
;
}
}
int32_t
streamStateRebuildFromSnap
(
SStreamStateWriter
*
pWriter
,
char
*
path
,
int64_t
chkpId
)
{
int32_t
streamStateRebuildFromSnap
(
SStreamStateWriter
*
pWriter
,
char
*
path
,
int64_t
chkpId
)
{
return
streamStateReopen
(
pWriter
->
pTq
->
pStreamMeta
,
chkpId
);
int32_t
code
=
streamMetaReopen
(
pWriter
->
pTq
->
pStreamMeta
,
chkpId
);
if
(
code
==
0
)
{
code
=
streamStateLoadTasks
(
pWriter
);
}
return
code
;
}
}
int32_t
streamStateLoadTasksImpl
(
SStreamMeta
*
pMeta
,
int64_t
ver
)
{
int32_t
streamStateLoadTasksImpl
(
SStreamMeta
*
pMeta
,
int64_t
ver
)
{
...
...
source/dnode/vnode/src/vnd/vnodeSnapshot.c
浏览文件 @
b6c991f8
...
@@ -412,9 +412,6 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
...
@@ -412,9 +412,6 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
code
=
streamStateRebuildFromSnap
(
pWriter
->
pStreamStateWriter
,
NULL
,
0
);
code
=
streamStateRebuildFromSnap
(
pWriter
->
pStreamStateWriter
,
NULL
,
0
);
if
(
code
)
goto
_exit
;
if
(
code
)
goto
_exit
;
code
=
streamStateLoadTasks
(
pWriter
->
pStreamStateWriter
);
if
(
code
)
goto
_exit
;
}
}
if
(
pWriter
->
pRsmaSnapWriter
)
{
if
(
pWriter
->
pRsmaSnapWriter
)
{
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
b6c991f8
...
@@ -36,14 +36,14 @@ void streamMetaCleanup() {
...
@@ -36,14 +36,14 @@ void streamMetaCleanup() {
taosCloseRef
(
streamBackendCfWrapperId
);
taosCloseRef
(
streamBackendCfWrapperId
);
}
}
int32_t
streamStateRebuild
(
SStreamMeta
*
pMeta
,
char
*
path
,
int64_t
chkpId
)
{
//
int32_t streamStateRebuild(SStreamMeta* pMeta, char* path, int64_t chkpId) {
int32_t
code
=
0
;
//
int32_t code = 0;
int32_t
nTask
=
taosHashGetSize
(
pMeta
->
pTasks
);
//
int32_t nTask = taosHashGetSize(pMeta->pTasks);
assert
(
nTask
==
0
);
//
assert(nTask == 0);
return
code
;
//
return code;
}
//
}
SStreamMeta
*
streamMetaOpen
(
const
char
*
path
,
void
*
ahandle
,
FTaskExpand
expandFunc
,
int32_t
vgId
)
{
SStreamMeta
*
streamMetaOpen
(
const
char
*
path
,
void
*
ahandle
,
FTaskExpand
expandFunc
,
int32_t
vgId
)
{
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
SStreamMeta
*
pMeta
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamMeta
));
SStreamMeta
*
pMeta
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamMeta
));
...
@@ -128,7 +128,7 @@ _err:
...
@@ -128,7 +128,7 @@ _err:
return
NULL
;
return
NULL
;
}
}
void
streamMetaReopen
(
SStreamMeta
*
pMeta
,
int64_t
chkpId
)
{
int32_t
streamMetaReopen
(
SStreamMeta
*
pMeta
,
int64_t
chkpId
)
{
// stop all running tasking and reopen later
// stop all running tasking and reopen later
void
*
pIter
=
NULL
;
void
*
pIter
=
NULL
;
while
(
1
)
{
while
(
1
)
{
...
@@ -172,7 +172,7 @@ void streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) {
...
@@ -172,7 +172,7 @@ void streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) {
// if (streamLoadTasks(pMeta,int64_t ver))
// if (streamLoadTasks(pMeta,int64_t ver))
return
;
return
0
;
}
}
void
streamMetaClose
(
SStreamMeta
*
pMeta
)
{
void
streamMetaClose
(
SStreamMeta
*
pMeta
)
{
tdbAbort
(
pMeta
->
db
,
pMeta
->
txn
);
tdbAbort
(
pMeta
->
db
,
pMeta
->
txn
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录