fix:add log for wal

This commit is contained in:
wangmm0220 2023-04-19 17:30:58 +08:00
parent 594d68b8a4
commit 6f94281ab7
2 changed files with 6 additions and 2 deletions

View File

@ -149,6 +149,8 @@ typedef struct SWalReader {
int64_t capacity;
// int8_t curInvalid;
// int8_t curStopped;
int64_t bodyCnt;
int64_t bodyTotalSize;
TdThreadMutex mutex;
SWalFilterCond cond;
// TODO remove it

View File

@ -262,8 +262,8 @@ static int32_t walFetchBodyNew(SWalReader *pReader) {
SWalCont *pReadHead = &pReader->pHead->head;
int64_t ver = pReadHead->version;
wDebug("vgId:%d, wal starts to fetch body, ver:%" PRId64 " ,len:%d", pReader->pWal->cfg.vgId, ver,
pReadHead->bodyLen);
wInfo("vgId:%d, wal starts to fetch body, ver:%" PRId64 " ,len:%d, total cnt:%"PRId64 ", total size:%"PRId64, pReader->pWal->cfg.vgId, ver,
pReadHead->bodyLen, pReader->bodyCnt, pReader->bodyTotalSize);
if (pReader->capacity < pReadHead->bodyLen) {
SWalCkHead *ptr = (SWalCkHead *)taosMemoryRealloc(pReader->pHead, sizeof(SWalCkHead) + pReadHead->bodyLen);
@ -300,6 +300,8 @@ static int32_t walFetchBodyNew(SWalReader *pReader) {
wDebug("vgId:%d, index:%" PRId64 " is fetched, cursor advance", pReader->pWal->cfg.vgId, ver);
pReader->curVersion = ver + 1;
pReader->bodyCnt++;
pReader->bodyTotalSize += pReadHead->bodyLen;
return 0;
}