From 8943fd2fc2b14695e05e9c2b45d2839f57de98c2 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 27 Sep 2022 18:16:48 +0800 Subject: [PATCH] chore: log optimization for data migrate --- source/dnode/vnode/src/tsdb/tsdbReaderWriter.c | 12 ++++++------ source/dnode/vnode/src/tsdb/tsdbRetention.c | 12 +++++++----- source/dnode/vnode/src/vnd/vnodeSvr.c | 10 +++++----- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index b1bc487fc3..b998ba38a0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -630,8 +630,8 @@ static int64_t tsdbFSendFile(STsdb *pTsdb, TdFilePtr pOutFD, TdFilePtr pInFD, in while ((offset + nBytes) < size) { if (atomic_load_8(&pTsdb->trimHdl.commitInWait) == 1) { - tsdbInfo("vgId:%d sendFile without limit since conflicts, fSize:%" PRIi64 ", maxSpeed:%" PRIi64, - TD_VID(pTsdb->pVnode), size, speed); + tsdbDebug("vgId:%d sendFile without limit since conflicts, fSize:%" PRIi64 ", maxSpeed:%" PRIi64, + TD_VID(pTsdb->pVnode), size, speed); goto _send_remain; } startMs = taosGetTimestampMs(); @@ -649,8 +649,8 @@ static int64_t tsdbFSendFile(STsdb *pTsdb, TdFilePtr pOutFD, TdFilePtr pInFD, in } if (nSleep > 0) { taosMsleep(nSleep); - tsdbInfo("vgId:%d sendFile and msleep:%" PRIi64 ", fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, - TD_VID(pTsdb->pVnode), nSleep, size, tBytes, speed); + tsdbDebug("vgId:%d sendFile and msleep:%" PRIi64 ", fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, + TD_VID(pTsdb->pVnode), nSleep, size, tBytes, speed); } } @@ -660,8 +660,8 @@ _send_remain: return nBytes; } tBytes += nBytes; - tsdbInfo("vgId:%d sendFile remain, fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, TD_VID(pTsdb->pVnode), - size, tBytes, speed); + tsdbDebug("vgId:%d sendFile remain, fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, TD_VID(pTsdb->pVnode), + size, tBytes, speed); } return tBytes; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c index d72211047f..3b96cc20dc 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRetention.c +++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c @@ -125,7 +125,7 @@ _retention_loop: fSize += pSet->aSttF[iStt]->size; } if (fSize / speed > MIGRATE_MIN_COST) { - tsdbInfo("vgId:%d migrate loop[%d] with maxFid:%d", TD_VID(pTsdb->pVnode), nBatch, maxFid); + tsdbDebug("vgId:%d migrate loop[%d] with maxFid:%d", TD_VID(pTsdb->pVnode), nBatch, maxFid); break; } } @@ -174,8 +174,8 @@ _commit_conflict_check: if (pSet->fid > maxFid) break; - tsdbInfo("vgId:%d migrate loop[%d] with maxFid:%d, fid:%d, did:%d, level:%d, expLevel:%d", TD_VID(pTsdb->pVnode), - nBatch, maxFid, pSet->fid, pSet->diskId.id, pSet->diskId.level, expLevel); + tsdbDebug("vgId:%d migrate loop[%d] with maxFid:%d, fid:%d, did:%d, level:%d, expLevel:%d", TD_VID(pTsdb->pVnode), + nBatch, maxFid, pSet->fid, pSet->diskId.id, pSet->diskId.level, expLevel); if (expLevel < 0) { SET_DFSET_EXPIRED(pSet); @@ -273,11 +273,13 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now, int64_t maxSpeed) { _exit: pTsdb->trimHdl.maxRetentFid = INT32_MIN; if (code != 0) { - tsdbError("vgId:%d, tsdb do retention %d failed since %s", TD_VID(pTsdb->pVnode), retention, tstrerror(code)); + tsdbError("vgId:%d, tsdb do retention %d failed since %s, time:%" PRIi64 ", max speed:%" PRIi64, + TD_VID(pTsdb->pVnode), retention, tstrerror(code), now, maxSpeed); ASSERT(0); // tsdbFSRollback(pTsdb->pFS); } else { - tsdbInfo("vgId:%d, tsdb do retention %d succeed", TD_VID(pTsdb->pVnode), retention); + tsdbInfo("vgId:%d, tsdb do retention %d succeed, time:%" PRIi64 "max speed:%" PRIi64, TD_VID(pTsdb->pVnode), + retention, now, maxSpeed); } return code; } \ No newline at end of file diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 4139a8ca2b..464fd50ab0 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -425,14 +425,14 @@ void *vnodeProcessTrimReqFunc(void *param) { _exit: oldVal = atomic_val_compare_exchange_8(&pVnode->trimDbH.state, 1, 0); ASSERT(oldVal == 1); - taosMemoryFree(pReq); if (code) { - vError("vgId:%d, trim vnode thread failed since %s, time:%" PRIi64, TD_VID(pVnode), tstrerror(code), - pReq->trimReq.timestamp); + vError("vgId:%d, trim vnode thread failed since %s, time:%" PRIi64 ", max speed:%" PRIi64, TD_VID(pVnode), + tstrerror(code), pReq->trimReq.timestamp, pReq->trimReq.maxSpeed); } else { - vInfo("vgId:%d, trim vnode thread finished, time:%" PRIi64, TD_VID(pVnode), pReq->trimReq.timestamp); + vInfo("vgId:%d, trim vnode thread finish, time:%" PRIi64 ", max speed:%" PRIi64, TD_VID(pVnode), + pReq->trimReq.timestamp, pReq->trimReq.maxSpeed); } - + taosMemoryFree(pReq); return NULL; } -- GitLab