From 87c7e4c0febc57be40f29fcc6537d95abc76a064 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 11 Aug 2023 16:19:46 +0800 Subject: [PATCH] fix(stream): not launch stream tasks when restarting the stream tasks. --- source/dnode/vnode/src/tq/tq.c | 2 ++ source/libs/stream/src/streamTask.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 873f420802..eb0dfd30ba 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -1180,6 +1180,8 @@ int32_t tqProcessTaskDeployReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms if (p != NULL) { streamMetaReleaseTask(pStreamMeta, p); } + } else { + tqDebug("vgId:%d not leader, not launch stream task s-task:0x%x", vgId, taskId); } } else { tqWarn("vgId:%d failed to add s-task:0x%x, since already exists in meta store", vgId, taskId); diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index 4bdc38b742..bd1ffcfbb3 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -495,7 +495,10 @@ int32_t streamTaskRestart(SStreamTask* pTask, const char* pDir, bool startTask) pTask->status.stage, streamGetTaskStatusStr(pTask->status.taskStatus)); // 3. start to check the downstream status - streamTaskCheckDownstreamTasks(pTask); + if (startTask) { + streamTaskCheckDownstreamTasks(pTask); + } + return 0; }