Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a3133b9f
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看板
提交
a3133b9f
编写于
7月 20, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(wal): log applied ver
上级
f93d465d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
30 addition
and
5 deletion
+30
-5
include/libs/wal/wal.h
include/libs/wal/wal.h
+5
-1
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+4
-0
source/dnode/vnode/src/tq/tqPush.c
source/dnode/vnode/src/tq/tqPush.c
+2
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+2
-0
source/libs/wal/src/walMeta.c
source/libs/wal/src/walMeta.c
+2
-0
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+8
-2
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+6
-0
tests/system-test/7-tmq/tmqAutoCreateTbl.py
tests/system-test/7-tmq/tmqAutoCreateTbl.py
+1
-1
未找到文件。
include/libs/wal/wal.h
浏览文件 @
a3133b9f
...
...
@@ -64,6 +64,7 @@ typedef struct {
int64_t
verInSnapshotting
;
int64_t
snapshotVer
;
int64_t
commitVer
;
int64_t
appliedVer
;
int64_t
lastVer
;
}
SWalVer
;
...
...
@@ -172,6 +173,9 @@ int32_t walRollback(SWal *, int64_t ver);
int32_t
walBeginSnapshot
(
SWal
*
,
int64_t
ver
);
int32_t
walEndSnapshot
(
SWal
*
);
int32_t
walRestoreFromSnapshot
(
SWal
*
,
int64_t
ver
);
// for tq
int32_t
walApplyVer
(
SWal
*
,
int64_t
ver
);
// int32_t walDataCorrupted(SWal*);
// read
...
...
@@ -186,7 +190,6 @@ void walSetReaderCapacity(SWalReader *pRead, int32_t capacity);
int32_t
walFetchHead
(
SWalReader
*
pRead
,
int64_t
ver
,
SWalCkHead
*
pHead
);
int32_t
walFetchBody
(
SWalReader
*
pRead
,
SWalCkHead
**
ppHead
);
int32_t
walSkipFetchBody
(
SWalReader
*
pRead
,
const
SWalCkHead
*
pHead
);
typedef
struct
{
int64_t
refId
;
int64_t
ver
;
...
...
@@ -206,6 +209,7 @@ int64_t walGetFirstVer(SWal *);
int64_t
walGetSnapshotVer
(
SWal
*
);
int64_t
walGetLastVer
(
SWal
*
);
int64_t
walGetCommittedVer
(
SWal
*
);
int64_t
walGetAppliedVer
(
SWal
*
);
#ifdef __cplusplus
}
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
a3133b9f
...
...
@@ -265,6 +265,10 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
int64_t
consumerId
=
be64toh
(
pReq
->
consumerId
);
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
consumerId
);
if
(
pConsumer
==
NULL
)
{
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_EXIST
;
return
-
1
;
}
atomic_store_32
(
&
pConsumer
->
hbStatus
,
0
);
...
...
source/dnode/vnode/src/tq/tqPush.c
浏览文件 @
a3133b9f
...
...
@@ -237,6 +237,8 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
#endif
int
tqPushMsg
(
STQ
*
pTq
,
void
*
msg
,
int32_t
msgLen
,
tmsg_t
msgType
,
int64_t
ver
)
{
walApplyVer
(
pTq
->
pVnode
->
pWal
,
ver
);
if
(
msgType
==
TDMT_VND_SUBMIT
)
{
if
(
taosHashGetSize
(
pTq
->
pStreamTasks
)
==
0
)
return
0
;
...
...
@@ -253,4 +255,3 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
return
0
;
}
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
a3133b9f
...
...
@@ -878,6 +878,8 @@ _exit:
tdProcessRSmaSubmit
(
pVnode
->
pSma
,
pReq
,
STREAM_INPUT__DATA_SUBMIT
);
}
vDebug
(
"successful submit in vg %d version %ld"
,
pVnode
->
config
.
vgId
,
version
);
return
0
;
}
...
...
source/libs/wal/src/walMeta.c
浏览文件 @
a3133b9f
...
...
@@ -33,6 +33,8 @@ int64_t FORCE_INLINE walGetLastVer(SWal* pWal) { return pWal->vers.lastVer; }
int64_t
FORCE_INLINE
walGetCommittedVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
commitVer
;
}
int64_t
FORCE_INLINE
walGetAppliedVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
appliedVer
;
}
static
FORCE_INLINE
int
walBuildMetaName
(
SWal
*
pWal
,
int
metaVer
,
char
*
buf
)
{
return
sprintf
(
buf
,
"%s/meta-ver%d"
,
pWal
->
path
,
metaVer
);
}
...
...
source/libs/wal/src/walRead.c
浏览文件 @
a3133b9f
...
...
@@ -66,9 +66,15 @@ void walCloseReader(SWalReader *pRead) {
}
int32_t
walNextValidMsg
(
SWalReader
*
pRead
)
{
wDebug
(
"vgId:%d wal start to fetch"
,
pRead
->
pWal
->
cfg
.
vgId
);
int64_t
fetchVer
=
pRead
->
curVersion
;
int64_t
endVer
=
pRead
->
cond
.
scanUncommited
?
walGetLastVer
(
pRead
->
pWal
)
:
walGetCommittedVer
(
pRead
->
pWal
);
int64_t
lastVer
=
walGetLastVer
(
pRead
->
pWal
);
int64_t
committedVer
=
walGetCommittedVer
(
pRead
->
pWal
);
int64_t
appliedVer
=
walGetAppliedVer
(
pRead
->
pWal
);
int64_t
endVer
=
pRead
->
cond
.
scanUncommited
?
lastVer
:
committedVer
;
endVer
=
TMIN
(
appliedVer
,
endVer
);
wDebug
(
"vgId:%d wal start to fetch, ver %ld, last ver %ld commit ver %ld, applied ver %ld, end ver %ld"
,
pRead
->
pWal
->
cfg
.
vgId
,
fetchVer
,
lastVer
,
committedVer
,
appliedVer
,
endVer
);
while
(
fetchVer
<=
endVer
)
{
if
(
walFetchHeadNew
(
pRead
,
fetchVer
)
<
0
)
{
return
-
1
;
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
a3133b9f
...
...
@@ -64,6 +64,12 @@ int32_t walRestoreFromSnapshot(SWal *pWal, int64_t ver) {
return
0
;
}
int32_t
walApplyVer
(
SWal
*
pWal
,
int64_t
ver
)
{
// TODO: error check
pWal
->
vers
.
appliedVer
=
ver
;
return
0
;
}
int32_t
walCommit
(
SWal
*
pWal
,
int64_t
ver
)
{
ASSERT
(
pWal
->
vers
.
commitVer
>=
pWal
->
vers
.
snapshotVer
);
ASSERT
(
pWal
->
vers
.
commitVer
<=
pWal
->
vers
.
lastVer
);
...
...
tests/system-test/7-tmq/tmqAutoCreateTbl.py
浏览文件 @
a3133b9f
...
...
@@ -225,7 +225,7 @@ class TDTestCase:
tdSql
.
prepare
()
self
.
prepareTestEnv
()
self
.
tmqCase1
()
# self.tmqCase2() TD-17267
# self.tmqCase2()
#
TD-17267
def
stop
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录