From 81a1eac87a9e17a240631f34720518f982bb6f32 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 26 Feb 2024 22:49:38 +0800 Subject: [PATCH] fix(stream): add some logs. --- source/dnode/mnode/impl/src/mndScheduler.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index ef9a7205e1..7831048f2d 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -300,14 +300,15 @@ static int32_t doAddShuffleSinkTask(SMnode* pMnode, SStreamObj* pStream, SEpSet* } static int64_t getVgroupLastVer(const SArray* pList, int32_t vgId) { - for (int32_t i = 0; i < taosArrayGetSize(pList); ++i) { + int32_t size = (int32_t) taosArrayGetSize(pList); + for (int32_t i = 0; i < size; ++i) { SVgroupVer* pVer = taosArrayGet(pList, i); if (pVer->vgId == vgId) { return pVer->ver; } } - mError("failed to find the vgId:%d for extract last version", vgId); + mError("failed to find the vgId:%d for extract last version, total existed vgs:%d", vgId, size); return -1; } @@ -472,6 +473,9 @@ static int32_t addSourceTask(SMnode* pMnode, SSubplan* plan, SStreamObj* pStream int code = doAddSourceTask(pMnode, plan, pStream, pEpset, nextWindowSkey, pVerList, pVgroup, false, useTriggerParam); if (code != 0) { + mError("create stream task, code:%s", tstrerror(code)); + + // todo drop the added source tasks. sdbRelease(pSdb, pVgroup); return code; }