fix(stream): add some logs.

This commit is contained in:
Haojun Liao 2024-02-26 22:49:38 +08:00
parent 6e891b0145
commit 81a1eac87a
1 changed files with 6 additions and 2 deletions

View File

@ -300,14 +300,15 @@ static int32_t doAddShuffleSinkTask(SMnode* pMnode, SStreamObj* pStream, SEpSet*
} }
static int64_t getVgroupLastVer(const SArray* pList, int32_t vgId) { 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); SVgroupVer* pVer = taosArrayGet(pList, i);
if (pVer->vgId == vgId) { if (pVer->vgId == vgId) {
return pVer->ver; 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; return -1;
} }
@ -472,6 +473,9 @@ static int32_t addSourceTask(SMnode* pMnode, SSubplan* plan, SStreamObj* pStream
int code = int code =
doAddSourceTask(pMnode, plan, pStream, pEpset, nextWindowSkey, pVerList, pVgroup, false, useTriggerParam); doAddSourceTask(pMnode, plan, pStream, pEpset, nextWindowSkey, pVerList, pVgroup, false, useTriggerParam);
if (code != 0) { if (code != 0) {
mError("create stream task, code:%s", tstrerror(code));
// todo drop the added source tasks.
sdbRelease(pSdb, pVgroup); sdbRelease(pSdb, pVgroup);
return code; return code;
} }