Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
80324983
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看板
提交
80324983
编写于
6月 16, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream): drop stream
上级
69eb9dad
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
16 deletion
+21
-16
include/common/tmsg.h
include/common/tmsg.h
+3
-3
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+18
-13
未找到文件。
include/common/tmsg.h
浏览文件 @
80324983
...
...
@@ -2008,7 +2008,7 @@ typedef struct {
char
sql
[
TSDB_SHOW_SQL_LEN
];
uint64_t
queryId
;
int64_t
useconds
;
int64_t
stime
;
// timestamp precision ms
int64_t
stime
;
// timestamp precision ms
int64_t
reqRid
;
int32_t
pid
;
bool
stableQuery
;
...
...
@@ -2257,8 +2257,8 @@ typedef struct {
}
SMqVDeleteRsp
;
typedef
struct
{
char
name
[
TSDB_STREAM_FNAME_LEN
];
int
64_t
streamId
;
char
name
[
TSDB_STREAM_FNAME_LEN
];
int
8_t
igNotExists
;
}
SMDropStreamTaskReq
;
typedef
struct
{
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
80324983
...
...
@@ -278,8 +278,8 @@ int32_t mndAddStreamToTrans(SMnode *pMnode, SStreamObj *pStream, const char *ast
}
static
int32_t
mndCreateStbForStream
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
const
SStreamObj
*
pStream
,
const
char
*
user
)
{
SStbObj
*
pStb
=
NULL
;
SDbObj
*
pDb
=
NULL
;
SStbObj
*
pStb
=
NULL
;
SDbObj
*
pDb
=
NULL
;
SMCreateStbReq
createReq
=
{
0
};
tstrncpy
(
createReq
.
name
,
pStream
->
targetSTbName
,
TSDB_TABLE_FNAME_LEN
);
...
...
@@ -321,7 +321,6 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre
goto
_OVER
;
}
if
(
mndCheckDbAuth
(
pMnode
,
user
,
MND_OPER_WRITE_DB
,
pDb
)
!=
0
)
{
goto
_OVER
;
}
...
...
@@ -520,13 +519,19 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) {
/*SDbObj *pDb = NULL;*/
/*SUserObj *pUser = NULL;*/
SMDropStreamTaskReq
drop
Stream
Req
=
*
(
SMDropStreamTaskReq
*
)
pReq
->
pCont
;
SMDropStreamTaskReq
dropReq
=
*
(
SMDropStreamTaskReq
*
)
pReq
->
pCont
;
pStream
=
mndAcquireStream
(
pMnode
,
drop
Stream
Req
.
name
);
pStream
=
mndAcquireStream
(
pMnode
,
dropReq
.
name
);
if
(
pStream
==
NULL
)
{
terrno
=
TSDB_CODE_MND_STREAM_NOT_EXIST
;
return
-
1
;
if
(
dropReq
.
igNotExists
)
{
mDebug
(
"stream:%s, not exist, ignore not exist is set"
,
dropReq
.
name
);
code
=
0
;
goto
DROP_STREAM_OVER
;
}
else
{
terrno
=
TSDB_CODE_MND_STREAM_NOT_EXIST
;
return
-
1
;
}
}
#if 0
...
...
@@ -539,19 +544,19 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) {
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_NOTHING
,
pReq
);
if
(
pTrans
==
NULL
)
{
mError
(
"stream:%s, failed to drop since %s"
,
drop
Stream
Req
.
name
,
terrstr
());
return
-
1
;
mError
(
"stream:%s, failed to drop since %s"
,
dropReq
.
name
,
terrstr
());
return
code
;
}
mDebug
(
"trans:%d, used to drop stream:%s"
,
pTrans
->
id
,
drop
Stream
Req
.
name
);
mDebug
(
"trans:%d, used to drop stream:%s"
,
pTrans
->
id
,
dropReq
.
name
);
// drop all tasks
if
(
mndDropStreamTasks
(
pMnode
,
pTrans
,
pStream
)
<
0
)
{
mError
(
"stream:%s, failed to drop task since %s"
,
drop
Stream
Req
.
name
,
terrstr
());
return
-
1
;
mError
(
"stream:%s, failed to drop task since %s"
,
dropReq
.
name
,
terrstr
());
return
code
;
}
DROP_STREAM_OVER:
return
0
;
return
code
;
}
static
int32_t
mndGetNumOfStreams
(
SMnode
*
pMnode
,
char
*
dbName
,
int32_t
*
pNumOfStreams
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录