From 23341e1bdff0f89b64374b6514fcbc286cda4da8 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 5 Jan 2024 22:58:43 +0800 Subject: [PATCH] refactor: opt perf by avoid save tasks during restoring --- source/dnode/vnode/src/tqCommon/tqCommon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/tqCommon/tqCommon.c b/source/dnode/vnode/src/tqCommon/tqCommon.c index 6ceb0a95ba..6e83c2d0a9 100644 --- a/source/dnode/vnode/src/tqCommon/tqCommon.c +++ b/source/dnode/vnode/src/tqCommon/tqCommon.c @@ -152,9 +152,8 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM } } - tqDebug("s-task:%s start to save task", pTask->id.idStr); - - { + if (restored) { + tqDebug("s-task:%s vgId:%d start to save task", pTask->id.idStr, vgId); streamMetaSaveTask(pMeta, pTask); if (ppHTask != NULL) { streamMetaSaveTask(pMeta, *ppHTask); @@ -163,10 +162,11 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM if (streamMetaCommit(pMeta) < 0) { // persist to disk } + } else { + tqDebug("s-task:%s vgId:%d not save since restore not finish", pTask->id.idStr, vgId); } tqDebug("s-task:%s start to stop task after save task", pTask->id.idStr); - streamTaskStop(pTask); // keep the already handled info