Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
213e8b89
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
213e8b89
编写于
4月 26, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
log: disable some logs.
上级
ca4df761
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
23 deletion
+34
-23
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+24
-21
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+10
-2
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
213e8b89
...
...
@@ -165,7 +165,7 @@ void* queryThread(void* arg) {
int32_t
numOfThreads
=
1
;
void
tmq_commit_cb_print
(
tmq_t
*
pTmq
,
int32_t
code
,
void
*
param
)
{
printf
(
"auto commit success, code:%d
\n\n\n
\n
"
,
code
);
// printf("auto commit success, code:%d
\n", code);
}
void
*
doConsumeData
(
void
*
param
)
{
...
...
@@ -1053,19 +1053,24 @@ TEST(clientCase, sub_db_test) {
}
TEST
(
clientCase
,
sub_tb_test
)
{
taos_options
(
TSDB_OPTION_CONFIGDIR
,
"
~/first/cfg
"
);
taos_options
(
TSDB_OPTION_CONFIGDIR
,
"
/home/tests/dir/cfg/
"
);
TAOS
*
pConn
=
taos_connect
(
"
localhost
"
,
"root"
,
"taosdata"
,
NULL
,
0
);
TAOS
*
pConn
=
taos_connect
(
"
vm116
"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
pConn
,
nullptr
);
tmq_conf_t
*
conf
=
tmq_conf_new
();
int64_t
ts
=
taosGetTimestampMs
();
char
consumerGroupid
[
128
]
=
{
0
};
sprintf
(
consumerGroupid
,
"group_id_%"
PRId64
,
ts
);
tmq_conf_set
(
conf
,
"enable.auto.commit"
,
"true"
);
tmq_conf_set
(
conf
,
"auto.commit.interval.ms"
,
"
1
000"
);
tmq_conf_set
(
conf
,
"group.id"
,
"cgrpName45"
);
tmq_conf_set
(
conf
,
"auto.commit.interval.ms"
,
"
2
000"
);
tmq_conf_set
(
conf
,
"group.id"
,
consumerGroupid
);
tmq_conf_set
(
conf
,
"td.connect.user"
,
"root"
);
tmq_conf_set
(
conf
,
"td.connect.pass"
,
"taosdata"
);
tmq_conf_set
(
conf
,
"auto.offset.reset"
,
"earliest"
);
tmq_conf_set
(
conf
,
"experimental.snapshot.enable"
,
"
tru
e"
);
tmq_conf_set
(
conf
,
"experimental.snapshot.enable"
,
"
fals
e"
);
tmq_conf_set
(
conf
,
"msg.with.table.name"
,
"true"
);
tmq_conf_set_auto_commit_cb
(
conf
,
tmq_commit_cb_print
,
NULL
);
...
...
@@ -1074,7 +1079,7 @@ TEST(clientCase, sub_tb_test) {
// 创建订阅 topics 列表
tmq_list_t
*
topicList
=
tmq_list_new
();
tmq_list_append
(
topicList
,
"topic_t
2
"
);
tmq_list_append
(
topicList
,
"topic_t
1
"
);
// 启动订阅
tmq_subscribe
(
tmq
,
topicList
);
...
...
@@ -1093,15 +1098,15 @@ TEST(clientCase, sub_tb_test) {
while
(
1
)
{
TAOS_RES
*
pRes
=
tmq_consumer_poll
(
tmq
,
timeout
);
if
(
pRes
)
{
char
buf
[
1
024
];
char
buf
[
1
28
];
const
char
*
topicName
=
tmq_get_topic_name
(
pRes
);
const
char
*
dbName
=
tmq_get_db_name
(
pRes
);
int32_t
vgroupId
=
tmq_get_vgroup_id
(
pRes
);
printf
(
"topic: %s
\n
"
,
topicName
);
printf
(
"db: %s
\n
"
,
dbName
);
printf
(
"vgroup id: %d
\n
"
,
vgroupId
);
//
const char* topicName = tmq_get_topic_name(pRes);
//
const char* dbName = tmq_get_db_name(pRes);
//
int32_t vgroupId = tmq_get_vgroup_id(pRes);
//
//
printf("topic: %s\n", topicName);
//
printf("db: %s\n", dbName);
//
printf("vgroup id: %d\n", vgroupId);
while
(
1
)
{
TAOS_ROW
row
=
taos_fetch_row
(
pRes
);
...
...
@@ -1111,16 +1116,14 @@ TEST(clientCase, sub_tb_test) {
fields
=
taos_fetch_fields
(
pRes
);
numOfFields
=
taos_field_count
(
pRes
);
precision
=
taos_result_precision
(
pRes
);
taos_print_row
(
buf
,
row
,
fields
,
numOfFields
);
totalRows
+=
1
;
printf
(
"precision: %d, row content: %s
\n
"
,
precision
,
buf
);
if
(
totalRows
%
100000
==
0
)
{
taos_print_row
(
buf
,
row
,
fields
,
numOfFields
);
printf
(
"row content: %s
\n
"
,
buf
);
}
}
taos_free_result
(
pRes
);
// if ((++count) > 1) {
// break;
// }
}
else
{
break
;
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
213e8b89
...
...
@@ -113,8 +113,16 @@ static void vmProcessFetchQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
int32_t
code
=
vnodeProcessFetchMsg
(
pVnode
->
pImpl
,
pMsg
,
pInfo
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
dGError
(
"vnodeProcessFetchMsg vgId:%d, msg:%p failed to fetch since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
if
(
terrno
!=
0
)
{
code
=
terrno
;
}
if
(
code
==
TSDB_CODE_WAL_LOG_NOT_EXIST
)
{
dGDebug
(
"vnodeProcessFetchMsg vgId:%d, msg:%p failed to fetch since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
}
else
{
dGError
(
"vnodeProcessFetchMsg vgId:%d, msg:%p failed to fetch since %s"
,
pVnode
->
vgId
,
pMsg
,
terrstr
());
}
vmSendRsp
(
pMsg
,
code
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录