Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
27af0747
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看板
提交
27af0747
编写于
5月 26, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(sma): using separate vg
上级
0dcd7ab8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
18 deletion
+20
-18
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-1
source/dnode/mnode/impl/src/mndScheduler.c
source/dnode/mnode/impl/src/mndScheduler.c
+5
-1
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+13
-16
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
27af0747
...
...
@@ -588,7 +588,8 @@ typedef struct {
int8_t
status
;
int8_t
createdBy
;
// STREAM_CREATED_BY__USER or SMA
int32_t
fixedSinkVgId
;
// 0 for shuffle
int64_t
smaId
;
// 0 for unused
SVgObj
fixedSinkVg
;
int64_t
smaId
;
// 0 for unused
int8_t
trigger
;
int32_t
triggerParam
;
int64_t
waterMark
;
...
...
source/dnode/mnode/impl/src/mndScheduler.c
浏览文件 @
27af0747
...
...
@@ -229,11 +229,14 @@ int32_t mndAddFixedSinkToStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStr
taosArrayPush
(
tasks
,
&
pTask
);
pTask
->
nodeId
=
pStream
->
fixedSinkVgId
;
#if 0
SVgObj* pVgroup = mndAcquireVgroup(pMnode, pStream->fixedSinkVgId);
if (pVgroup == NULL) {
return -1;
}
pTask->epSet = mndGetVgroupEpset(pMnode, pVgroup);
#endif
pTask
->
epSet
=
mndGetVgroupEpset
(
pMnode
,
&
pStream
->
fixedSinkVg
);
// source
pTask
->
sourceType
=
TASK_SOURCE__MERGE
;
pTask
->
inputType
=
TASK_INPUT_TYPE__DATA_BLOCK
;
...
...
@@ -254,7 +257,8 @@ int32_t mndAddFixedSinkToStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStr
// dispatch
pTask
->
dispatchType
=
TASK_DISPATCH__NONE
;
mndPersistTaskDeployReq
(
pTrans
,
pTask
,
&
pTask
->
epSet
,
TDMT_VND_TASK_DEPLOY
,
pVgroup
->
vgId
);
/*mndPersistTaskDeployReq(pTrans, pTask, &pTask->epSet, TDMT_VND_TASK_DEPLOY, pVgroup->vgId);*/
mndPersistTaskDeployReq
(
pTrans
,
pTask
,
&
pTask
->
epSet
,
TDMT_VND_TASK_DEPLOY
,
pStream
->
fixedSinkVg
.
vgId
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
27af0747
...
...
@@ -295,9 +295,9 @@ static void *mndBuildVCreateSmaReq(SMnode *pMnode, SVgObj *pVgroup, SSmaObj *pSm
}
static
void
*
mndBuildVDropSmaReq
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SSmaObj
*
pSma
,
int32_t
*
pContLen
)
{
SEncoder
encoder
=
{
0
};
int32_t
contLen
;
SName
name
=
{
0
};
SEncoder
encoder
=
{
0
};
int32_t
contLen
;
SName
name
=
{
0
};
tNameFromString
(
&
name
,
pSma
->
name
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
SVDropTSmaReq
req
=
{
0
};
...
...
@@ -482,14 +482,6 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
memcpy
(
smaObj
.
ast
,
pCreate
->
ast
,
smaObj
.
astLen
);
}
SVgObj
smaVgObj
=
{
0
};
if
(
mndAllocSmaVgroup
(
pMnode
,
pDb
,
&
smaVgObj
)
!=
0
)
{
mError
(
"sma:%s, failed to create since %s"
,
smaObj
.
name
,
terrstr
());
return
-
1
;
}
smaObj
.
dstVgId
=
smaVgObj
.
vgId
;
SStreamObj
streamObj
=
{
0
};
tstrncpy
(
streamObj
.
name
,
pCreate
->
name
,
TSDB_STREAM_FNAME_LEN
);
tstrncpy
(
streamObj
.
sourceDb
,
pDb
->
name
,
TSDB_DB_FNAME_LEN
);
...
...
@@ -502,7 +494,12 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
streamObj
.
createdBy
=
STREAM_CREATED_BY__SMA
;
streamObj
.
fixedSinkVgId
=
smaObj
.
dstVgId
;
streamObj
.
smaId
=
smaObj
.
uid
;
/*streamObj.physicalPlan = "";*/
if
(
mndAllocSmaVgroup
(
pMnode
,
pDb
,
&
streamObj
.
fixedSinkVg
)
!=
0
)
{
mError
(
"sma:%s, failed to create since %s"
,
smaObj
.
name
,
terrstr
());
return
-
1
;
}
smaObj
.
dstVgId
=
streamObj
.
fixedSinkVg
.
vgId
;
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_CREATE_SMA
,
pReq
);
...
...
@@ -512,11 +509,11 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
mndTransSetDbInfo
(
pTrans
,
pDb
);
if
(
mndSetCreateSmaRedoLogs
(
pMnode
,
pTrans
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupRedoLogs
(
pMnode
,
pTrans
,
&
s
maVgObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupRedoLogs
(
pMnode
,
pTrans
,
&
s
treamObj
.
fixedSinkVg
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaCommitLogs
(
pMnode
,
pTrans
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
&
s
maVgObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupCommitLogs
(
pMnode
,
pTrans
,
&
s
treamObj
.
fixedSinkVg
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
smaObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
s
maVgObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateSmaVgroupRedoActions
(
pMnode
,
pTrans
,
pDb
,
&
s
treamObj
.
fixedSinkVg
)
!=
0
)
goto
_OVER
;
if
(
mndAddStreamToTrans
(
pMnode
,
&
streamObj
,
pCreate
->
ast
,
STREAM_TRIGGER_AT_ONCE
,
0
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
...
@@ -656,7 +653,7 @@ static int32_t mndSetDropSmaCommitLogs(SMnode *pMnode, STrans *pTrans, SSmaObj *
return
0
;
}
static
int32_t
mndSetDropSmaVgroupRedoLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SVgObj
*
pVgroup
)
{
static
int32_t
mndSetDropSmaVgroupRedoLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SVgObj
*
pVgroup
)
{
SSdbRaw
*
pVgRaw
=
mndVgroupActionEncode
(
pVgroup
);
if
(
pVgRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendRedolog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录