Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4402bcef
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看板
提交
4402bcef
编写于
12月 16, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(stream): forbid source db replica > 1
上级
a6fff957
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
7 deletion
+16
-7
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+2
-4
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+11
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+1
-1
source/util/src/terror.c
source/util/src/terror.c
+1
-0
未找到文件。
include/util/taoserror.h
浏览文件 @
4402bcef
...
...
@@ -342,6 +342,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_INVALID_STREAM_OPTION TAOS_DEF_ERROR_CODE(0, 0x03F2)
#define TSDB_CODE_MND_STREAM_MUST_BE_DELETED TAOS_DEF_ERROR_CODE(0, 0x03F3)
#define TSDB_CODE_MND_STREAM_TASK_DROPPED TAOS_DEF_ERROR_CODE(0, 0x03F4)
#define TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB TAOS_DEF_ERROR_CODE(0, 0x03F5)
// mnode-sma
#define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0480)
...
...
source/client/src/clientTmq.c
浏览文件 @
4402bcef
...
...
@@ -1035,7 +1035,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
SCMSubscribeReq
req
=
{
0
};
int32_t
code
=
-
1
;
tscDebug
(
"
call
tmq subscribe, consumer: %"
PRId64
", topic num %d"
,
tmq
->
consumerId
,
sz
);
tscDebug
(
"tmq subscribe, consumer: %"
PRId64
", topic num %d"
,
tmq
->
consumerId
,
sz
);
req
.
consumerId
=
tmq
->
consumerId
;
tstrncpy
(
req
.
clientId
,
tmq
->
clientId
,
256
);
...
...
@@ -1043,7 +1043,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
req
.
topicNames
=
taosArrayInit
(
sz
,
sizeof
(
void
*
));
if
(
req
.
topicNames
==
NULL
)
goto
FAIL
;
tscDebug
(
"
call
tmq subscribe, consumer: %"
PRId64
", topic num %d"
,
tmq
->
consumerId
,
sz
);
tscDebug
(
"tmq subscribe, consumer: %"
PRId64
", topic num %d"
,
tmq
->
consumerId
,
sz
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
topic
=
taosArrayGetP
(
container
,
i
);
...
...
@@ -1570,7 +1570,6 @@ SMqTaosxRspObj* tmqBuildTaosxRspFromWrapper(SMqPollRspWrapper* pWrapper) {
}
int32_t
tmqPollImpl
(
tmq_t
*
tmq
,
int64_t
timeout
)
{
/*tscDebug("call poll");*/
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
tmq
->
clientTopics
);
i
++
)
{
SMqClientTopic
*
pTopic
=
taosArrayGet
(
tmq
->
clientTopics
,
i
);
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
pTopic
->
vgs
);
j
++
)
{
...
...
@@ -1794,7 +1793,6 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
}
TAOS_RES
*
tmq_consumer_poll
(
tmq_t
*
tmq
,
int64_t
timeout
)
{
/*tscDebug("call poll1");*/
void
*
rspObj
;
int64_t
startTime
=
taosGetTimestampMs
();
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
4402bcef
...
...
@@ -164,7 +164,8 @@ SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw) {
STREAM_DECODE_OVER:
taosMemoryFreeClear
(
buf
);
if
(
terrno
!=
TSDB_CODE_SUCCESS
)
{
mError
(
"stream:%s, failed to decode from raw:%p since %s"
,
pStream
==
NULL
?
"null"
:
pStream
->
name
,
pRaw
,
terrstr
());
mError
(
"stream:%s, failed to decode from raw:%p since %s"
,
pStream
==
NULL
?
"null"
:
pStream
->
name
,
pRaw
,
terrstr
());
taosMemoryFreeClear
(
pRow
);
return
NULL
;
}
...
...
@@ -624,6 +625,15 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
goto
_OVER
;
}
pDb
=
mndAcquireDb
(
pMnode
,
streamObj
.
sourceDb
);
if
(
pDb
->
cfg
.
replications
!=
1
)
{
mError
(
"stream source db must have only 1 replica, but %s has %d"
,
pDb
->
name
,
pDb
->
cfg
.
replications
);
terrno
=
TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB
;
mndReleaseDb
(
pMnode
,
pDb
);
pDb
=
NULL
;
goto
_OVER
;
}
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_DB_INSIDE
,
pReq
,
"create-stream"
);
if
(
pTrans
==
NULL
)
{
mError
(
"stream:%s, failed to create since %s"
,
createStreamReq
.
name
,
terrstr
());
...
...
@@ -680,7 +690,6 @@ _OVER:
}
mndReleaseStream
(
pMnode
,
pStream
);
mndReleaseDb
(
pMnode
,
pDb
);
tFreeSCMCreateStreamReq
(
&
createStreamReq
);
tFreeStreamObj
(
&
streamObj
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
4402bcef
...
...
@@ -738,7 +738,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
code
=
tqOffsetDelete
(
pTq
->
pOffsetStore
,
pReq
->
subKey
);
if
(
code
!=
0
)
{
tqError
(
"cannot process tq delete req %s, since no such offset"
,
pReq
->
subKey
);
tqError
(
"cannot process tq delete req %s, since no such offset
in cache
"
,
pReq
->
subKey
);
}
if
(
tqMetaDeleteHandle
(
pTq
,
pReq
->
subKey
)
<
0
)
{
...
...
source/util/src/terror.c
浏览文件 @
4402bcef
...
...
@@ -281,6 +281,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_ALREADY_EXIST, "Stream already exists
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STREAM_NOT_EXIST
,
"Stream not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_STREAM_OPTION
,
"Invalid stream option"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STREAM_MUST_BE_DELETED
,
"Stream must be dropped first"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB
,
"Stream temporarily does not support source db having replica > 1"
)
// mnode-sma
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_SMA_ALREADY_EXIST
,
"SMA already exists"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录