free and log

This commit is contained in:
dmchen 2024-04-02 02:30:56 +00:00
parent 463a5da0d9
commit d06bfd9cea
5 changed files with 11 additions and 12 deletions

View File

@ -322,7 +322,7 @@ static int32_t sdbReadFileImp(SSdb *pSdb) {
count = CBC_Decrypt(&opts);
mInfo("read sdb, CBC_Decrypt dataLen:%d, descrypted len:%d, %s", pRaw->dataLen, count, __FUNCTION__);
mDebug("read sdb, CBC_Decrypt dataLen:%d, descrypted len:%d, %s", pRaw->dataLen, count, __FUNCTION__);
memcpy(pRaw->pData, plantContent, pRaw->dataLen);
taosMemoryFree(plantContent);
@ -456,7 +456,7 @@ static int32_t sdbWriteFileImp(SSdb *pSdb) {
int32_t count = CBC_Encrypt(&opts);
mInfo("write sdb, CBC_Encrypt encryptedDataLen:%d, dataLen:%d, %s",
mDebug("write sdb, CBC_Encrypt encryptedDataLen:%d, dataLen:%d, %s",
newDataLen, pRaw->dataLen, __FUNCTION__);
}

View File

@ -174,7 +174,7 @@ static int32_t tsdbWriteFilePage(STsdbFD *pFD, int32_t encryptAlgorithm, char* e
memcpy(pFD->pBuf + count, PacketData, NewLen);
count += NewLen;
}
tsdbInfo("CBC_Encrypt count:%d %s", count, __FUNCTION__);
tsdbDebug("CBC_Encrypt count:%d %s", count, __FUNCTION__);
}
n = taosWriteFile(pFD->pFD, pFD->pBuf, pFD->szPage);
@ -264,7 +264,7 @@ static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno, int32_t encryptAlgor
memcpy(pFD->pBuf + count, PacketData, NewLen);
count += NewLen;
}
tsdbInfo("CBC_Decrypt count:%d %s", count, __FUNCTION__);
tsdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
}
}

View File

@ -897,7 +897,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
memcpy(pPage->pData + count, PacketData, NewLen);
count += NewLen;
}
tdbInfo("CBC_Decrypt count:%d %s", count, __FUNCTION__);
tdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
}
} else {
init = 0;
@ -1011,7 +1011,7 @@ static int tdbPagerPWritePageToDB(SPager *pPager, SPage *pPage) {
memcpy(buf + count, PacketData, NewLen);
count += NewLen;
}
tdbInfo("CBC_Encrypt count:%d %s", count, __FUNCTION__);
tdbDebug("CBC_Encrypt count:%d %s", count, __FUNCTION__);
}
ret = tdbOsPWrite(pPager->fd, buf, pPage->pageSize, offset);

View File

@ -527,7 +527,7 @@ void decryptBody(SWalCfg* cfg, SWalCkHead* pHead, int32_t plainBodyLen, const ch
int32_t count = CBC_Decrypt(&opts);
wInfo("CBC_Decrypt cryptedBodyLen:%d, plainBodyLen:%d, %s", count, plainBodyLen, func);
wDebug("CBC_Decrypt cryptedBodyLen:%d, plainBodyLen:%d, %s", count, plainBodyLen, func);
memcpy(pHead->head.body, newBody, plainBodyLen);

View File

@ -545,7 +545,6 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
wError("vgId:%d, file:%" PRId64 ".log, failed to malloc since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
strerror(errno));
code = -1;
if(newBodyEncrypted != NULL) taosMemoryFreeClear(newBodyEncrypted);
if(newBody != NULL) taosMemoryFreeClear(newBody);
goto END;
}
@ -555,11 +554,11 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
opts.source = newBody;
opts.result = newBodyEncrypted;
opts.unitLen = 16;
strncpy(opts.key, pWal->cfg.encryptKey, 16);
strncpy(opts.key, pWal->cfg.encryptKey, ENCRYPT_KEY_LEN);
int32_t count = CBC_Encrypt(&opts);
wInfo("vgId:%d, file:%" PRId64 ".log, index:%" PRId64 ", CBC_Encrypt cryptedBodyLen:%d, plainBodyLen:%d, %s",
wDebug("vgId:%d, file:%" PRId64 ".log, index:%" PRId64 ", CBC_Encrypt cryptedBodyLen:%d, plainBodyLen:%d, %s",
pWal->cfg.vgId, walGetLastFileFirstVer(pWal), index, count, plainBodyLen, __FUNCTION__);
buf = newBodyEncrypted;
@ -580,8 +579,8 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
if(pWal->cfg.encryptAlgorithm == DND_CA_SM4){
taosMemoryFree(newBody);
taosMemoryFree(newBodyEncrypted);
wInfo("vgId:%d, free newBody newBodyEncrypted %s",
pWal->cfg.vgId, __FUNCTION__);
//wInfo("vgId:%d, free newBody newBodyEncrypted %s",
// pWal->cfg.vgId, __FUNCTION__);
}
// set status