chore: log optimization for data migrate
This commit is contained in:
parent
70f2c68570
commit
8943fd2fc2
|
@ -630,8 +630,8 @@ static int64_t tsdbFSendFile(STsdb *pTsdb, TdFilePtr pOutFD, TdFilePtr pInFD, in
|
||||||
|
|
||||||
while ((offset + nBytes) < size) {
|
while ((offset + nBytes) < size) {
|
||||||
if (atomic_load_8(&pTsdb->trimHdl.commitInWait) == 1) {
|
if (atomic_load_8(&pTsdb->trimHdl.commitInWait) == 1) {
|
||||||
tsdbInfo("vgId:%d sendFile without limit since conflicts, fSize:%" PRIi64 ", maxSpeed:%" PRIi64,
|
tsdbDebug("vgId:%d sendFile without limit since conflicts, fSize:%" PRIi64 ", maxSpeed:%" PRIi64,
|
||||||
TD_VID(pTsdb->pVnode), size, speed);
|
TD_VID(pTsdb->pVnode), size, speed);
|
||||||
goto _send_remain;
|
goto _send_remain;
|
||||||
}
|
}
|
||||||
startMs = taosGetTimestampMs();
|
startMs = taosGetTimestampMs();
|
||||||
|
@ -649,8 +649,8 @@ static int64_t tsdbFSendFile(STsdb *pTsdb, TdFilePtr pOutFD, TdFilePtr pInFD, in
|
||||||
}
|
}
|
||||||
if (nSleep > 0) {
|
if (nSleep > 0) {
|
||||||
taosMsleep(nSleep);
|
taosMsleep(nSleep);
|
||||||
tsdbInfo("vgId:%d sendFile and msleep:%" PRIi64 ", fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64,
|
tsdbDebug("vgId:%d sendFile and msleep:%" PRIi64 ", fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64,
|
||||||
TD_VID(pTsdb->pVnode), nSleep, size, tBytes, speed);
|
TD_VID(pTsdb->pVnode), nSleep, size, tBytes, speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,8 +660,8 @@ _send_remain:
|
||||||
return nBytes;
|
return nBytes;
|
||||||
}
|
}
|
||||||
tBytes += nBytes;
|
tBytes += nBytes;
|
||||||
tsdbInfo("vgId:%d sendFile remain, fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, TD_VID(pTsdb->pVnode),
|
tsdbDebug("vgId:%d sendFile remain, fSize:%" PRIi64 ", tBytes:%" PRIi64 " maxSpeed:%" PRIi64, TD_VID(pTsdb->pVnode),
|
||||||
size, tBytes, speed);
|
size, tBytes, speed);
|
||||||
}
|
}
|
||||||
return tBytes;
|
return tBytes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ _retention_loop:
|
||||||
fSize += pSet->aSttF[iStt]->size;
|
fSize += pSet->aSttF[iStt]->size;
|
||||||
}
|
}
|
||||||
if (fSize / speed > MIGRATE_MIN_COST) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,8 +174,8 @@ _commit_conflict_check:
|
||||||
|
|
||||||
if (pSet->fid > maxFid) break;
|
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),
|
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);
|
nBatch, maxFid, pSet->fid, pSet->diskId.id, pSet->diskId.level, expLevel);
|
||||||
|
|
||||||
if (expLevel < 0) {
|
if (expLevel < 0) {
|
||||||
SET_DFSET_EXPIRED(pSet);
|
SET_DFSET_EXPIRED(pSet);
|
||||||
|
@ -273,11 +273,13 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now, int64_t maxSpeed) {
|
||||||
_exit:
|
_exit:
|
||||||
pTsdb->trimHdl.maxRetentFid = INT32_MIN;
|
pTsdb->trimHdl.maxRetentFid = INT32_MIN;
|
||||||
if (code != 0) {
|
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);
|
ASSERT(0);
|
||||||
// tsdbFSRollback(pTsdb->pFS);
|
// tsdbFSRollback(pTsdb->pFS);
|
||||||
} else {
|
} 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;
|
return code;
|
||||||
}
|
}
|
|
@ -425,14 +425,14 @@ void *vnodeProcessTrimReqFunc(void *param) {
|
||||||
_exit:
|
_exit:
|
||||||
oldVal = atomic_val_compare_exchange_8(&pVnode->trimDbH.state, 1, 0);
|
oldVal = atomic_val_compare_exchange_8(&pVnode->trimDbH.state, 1, 0);
|
||||||
ASSERT(oldVal == 1);
|
ASSERT(oldVal == 1);
|
||||||
taosMemoryFree(pReq);
|
|
||||||
if (code) {
|
if (code) {
|
||||||
vError("vgId:%d, trim vnode thread failed since %s, time:%" PRIi64, TD_VID(pVnode), tstrerror(code),
|
vError("vgId:%d, trim vnode thread failed since %s, time:%" PRIi64 ", max speed:%" PRIi64, TD_VID(pVnode),
|
||||||
pReq->trimReq.timestamp);
|
tstrerror(code), pReq->trimReq.timestamp, pReq->trimReq.maxSpeed);
|
||||||
} else {
|
} 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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue