From e77fefa056122faa37b4973144ba421789ef2d3e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 27 Oct 2023 19:16:01 +0800 Subject: [PATCH 1/3] fix:print log if assert & check epoch when update epoch --- source/client/src/clientTmq.c | 2 +- source/util/src/tlog.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index e998db989c..ff8a0b899b 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -1442,7 +1442,7 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) bool set = false; int32_t topicNumGet = taosArrayGetSize(pRsp->topics); - if (topicNumGet <= 0 && epoch <= tmq->epoch) { + if (epoch <= tmq->epoch) { tscInfo("consumer:0x%" PRIx64 " no update ep epoch from %d to epoch %d, incoming topics:%d", tmq->consumerId, tmq->epoch, epoch, topicNumGet); return false; diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index b858421e25..6fc0c15cec 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -795,7 +795,12 @@ static void *taosAsyncOutputLog(void *param) { updateCron = 0; } - if (pLogBuf->stop || pSlowBuf->stop) break; + if (pLogBuf->stop || pSlowBuf->stop) { + pLogBuf->lastDuration = LOG_MAX_WAIT_MSEC; + taosWriteLog(pLogBuf); + taosWriteLog(pSlowBuf); + break; + } } return NULL; @@ -822,7 +827,7 @@ bool taosAssertDebug(bool condition, const char *file, int32_t line, const char taosPrintTrace(flags, level, dflag, -1); if (tsAssert) { - // taosCloseLog(); + taosCloseLog(); taosMsleep(300); #ifdef NDEBUG From 17a58697fad5ba8ae109479b31f3de5b124ece9c Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 31 Oct 2023 15:37:59 +0800 Subject: [PATCH 2/3] fix:print log if assert & check epoch when update epoch --- source/client/src/clientTmq.c | 2 +- source/dnode/mnode/impl/src/mndScheduler.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index ff8a0b899b..4f5c3e9fda 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -1442,7 +1442,7 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) bool set = false; int32_t topicNumGet = taosArrayGetSize(pRsp->topics); - if (epoch <= tmq->epoch) { + if (epoch < tmq->epoch) { tscInfo("consumer:0x%" PRIx64 " no update ep epoch from %d to epoch %d, incoming topics:%d", tmq->consumerId, tmq->epoch, epoch, topicNumGet); return false; diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index 404198a523..88a06cb513 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -728,7 +728,7 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib pVgEp->vgId = pVgroup->vgId; taosArrayPush(pSub->unassignedVgs, &pVgEp); - mDebug("init subscription %s for topic:%s assign vgId:%d", pSub->key, pTopic->name, pVgEp->vgId); + mInfo("init subscription %s for topic:%s assign vgId:%d", pSub->key, pTopic->name, pVgEp->vgId); sdbRelease(pSdb, pVgroup); } From 21b5ea6915daa783f374446cd12349822ed792a7 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 31 Oct 2023 20:49:15 +0800 Subject: [PATCH 3/3] fix:print log if assert & check epoch when update epoch --- source/client/src/clientTmq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 4f5c3e9fda..4f6f1b18bb 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -1442,7 +1442,7 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) bool set = false; int32_t topicNumGet = taosArrayGetSize(pRsp->topics); - if (epoch < tmq->epoch) { + if (epoch < tmq->epoch || (epoch == tmq->epoch && topicNumGet == 0)) { tscInfo("consumer:0x%" PRIx64 " no update ep epoch from %d to epoch %d, incoming topics:%d", tmq->consumerId, tmq->epoch, epoch, topicNumGet); return false;