Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7a655895
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a655895
编写于
7月 01, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(wal): add api to check log existance
上级
4f107908
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
8 deletion
+14
-8
include/libs/wal/wal.h
include/libs/wal/wal.h
+2
-0
source/client/src/tmq.c
source/client/src/tmq.c
+2
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+1
-5
source/libs/wal/src/walMeta.c
source/libs/wal/src/walMeta.c
+4
-0
tests/test/c/tmqSim.c
tests/test/c/tmqSim.c
+5
-1
未找到文件。
include/libs/wal/wal.h
浏览文件 @
7a655895
...
@@ -210,6 +210,8 @@ void walCloseRef(SWalRef *);
...
@@ -210,6 +210,8 @@ void walCloseRef(SWalRef *);
int32_t
walRefVer
(
SWalRef
*
,
int64_t
ver
);
int32_t
walRefVer
(
SWalRef
*
,
int64_t
ver
);
int32_t
walUnrefVer
(
SWal
*
);
int32_t
walUnrefVer
(
SWal
*
);
bool
walLogExist
(
SWal
*
,
int64_t
ver
);
// lifecycle check
// lifecycle check
bool
walIsEmpty
(
SWal
*
);
bool
walIsEmpty
(
SWal
*
);
int64_t
walGetFirstVer
(
SWal
*
);
int64_t
walGetFirstVer
(
SWal
*
);
...
...
source/client/src/tmq.c
浏览文件 @
7a655895
...
@@ -1609,8 +1609,8 @@ int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
...
@@ -1609,8 +1609,8 @@ int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
int64_t
transporterId
=
0
;
int64_t
transporterId
=
0
;
/*printf("send poll\n");*/
/*printf("send poll\n");*/
char
offsetFormatBuf
[
5
0
];
char
offsetFormatBuf
[
8
0
];
tFormatOffset
(
offsetFormatBuf
,
5
0
,
&
pVg
->
currentOffsetNew
);
tFormatOffset
(
offsetFormatBuf
,
8
0
,
&
pVg
->
currentOffsetNew
);
tscDebug
(
"consumer %ld send poll to %s : vg %d, epoch %d, req offset %s, reqId %lu"
,
tmq
->
consumerId
,
tscDebug
(
"consumer %ld send poll to %s : vg %d, epoch %d, req offset %s, reqId %lu"
,
tmq
->
consumerId
,
pTopic
->
topicName
,
pVg
->
vgId
,
tmq
->
epoch
,
offsetFormatBuf
,
pReq
->
reqId
);
pTopic
->
topicName
,
pVg
->
vgId
,
tmq
->
epoch
,
offsetFormatBuf
,
pReq
->
reqId
);
/*printf("send vg %d %ld\n", pVg->vgId, pVg->currentOffset);*/
/*printf("send vg %d %ld\n", pVg->vgId, pVg->currentOffset);*/
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
7a655895
...
@@ -276,7 +276,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
...
@@ -276,7 +276,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
tqDebug
(
"tmq poll: consumer %ld, offset reset to %s"
,
consumerId
,
formatBuf
);
tqDebug
(
"tmq poll: consumer %ld, offset reset to %s"
,
consumerId
,
formatBuf
);
}
else
{
}
else
{
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_EARLIEAST
)
{
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_EARLIEAST
)
{
if
(
pReq
->
useSnapshot
)
{
if
(
pReq
->
useSnapshot
&&
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
if
(
!
pHandle
->
fetchMeta
)
{
if
(
!
pHandle
->
fetchMeta
)
{
tqOffsetResetToData
(
&
fetchOffsetNew
,
0
,
0
);
tqOffsetResetToData
(
&
fetchOffsetNew
,
0
,
0
);
}
else
{
}
else
{
...
@@ -375,10 +375,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
...
@@ -375,10 +375,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
taosMemoryFree
(
pHeadWithCkSum
);
taosMemoryFree
(
pHeadWithCkSum
);
}
else
if
(
fetchOffsetNew
.
type
==
TMQ_OFFSET__SNAPSHOT_DATA
)
{
}
else
if
(
fetchOffsetNew
.
type
==
TMQ_OFFSET__SNAPSHOT_DATA
)
{
// 1. set uid and ts
// 2. get data (rebuild reader if needed)
// 3. get new uid and ts
tqInfo
(
"retrieve using snapshot req offset: uid %ld ts %ld"
,
dataRsp
.
reqOffset
.
uid
,
dataRsp
.
reqOffset
.
ts
);
tqInfo
(
"retrieve using snapshot req offset: uid %ld ts %ld"
,
dataRsp
.
reqOffset
.
uid
,
dataRsp
.
reqOffset
.
ts
);
if
(
tqScanSnapshot
(
pTq
,
&
pHandle
->
execHandle
,
&
dataRsp
,
fetchOffsetNew
,
workerId
)
<
0
)
{
if
(
tqScanSnapshot
(
pTq
,
&
pHandle
->
execHandle
,
&
dataRsp
,
fetchOffsetNew
,
workerId
)
<
0
)
{
ASSERT
(
0
);
ASSERT
(
0
);
...
...
source/libs/wal/src/walMeta.c
浏览文件 @
7a655895
...
@@ -19,6 +19,10 @@
...
@@ -19,6 +19,10 @@
#include "tref.h"
#include "tref.h"
#include "walInt.h"
#include "walInt.h"
bool
FORCE_INLINE
walLogExist
(
SWal
*
pWal
,
int64_t
ver
)
{
return
!
walIsEmpty
(
pWal
)
&&
walGetFirstVer
(
pWal
)
<=
ver
&&
walGetLastVer
(
pWal
)
>=
ver
;
}
bool
FORCE_INLINE
walIsEmpty
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
firstVer
==
-
1
;
}
bool
FORCE_INLINE
walIsEmpty
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
firstVer
==
-
1
;
}
int64_t
FORCE_INLINE
walGetFirstVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
firstVer
;
}
int64_t
FORCE_INLINE
walGetFirstVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
firstVer
;
}
...
...
tests/test/c/tmqSim.c
浏览文件 @
7a655895
...
@@ -36,7 +36,11 @@
...
@@ -36,7 +36,11 @@
#define MAX_CONSUMER_THREAD_CNT (16)
#define MAX_CONSUMER_THREAD_CNT (16)
#define MAX_VGROUP_CNT (32)
#define MAX_VGROUP_CNT (32)
typedef
enum
{
NOTIFY_CMD_START_CONSUM
,
NOTIFY_CMD_START_COMMIT
,
NOTIFY_CMD_ID_BUTT
}
NOTIFY_CMD_ID
;
typedef
enum
{
NOTIFY_CMD_START_CONSUM
,
NOTIFY_CMD_START_COMMIT
,
NOTIFY_CMD_ID_BUTT
,
}
NOTIFY_CMD_ID
;
typedef
struct
{
typedef
struct
{
TdThread
thread
;
TdThread
thread
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录