Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cc5ff446
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
cc5ff446
编写于
7月 30, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(stream): handle the stream hb.
上级
8dfef876
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
147 addition
and
112 deletion
+147
-112
source/dnode/mnode/impl/src/mndScheduler.c
source/dnode/mnode/impl/src/mndScheduler.c
+21
-19
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+123
-90
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+3
-3
未找到文件。
source/dnode/mnode/impl/src/mndScheduler.c
浏览文件 @
cc5ff446
...
@@ -25,10 +25,12 @@
...
@@ -25,10 +25,12 @@
#define SINK_NODE_LEVEL (0)
#define SINK_NODE_LEVEL (0)
extern
bool
tsDeployOnSnode
;
extern
bool
tsDeployOnSnode
;
static
int32_t
setTaskUpstreamEpInfo
(
const
SStreamTask
*
pTask
,
SStreamTask
*
pDownstream
);
static
int32_t
setTaskUpstreamInfo
(
SStreamTask
*
pTask
,
const
SStreamTask
*
pUpstreamTask
);
static
int32_t
updateTaskUpstreamInfo
(
SStreamTask
*
pTask
,
int32_t
nodeId
,
const
SEpSet
*
pEpSet
);
static
int32_t
mndAddSinkTaskToStream
(
SStreamObj
*
pStream
,
SArray
*
pTaskList
,
SMnode
*
pMnode
,
int32_t
vgId
,
static
int32_t
mndAddSinkTaskToStream
(
SStreamObj
*
pStream
,
SArray
*
pTaskList
,
SMnode
*
pMnode
,
int32_t
vgId
,
SVgObj
*
pVgroup
,
int32_t
fillHistory
);
SVgObj
*
pVgroup
,
int32_t
fillHistory
);
static
void
setFixedDownstreamEpInfo
(
SStreamTask
*
pDstTask
,
const
SStreamTask
*
pTask
);
static
void
setFixedDownstreamInfo
(
SStreamTask
*
pTask
,
const
SStreamTask
*
pDownstreamTask
);
static
void
updateFixDownstreamInfo
(
SStreamTask
*
pTask
,
int32_t
nodeId
,
const
SEpSet
*
pEpSet
);
int32_t
mndConvertRsmaTask
(
char
**
pDst
,
int32_t
*
pDstLen
,
const
char
*
ast
,
int64_t
uid
,
int8_t
triggerType
,
int32_t
mndConvertRsmaTask
(
char
**
pDst
,
int32_t
*
pDstLen
,
const
char
*
ast
,
int64_t
uid
,
int8_t
triggerType
,
int64_t
watermark
,
int64_t
deleteMark
)
{
int64_t
watermark
,
int64_t
deleteMark
)
{
...
@@ -141,7 +143,7 @@ int32_t mndAddDispatcherForInternalTask(SMnode* pMnode, SStreamObj* pStream, SAr
...
@@ -141,7 +143,7 @@ int32_t mndAddDispatcherForInternalTask(SMnode* pMnode, SStreamObj* pStream, SAr
}
}
}
else
{
}
else
{
SStreamTask
*
pOneSinkTask
=
taosArrayGetP
(
pSinkNodeList
,
0
);
SStreamTask
*
pOneSinkTask
=
taosArrayGetP
(
pSinkNodeList
,
0
);
setFixedDownstream
Ep
Info
(
pTask
,
pOneSinkTask
);
setFixedDownstreamInfo
(
pTask
,
pOneSinkTask
);
}
}
return
0
;
return
0
;
...
@@ -272,7 +274,7 @@ static int32_t addSourceStreamTask(SMnode* pMnode, SVgObj* pVgroup, SArray* pTas
...
@@ -272,7 +274,7 @@ static int32_t addSourceStreamTask(SMnode* pMnode, SVgObj* pVgroup, SArray* pTas
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pSinkTaskList
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pSinkTaskList
);
++
i
)
{
SStreamTask
*
pSinkTask
=
taosArrayGetP
(
pSinkTaskList
,
i
);
SStreamTask
*
pSinkTask
=
taosArrayGetP
(
pSinkTaskList
,
i
);
setTaskUpstream
EpInfo
(
pTask
,
pSink
Task
);
setTaskUpstream
Info
(
pSinkTask
,
p
Task
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -293,27 +295,27 @@ static SStreamChildEpInfo* createStreamTaskEpInfo(const SStreamTask* pTask) {
...
@@ -293,27 +295,27 @@ static SStreamChildEpInfo* createStreamTaskEpInfo(const SStreamTask* pTask) {
return
pEpInfo
;
return
pEpInfo
;
}
}
void
setFixedDownstream
EpInfo
(
SStreamTask
*
pDstTask
,
const
SStreamTask
*
p
Task
)
{
void
setFixedDownstream
Info
(
SStreamTask
*
pTask
,
const
SStreamTask
*
pDownstream
Task
)
{
STaskDispatcherFixedEp
*
pDispatcher
=
&
p
Dst
Task
->
fixedEpDispatcher
;
STaskDispatcherFixedEp
*
pDispatcher
=
&
pTask
->
fixedEpDispatcher
;
pDispatcher
->
taskId
=
pTask
->
id
.
taskId
;
pDispatcher
->
taskId
=
p
Downstream
Task
->
id
.
taskId
;
pDispatcher
->
nodeId
=
pTask
->
info
.
nodeId
;
pDispatcher
->
nodeId
=
p
Downstream
Task
->
info
.
nodeId
;
pDispatcher
->
epSet
=
pTask
->
info
.
epSet
;
pDispatcher
->
epSet
=
p
Downstream
Task
->
info
.
epSet
;
p
Dst
Task
->
outputInfo
.
type
=
TASK_OUTPUT__FIXED_DISPATCH
;
pTask
->
outputInfo
.
type
=
TASK_OUTPUT__FIXED_DISPATCH
;
p
Dst
Task
->
msgInfo
.
msgType
=
TDMT_STREAM_TASK_DISPATCH
;
pTask
->
msgInfo
.
msgType
=
TDMT_STREAM_TASK_DISPATCH
;
}
}
int32_t
setTaskUpstream
EpInfo
(
const
SStreamTask
*
pTask
,
SStreamTask
*
pDownstream
)
{
int32_t
setTaskUpstream
Info
(
SStreamTask
*
pTask
,
const
SStreamTask
*
pUpstreamTask
)
{
SStreamChildEpInfo
*
pEpInfo
=
createStreamTaskEpInfo
(
pTask
);
SStreamChildEpInfo
*
pEpInfo
=
createStreamTaskEpInfo
(
p
Upstream
Task
);
if
(
pEpInfo
==
NULL
)
{
if
(
pEpInfo
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
if
(
p
Downstream
->
pUpstreamInfoList
==
NULL
)
{
if
(
p
Task
->
pUpstreamInfoList
==
NULL
)
{
p
Downstream
->
pUpstreamInfoList
=
taosArrayInit
(
4
,
POINTER_BYTES
);
p
Task
->
pUpstreamInfoList
=
taosArrayInit
(
4
,
POINTER_BYTES
);
}
}
taosArrayPush
(
p
Downstream
->
pUpstreamInfoList
,
&
pEpInfo
);
taosArrayPush
(
p
Task
->
pUpstreamInfoList
,
&
pEpInfo
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -421,12 +423,12 @@ static int32_t doAddSourceTask(SArray* pTaskList, int8_t fillHistory, int64_t ui
...
@@ -421,12 +423,12 @@ static int32_t doAddSourceTask(SArray* pTaskList, int8_t fillHistory, int64_t ui
pWindow
->
skey
,
pWindow
->
ekey
);
pWindow
->
skey
,
pWindow
->
ekey
);
// all the source tasks dispatch result to a single agg node.
// all the source tasks dispatch result to a single agg node.
setFixedDownstream
Ep
Info
(
pTask
,
pDownstreamTask
);
setFixedDownstreamInfo
(
pTask
,
pDownstreamTask
);
if
(
mndAssignStreamTaskToVgroup
(
pMnode
,
pTask
,
pPlan
,
pVgroup
)
<
0
)
{
if
(
mndAssignStreamTaskToVgroup
(
pMnode
,
pTask
,
pPlan
,
pVgroup
)
<
0
)
{
return
-
1
;
return
-
1
;
}
}
return
setTaskUpstream
EpInfo
(
pTask
,
pDownstream
Task
);
return
setTaskUpstream
Info
(
pDownstreamTask
,
p
Task
);
}
}
static
int32_t
doAddAggTask
(
uint64_t
uid
,
SArray
*
pTaskList
,
SArray
*
pSinkNodeList
,
SMnode
*
pMnode
,
SStreamObj
*
pStream
,
static
int32_t
doAddAggTask
(
uint64_t
uid
,
SArray
*
pTaskList
,
SArray
*
pSinkNodeList
,
SMnode
*
pMnode
,
SStreamObj
*
pStream
,
...
@@ -598,7 +600,7 @@ static void setSinkTaskUpstreamInfo(SArray* pTasksList, const SStreamTask* pUpst
...
@@ -598,7 +600,7 @@ static void setSinkTaskUpstreamInfo(SArray* pTasksList, const SStreamTask* pUpst
SArray
*
pSinkTaskList
=
taosArrayGetP
(
pTasksList
,
SINK_NODE_LEVEL
);
SArray
*
pSinkTaskList
=
taosArrayGetP
(
pTasksList
,
SINK_NODE_LEVEL
);
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pSinkTaskList
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pSinkTaskList
);
++
i
)
{
SStreamTask
*
pSinkTask
=
taosArrayGetP
(
pSinkTaskList
,
i
);
SStreamTask
*
pSinkTask
=
taosArrayGetP
(
pSinkTaskList
,
i
);
setTaskUpstream
EpInfo
(
pUpstreamTask
,
pSink
Task
);
setTaskUpstream
Info
(
pSinkTask
,
pUpstream
Task
);
}
}
}
}
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
cc5ff446
...
@@ -30,8 +30,21 @@
...
@@ -30,8 +30,21 @@
#define MND_STREAM_VER_NUMBER 3
#define MND_STREAM_VER_NUMBER 3
#define MND_STREAM_RESERVE_SIZE 64
#define MND_STREAM_RESERVE_SIZE 64
#define MND_STREAM_MAX_NUM 60
#define MND_STREAM_HB_INTERVAL 100 // 100 sec
#define MND_STREAM_MAX_NUM 60
typedef
struct
SNodeEntry
{
int32_t
vgId
;
SEpSet
epset
;
// compare the epset to identify the vgroup tranferring between different dnodes.
int64_t
hbTimestamp
;
// second
}
SNodeEntry
;
typedef
struct
SStreamVnodeRevertIndex
{
SHashObj
*
pVnodeMap
;
SArray
*
pVnodeEntryList
;
}
SStreamVnodeRevertIndex
;
static
SStreamVnodeRevertIndex
execNodeList
;
static
int32_t
mndStreamActionInsert
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
static
int32_t
mndStreamActionInsert
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
static
int32_t
mndStreamActionDelete
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
static
int32_t
mndStreamActionDelete
(
SSdb
*
pSdb
,
SStreamObj
*
pStream
);
...
@@ -49,6 +62,8 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
...
@@ -49,6 +62,8 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
static
void
mndCancelGetNextStreamTask
(
SMnode
*
pMnode
,
void
*
pIter
);
static
void
mndCancelGetNextStreamTask
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndProcessPauseStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessPauseStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessResumeStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessResumeStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndBuildStreamCheckpointSourceReq2
(
void
**
pBuf
,
int32_t
*
pLen
,
int32_t
nodeId
,
int64_t
checkpointId
,
int64_t
streamId
,
int32_t
taskId
);
int32_t
mndInitStream
(
SMnode
*
pMnode
)
{
int32_t
mndInitStream
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{
SSdbTable
table
=
{
...
@@ -85,11 +100,6 @@ int32_t mndInitStream(SMnode *pMnode) {
...
@@ -85,11 +100,6 @@ int32_t mndInitStream(SMnode *pMnode) {
return
sdbSetTable
(
pMnode
->
pSdb
,
table
);
return
sdbSetTable
(
pMnode
->
pSdb
,
table
);
}
}
static
int32_t
mndBuildStreamCheckpointSourceReq
(
void
**
pBuf
,
int32_t
*
pLen
,
const
SStreamTask
*
pTask
,
SMStreamDoCheckpointMsg
*
pMsg
);
static
int32_t
mndBuildStreamCheckpointSourceReq2
(
void
**
pBuf
,
int32_t
*
pLen
,
int32_t
nodeId
,
int64_t
checkpointId
,
int64_t
streamId
,
int32_t
taskId
);
void
mndCleanupStream
(
SMnode
*
pMnode
)
{}
void
mndCleanupStream
(
SMnode
*
pMnode
)
{}
...
@@ -838,48 +848,6 @@ _OVER:
...
@@ -838,48 +848,6 @@ _OVER:
return
code
;
return
code
;
}
}
// static int32_t mndCreateCheckpoint(SMnode *pMnode, int32_t vgId, SList *pStreamList) {
// void *buf = NULL;
// int32_t tlen = 0;
// int32_t checkpointId = tGenIdPI64();
// SVgObj *pVgObj = mndAcquireVgroup(pMnode, vgId);
// SArray *stream = taosArrayInit(64, sizeof(void *));
// SListIter iter = {0};
// tdListInitIter(pStreamList, &iter, TD_LIST_FORWARD);
// SListNode *pNode = NULL;
// while ((pNode = tdListNext(&iter)) != NULL) {
// char streamName[TSDB_STREAM_FNAME_LEN] = {0};
// tdListNodeGetData(pStreamList, pNode, streamName);
// SStreamObj *pStream = mndAcquireStream(pMnode, streamName);
// taosArrayPush(stream, &pStream);
// }
// if (mndBuildStreamCheckpointSourceReq2(&buf, &tlen, vgId, checkpointId, 0, 0) < 0) {
// mndReleaseVgroup(pMnode, pVgObj);
// for (int i = 0; i < taosArrayGetSize(stream); i++) {
// SStreamObj *p = taosArrayGetP(stream, i);
// mndReleaseStream(pMnode, p);
// }
// taosArrayDestroy(stream);
// return -1;
// STransAction action = {0};
// action.epSet = mndGetVgroupEpset(pMnode, pVgObj);
// action.pCont = buf;
// action.contLen = tlen;
// action.msgType = TDMT_VND_STREAM_CHECK_POINT_SOURCE;
// }
// mndReleaseVgroup(pMnode, pVgObj);
// for (int i = 0; i < taosArrayGetSize(stream); i++) {
// SStreamObj *p = taosArrayGetP(stream, i);
// mndReleaseStream(pMnode, p);
// }
// taosArrayDestroy(stream);
// return 0;
// }
static
int32_t
mndProcessStreamCheckpointTmr
(
SRpcMsg
*
pReq
)
{
static
int32_t
mndProcessStreamCheckpointTmr
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
...
@@ -897,48 +865,6 @@ static int32_t mndProcessStreamCheckpointTmr(SRpcMsg *pReq) {
...
@@ -897,48 +865,6 @@ static int32_t mndProcessStreamCheckpointTmr(SRpcMsg *pReq) {
return
0
;
return
0
;
}
}
static
int32_t
mndBuildStreamCheckpointSourceReq
(
void
**
pBuf
,
int32_t
*
pLen
,
const
SStreamTask
*
pTask
,
SMStreamDoCheckpointMsg
*
pMsg
)
{
SStreamCheckpointSourceReq
req
=
{
0
};
req
.
checkpointId
=
pMsg
->
checkpointId
;
req
.
nodeId
=
pTask
->
info
.
nodeId
;
req
.
expireTime
=
-
1
;
req
.
streamId
=
pTask
->
id
.
streamId
;
req
.
taskId
=
pTask
->
id
.
taskId
;
int32_t
code
;
int32_t
blen
;
tEncodeSize
(
tEncodeStreamCheckpointSourceReq
,
&
req
,
blen
,
code
);
if
(
code
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
int32_t
tlen
=
sizeof
(
SMsgHead
)
+
blen
;
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
void
*
abuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
SEncoder
encoder
;
tEncoderInit
(
&
encoder
,
abuf
,
tlen
);
tEncodeStreamCheckpointSourceReq
(
&
encoder
,
&
req
);
SMsgHead
*
pMsgHead
=
(
SMsgHead
*
)
buf
;
pMsgHead
->
contLen
=
htonl
(
tlen
);
pMsgHead
->
vgId
=
htonl
(
pTask
->
info
.
nodeId
);
tEncoderClear
(
&
encoder
);
*
pBuf
=
buf
;
*
pLen
=
tlen
;
return
0
;
}
static
int32_t
mndBuildStreamCheckpointSourceReq2
(
void
**
pBuf
,
int32_t
*
pLen
,
int32_t
nodeId
,
int64_t
checkpointId
,
static
int32_t
mndBuildStreamCheckpointSourceReq2
(
void
**
pBuf
,
int32_t
*
pLen
,
int32_t
nodeId
,
int64_t
checkpointId
,
int64_t
streamId
,
int32_t
taskId
)
{
int64_t
streamId
,
int32_t
taskId
)
{
SStreamCheckpointSourceReq
req
=
{
0
};
SStreamCheckpointSourceReq
req
=
{
0
};
...
@@ -1807,3 +1733,110 @@ static int32_t mndProcessResumeStreamReq(SRpcMsg *pReq) {
...
@@ -1807,3 +1733,110 @@ static int32_t mndProcessResumeStreamReq(SRpcMsg *pReq) {
return
TSDB_CODE_ACTION_IN_PROGRESS
;
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
}
// todo: handle the database drop/stream drop case
int32_t
mndProcessStreamHb
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SStreamHbMsg
req
=
{
0
};
SDecoder
decoder
=
{
0
};
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
pReq
->
pCont
,
pReq
->
contLen
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeStreamHbMsg
(
&
decoder
,
&
req
)
<
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
int64_t
now
=
taosGetTimestampSec
();
// only handle the vnode transfer case.
SArray
*
pList
=
taosArrayInit
(
4
,
sizeof
(
int32_t
));
// record the timeout node
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
execNodeList
.
pVnodeEntryList
);
++
i
)
{
SNodeEntry
*
pEntry
=
taosArrayGet
(
execNodeList
.
pVnodeEntryList
,
i
);
if
(
now
-
pEntry
->
hbTimestamp
>
MND_STREAM_HB_INTERVAL
)
{
// execNode timeout, try next
// taosArrayPush(pList, &pEntry);
}
if
(
pEntry
->
vgId
!=
req
.
vgId
)
{
continue
;
}
// check epset to identify whether the node has been transferred to other dnodes.
// 1. if the epset is changed
taosArrayPush
(
pList
,
&
pEntry
);
}
int32_t
nodeId
=
0
;
SEpSet
newEpSet
=
{
0
};
{
//check all streams that involved this vnode
SStreamObj
*
pStream
=
NULL
;
void
*
pIter
=
NULL
;
while
(
1
)
{
pIter
=
sdbFetch
(
pSdb
,
SDB_STREAM
,
pIter
,
(
void
**
)
&
pStream
);
if
(
pIter
==
NULL
)
{
break
;
}
// update the related upstream and downstream tasks
taosRLockLatch
(
&
pStream
->
lock
);
int32_t
numOfLevels
=
taosArrayGetSize
(
pStream
->
tasks
);
for
(
int32_t
j
=
0
;
j
<
numOfLevels
;
++
j
)
{
SArray
*
pLevel
=
taosArrayGetP
(
pStream
->
tasks
,
j
);
int32_t
numOfTasks
=
taosArrayGetSize
(
pLevel
);
for
(
int32_t
k
=
0
;
k
<
numOfTasks
;
++
k
)
{
SStreamTask
*
pTask
=
taosArrayGetP
(
pLevel
,
k
);
if
(
pTask
->
info
.
nodeId
==
nodeId
)
{
// pTask->info.epSet = 0; set the new epset
continue
;
}
// check for the dispath info and the upstream task info
int32_t
level
=
pTask
->
info
.
taskLevel
;
if
(
level
==
TASK_LEVEL__SOURCE
)
{
// only update the upstream info of the direct downstream tasks
if
(
pTask
->
outputInfo
.
type
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
// todo extract method
SArray
*
pVgs
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
int32_t
numOfVgroups
=
taosArrayGetSize
(
pVgs
);
for
(
int32_t
i
=
0
;
i
<
numOfVgroups
;
i
++
)
{
SVgroupInfo
*
pVgInfo
=
taosArrayGet
(
pVgs
,
i
);
if
(
pVgInfo
->
vgId
==
nodeId
)
{
pVgInfo
->
epSet
=
newEpSet
;
}
}
}
else
if
(
pTask
->
outputInfo
.
type
==
TASK_OUTPUT__FIXED_DISPATCH
)
{
STaskDispatcherFixedEp
*
pDispatcher
=
&
pTask
->
fixedEpDispatcher
;
if
(
pDispatcher
->
nodeId
==
nodeId
)
{
pDispatcher
->
epSet
=
newEpSet
;
}
}
else
{
// do nothing
}
}
else
if
(
level
==
TASK_LEVEL__AGG
)
{
// update the upstream info
SArray
*
pupstream
=
pTask
->
pUpstreamInfoList
;
// for(int32_t i = 0; i < )
}
else
{
// update the upstream tasks
}
}
}
}
taosRLockLatch
(
&
pStream
->
lock
);
}
mTrace
(
"receive stream-meta hb from vgId:%d, active numOfTasks:%d"
,
req
.
vgId
,
req
.
numOfTasks
);
return
TSDB_CODE_SUCCESS
;
}
source/libs/stream/src/streamMeta.c
浏览文件 @
cc5ff446
...
@@ -557,10 +557,10 @@ int32_t tEncodeStreamHbMsg(SEncoder* pEncoder, const SStreamHbMsg* pReq) {
...
@@ -557,10 +557,10 @@ int32_t tEncodeStreamHbMsg(SEncoder* pEncoder, const SStreamHbMsg* pReq) {
return
pEncoder
->
pos
;
return
pEncoder
->
pos
;
}
}
int32_t
tDecodeStreamHbMsg
(
SDecoder
*
pDecoder
,
SStreamHbMsg
*
pR
sp
)
{
int32_t
tDecodeStreamHbMsg
(
SDecoder
*
pDecoder
,
SStreamHbMsg
*
pR
eq
)
{
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pR
sp
->
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pR
eq
->
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pR
sp
->
numOfTasks
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pR
eq
->
numOfTasks
)
<
0
)
return
-
1
;
tEndDecode
(
pDecoder
);
tEndDecode
(
pDecoder
);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录