Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9006b0f5
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9006b0f5
编写于
3月 23, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add tsma
上级
20017d82
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
220 addition
and
28 deletion
+220
-28
include/common/tmsg.h
include/common/tmsg.h
+29
-0
include/common/tmsgdef.h
include/common/tmsgdef.h
+2
-0
include/util/taoserror.h
include/util/taoserror.h
+15
-11
source/common/src/tmsg.c
source/common/src/tmsg.c
+93
-0
source/dnode/mgmt/mnode/src/mmMsg.c
source/dnode/mgmt/mnode/src/mmMsg.c
+2
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+34
-14
source/dnode/mnode/impl/inc/mndSma.h
source/dnode/mnode/impl/inc/mndSma.h
+34
-0
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+3
-3
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+4
-0
source/util/src/terror.c
source/util/src/terror.c
+4
-0
未找到文件。
include/common/tmsg.h
浏览文件 @
9006b0f5
...
@@ -1897,6 +1897,35 @@ static FORCE_INLINE void* tDecodeSSchemaWrapper(void* buf, SSchemaWrapper* pSW)
...
@@ -1897,6 +1897,35 @@ static FORCE_INLINE void* tDecodeSSchemaWrapper(void* buf, SSchemaWrapper* pSW)
}
}
return
buf
;
return
buf
;
}
}
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
stb
[
TSDB_TABLE_FNAME_LEN
];
int8_t
igExists
;
int8_t
intervalUnit
;
int8_t
slidingUnit
;
int8_t
timezone
;
int64_t
interval
;
int64_t
offset
;
int64_t
sliding
;
int32_t
exprLen
;
int32_t
tagsFilterLen
;
char
*
expr
;
char
*
tagsFilter
;
}
SMCreateSmaReq
;
int32_t
tSerializeSMCreateSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateSmaReq
*
pReq
);
int32_t
tDeserializeSMCreateSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateSmaReq
*
pReq
);
void
tFreeSMCreateSmaReq
(
SMCreateSmaReq
*
pReq
);
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
int8_t
igNotExists
;
}
SMDropSmaReq
;
int32_t
tSerializeSMDropSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropSmaReq
*
pReq
);
int32_t
tDeserializeSMDropSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropSmaReq
*
pReq
);
typedef
struct
{
typedef
struct
{
int8_t
version
;
// for compatibility(default 0)
int8_t
version
;
// for compatibility(default 0)
int8_t
intervalUnit
;
// MACRO: TIME_UNIT_XXX
int8_t
intervalUnit
;
// MACRO: TIME_UNIT_XXX
...
...
include/common/tmsgdef.h
浏览文件 @
9006b0f5
...
@@ -127,6 +127,8 @@ enum {
...
@@ -127,6 +127,8 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_STB
,
"mnode-create-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_STB
,
"mnode-create-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_ALTER_STB
,
"mnode-alter-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_ALTER_STB
,
"mnode-alter-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_STB
,
"mnode-drop-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_STB
,
"mnode-drop-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_SMA
,
"mnode-create-sma"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_SMA
,
"mnode-drop-sma"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TABLE_META
,
"mnode-table-meta"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TABLE_META
,
"mnode-table-meta"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_VGROUP_LIST
,
"mnode-vgroup-list"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_VGROUP_LIST
,
"mnode-vgroup-list"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_QNODE_LIST
,
"mnode-qnode-list"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_QNODE_LIST
,
"mnode-qnode-list"
,
NULL
,
NULL
)
...
...
include/util/taoserror.h
浏览文件 @
9006b0f5
...
@@ -274,18 +274,22 @@ int32_t* taosGetErrno();
...
@@ -274,18 +274,22 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_STREAM_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03F1)
#define TSDB_CODE_MND_STREAM_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03F1)
#define TSDB_CODE_MND_INVALID_STREAM_OPTION TAOS_DEF_ERROR_CODE(0, 0x03F2)
#define TSDB_CODE_MND_INVALID_STREAM_OPTION TAOS_DEF_ERROR_CODE(0, 0x03F2)
// mnode-sma
#define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0400)
#define TSDB_CODE_MND_SMA_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0401)
// dnode
// dnode
#define TSDB_CODE_DND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x04
0
0)
#define TSDB_CODE_DND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x04
A
0)
#define TSDB_CODE_DND_OFFLINE TAOS_DEF_ERROR_CODE(0, 0x04
0
1)
#define TSDB_CODE_DND_OFFLINE TAOS_DEF_ERROR_CODE(0, 0x04
A
1)
#define TSDB_CODE_DND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x04
0
2)
#define TSDB_CODE_DND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x04
A
2)
#define TSDB_CODE_NODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
0
3)
#define TSDB_CODE_NODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
A
3)
#define TSDB_CODE_NODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
0
4)
#define TSDB_CODE_NODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
A
4)
#define TSDB_CODE_NODE_PARSE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x04
0
5)
#define TSDB_CODE_NODE_PARSE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x04
A
5)
#define TSDB_CODE_NODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x04
0
6)
#define TSDB_CODE_NODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x04
A
6)
#define TSDB_CODE_DND_VNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
10
)
#define TSDB_CODE_DND_VNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
A7
)
#define TSDB_CODE_DND_VNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
11
)
#define TSDB_CODE_DND_VNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x04
A8
)
#define TSDB_CODE_DND_VNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x04
12
)
#define TSDB_CODE_DND_VNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x04
A9
)
#define TSDB_CODE_DND_VNODE_TOO_MANY_VNODES TAOS_DEF_ERROR_CODE(0, 0x04
13
)
#define TSDB_CODE_DND_VNODE_TOO_MANY_VNODES TAOS_DEF_ERROR_CODE(0, 0x04
AA
)
// vnode
// vnode
#define TSDB_CODE_VND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0500)
#define TSDB_CODE_VND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0500)
...
...
source/common/src/tmsg.c
浏览文件 @
9006b0f5
...
@@ -589,6 +589,99 @@ void tFreeSMAltertbReq(SMAltertbReq *pReq) {
...
@@ -589,6 +589,99 @@ void tFreeSMAltertbReq(SMAltertbReq *pReq) {
pReq
->
pFields
=
NULL
;
pReq
->
pFields
=
NULL
;
}
}
int32_t
tSerializeSMCreateSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateSmaReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
stb
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
igExists
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
intervalUnit
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
slidingUnit
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
timezone
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
interval
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
offset
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
sliding
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
exprLen
)
<
0
)
return
-
1
;
if
(
pReq
->
exprLen
>
0
)
{
if
(
tEncodeBinary
(
&
encoder
,
pReq
->
expr
,
pReq
->
exprLen
)
<
0
)
return
-
1
;
}
if
(
tEncodeI32
(
&
encoder
,
pReq
->
tagsFilterLen
)
<
0
)
return
-
1
;
if
(
pReq
->
tagsFilterLen
>
0
)
{
if
(
tEncodeBinary
(
&
encoder
,
pReq
->
tagsFilter
,
pReq
->
tagsFilterLen
)
<
0
)
return
-
1
;
}
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
tCoderClear
(
&
encoder
);
return
tlen
;
}
int32_t
tDeserializeSMCreateSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateSmaReq
*
pReq
)
{
SCoder
decoder
=
{
0
};
tCoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_DECODER
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
stb
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
igExists
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
intervalUnit
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
slidingUnit
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
timezone
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
interval
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
offset
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
sliding
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
exprLen
)
<
0
)
return
-
1
;
if
(
pReq
->
exprLen
>
0
)
{
pReq
->
expr
=
malloc
(
pReq
->
exprLen
);
if
(
pReq
->
expr
==
NULL
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
expr
)
<
0
)
return
-
1
;
}
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
tagsFilterLen
)
<
0
)
return
-
1
;
if
(
pReq
->
tagsFilterLen
>
0
)
{
pReq
->
tagsFilter
=
malloc
(
pReq
->
tagsFilterLen
);
if
(
pReq
->
tagsFilter
==
NULL
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
tagsFilter
)
<
0
)
return
-
1
;
}
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
return
0
;
}
void
tFreeSMCreateSmaReq
(
SMCreateSmaReq
*
pReq
)
{
tfree
(
pReq
->
expr
);
tfree
(
pReq
->
tagsFilter
);
}
int32_t
tSerializeSMDropSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropSmaReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
igNotExists
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
tCoderClear
(
&
encoder
);
return
tlen
;
}
int32_t
tDeserializeSMDropSmaReq
(
void
*
buf
,
int32_t
bufLen
,
SMDropSmaReq
*
pReq
)
{
SCoder
decoder
=
{
0
};
tCoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_DECODER
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
igNotExists
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
return
0
;
}
int32_t
tSerializeSStatusReq
(
void
*
buf
,
int32_t
bufLen
,
SStatusReq
*
pReq
)
{
int32_t
tSerializeSStatusReq
(
void
*
buf
,
int32_t
bufLen
,
SStatusReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
...
...
source/dnode/mgmt/mnode/src/mmMsg.c
浏览文件 @
9006b0f5
...
@@ -123,6 +123,8 @@ void mmInitMsgHandles(SMgmtWrapper *pWrapper) {
...
@@ -123,6 +123,8 @@ void mmInitMsgHandles(SMgmtWrapper *pWrapper) {
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_SMA
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_SMA
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_TABLE_META
,
(
NodeMsgFp
)
mmProcessReadMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_TABLE_META
,
(
NodeMsgFp
)
mmProcessReadMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_VGROUP_LIST
,
(
NodeMsgFp
)
mmProcessReadMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_VGROUP_LIST
,
(
NodeMsgFp
)
mmProcessReadMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_QUERY
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_QUERY
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
0
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
9006b0f5
...
@@ -103,6 +103,8 @@ typedef enum {
...
@@ -103,6 +103,8 @@ typedef enum {
TRN_TYPE_CREATE_STB
=
4001
,
TRN_TYPE_CREATE_STB
=
4001
,
TRN_TYPE_ALTER_STB
=
4002
,
TRN_TYPE_ALTER_STB
=
4002
,
TRN_TYPE_DROP_STB
=
4003
,
TRN_TYPE_DROP_STB
=
4003
,
TRN_TYPE_CREATE_SMA
=
4004
,
TRN_TYPE_DROP_SMA
=
4005
,
TRN_TYPE_STB_SCOPE_END
,
TRN_TYPE_STB_SCOPE_END
,
}
ETrnType
;
}
ETrnType
;
...
@@ -306,20 +308,38 @@ typedef struct {
...
@@ -306,20 +308,38 @@ typedef struct {
}
SVgObj
;
}
SVgObj
;
typedef
struct
{
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
char
stb
[
TSDB_DB_FNAME_LEN
];
int64_t
createdTime
;
int64_t
createdTime
;
int64_t
updateTime
;
int64_t
uid
;
int64_t
uid
;
int64_t
stbUid
;
int64_t
dbUid
;
int8_t
intervalUnit
;
int32_t
version
;
int8_t
slidingUnit
;
int32_t
nextColId
;
int8_t
timezone
;
int32_t
numOfColumns
;
int64_t
interval
;
int32_t
numOfTags
;
int64_t
offset
;
SSchema
*
pColumns
;
int64_t
sliding
;
SSchema
*
pTags
;
int32_t
exprLen
;
SRWLatch
lock
;
int32_t
tagsFilterLen
;
char
comment
[
TSDB_STB_COMMENT_LEN
];
char
*
expr
;
char
*
tagsFilter
;
}
SSmaObj
;
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
int64_t
createdTime
;
int64_t
updateTime
;
int64_t
uid
;
int64_t
dbUid
;
int32_t
version
;
int32_t
nextColId
;
int32_t
numOfColumns
;
int32_t
numOfTags
;
SSchema
*
pColumns
;
SSchema
*
pTags
;
SRWLatch
lock
;
char
comment
[
TSDB_STB_COMMENT_LEN
];
}
SStbObj
;
}
SStbObj
;
typedef
struct
{
typedef
struct
{
...
...
source/dnode/mnode/impl/inc/mndSma.h
0 → 100644
浏览文件 @
9006b0f5
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_MND_SMA_H_
#define _TD_MND_SMA_H_
#include "mndInt.h"
#ifdef __cplusplus
extern
"C"
{
#endif
int32_t
mndInitSma
(
SMnode
*
pMnode
);
void
mndCleanupSma
(
SMnode
*
pMnode
);
SSmaObj
*
mndAcquireSma
(
SMnode
*
pMnode
,
char
*
smaName
);
void
mndReleaseSma
(
SMnode
*
pMnode
,
SStbObj
*
pStb
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_MND_SMA_H_*/
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
9006b0f5
...
@@ -18,15 +18,15 @@
...
@@ -18,15 +18,15 @@
#include "mndAuth.h"
#include "mndAuth.h"
#include "mndDb.h"
#include "mndDb.h"
#include "mndDnode.h"
#include "mndDnode.h"
#include "mndInfoSchema.h"
#include "mndMnode.h"
#include "mndMnode.h"
#include "mndShow.h"
#include "mndShow.h"
#include "mndTrans.h"
#include "mndTrans.h"
#include "mndUser.h"
#include "mndUser.h"
#include "mndVgroup.h"
#include "mndVgroup.h"
#include "mndInfoSchema.h"
#include "tname.h"
#include "tname.h"
#define TSDB_STB_VER_NUMBER 1
#define TSDB_STB_VER_NUMBER
1
#define TSDB_STB_RESERVE_SIZE 64
#define TSDB_STB_RESERVE_SIZE 64
static
SSdbRow
*
mndStbActionDecode
(
SSdbRaw
*
pRaw
);
static
SSdbRow
*
mndStbActionDecode
(
SSdbRaw
*
pRaw
);
...
@@ -1162,7 +1162,7 @@ static int32_t mndSetDropStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
...
@@ -1162,7 +1162,7 @@ static int32_t mndSetDropStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
static
int32_t
mndDropStb
(
SMnode
*
pMnode
,
SNodeMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
)
{
static
int32_t
mndDropStb
(
SMnode
*
pMnode
,
SNodeMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
)
{
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_STB
,
&
pReq
->
rpcMsg
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_STB
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
DROP_STB_OVER
;
if
(
pTrans
==
NULL
)
goto
DROP_STB_OVER
;
mDebug
(
"trans:%d, used to drop stb:%s"
,
pTrans
->
id
,
pStb
->
name
);
mDebug
(
"trans:%d, used to drop stb:%s"
,
pTrans
->
id
,
pStb
->
name
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
9006b0f5
...
@@ -406,6 +406,10 @@ static const char *mndTransType(ETrnType type) {
...
@@ -406,6 +406,10 @@ static const char *mndTransType(ETrnType type) {
return
"alter-stb"
;
return
"alter-stb"
;
case
TRN_TYPE_DROP_STB
:
case
TRN_TYPE_DROP_STB
:
return
"drop-stb"
;
return
"drop-stb"
;
case
TRN_TYPE_CREATE_SMA
:
return
"create-sma"
;
case
TRN_TYPE_DROP_SMA
:
return
"drop-sma"
;
default:
default:
return
"invalid"
;
return
"invalid"
;
}
}
...
...
source/util/src/terror.c
浏览文件 @
9006b0f5
...
@@ -270,6 +270,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CANT_PARALLEL, "Invalid stage to kill
...
@@ -270,6 +270,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CANT_PARALLEL, "Invalid stage to kill
// mnode-topic
// mnode-topic
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_UNSUPPORTED_TOPIC
,
"Topic with aggregation is unsupported"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_UNSUPPORTED_TOPIC
,
"Topic with aggregation is unsupported"
)
// mnode-sma
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_SMA_ALREADY_EXIST
,
"SMA already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_SMA_NOT_EXIST
,
"SMA does not exist"
)
// dnode
// dnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_ACTION_IN_PROGRESS
,
"Action in progress"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_ACTION_IN_PROGRESS
,
"Action in progress"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_OFFLINE
,
"Dnode is offline"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_OFFLINE
,
"Dnode is offline"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录