fix return invalid err

This commit is contained in:
yihaoDeng 2023-02-07 15:08:46 +08:00
parent 25f7ac7991
commit c14ca67b17
1 changed files with 16 additions and 19 deletions

View File

@ -396,11 +396,12 @@ static char* doExtractPage(SDiskbasedBuf* pBuf) {
if (NO_IN_MEM_AVAILABLE_PAGES(pBuf)) {
availablePage = evictBufPage(pBuf);
if (availablePage == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
uWarn("no available buf pages, current:%d, max:%d", listNEles(pBuf->lruList), pBuf->inMemPages)
if (terrno == 0) terrno = TSDB_CODE_OUT_OF_MEMORY;
uWarn("no available buf pages, current:%d, max:%d, %s", listNEles(pBuf->lruList), pBuf->inMemPages, pBuf->id)
}
} else {
availablePage = taosMemoryCalloc(1, getAllocPageSize(pBuf->pageSize)); // add extract bytes in case of zipped buffer increased.
availablePage =
taosMemoryCalloc(1, getAllocPageSize(pBuf->pageSize)); // add extract bytes in case of zipped buffer increased.
if (availablePage == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
}
@ -548,9 +549,7 @@ void releaseBufPageInfo(SDiskbasedBuf* pBuf, SPageInfo* pi) {
size_t getTotalBufSize(const SDiskbasedBuf* pBuf) { return (size_t)pBuf->totalBufSize; }
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf) {
return pBuf->pIdList;
}
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf) { return pBuf->pIdList; }
void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
if (pBuf == NULL) {
@ -625,9 +624,7 @@ SPageInfo* getLastPageInfo(SArray* pList) {
return pPgInfo;
}
int32_t getPageId(const SPageInfo* pPgInfo) {
return pPgInfo->pageId;
}
int32_t getPageId(const SPageInfo* pPgInfo) { return pPgInfo->pageId; }
int32_t getBufPageSize(const SDiskbasedBuf* pBuf) { return pBuf->pageSize; }