From e19514e2c4bcdff78e2eaa469e447b03b4c968e5 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 25 Sep 2024 16:52:17 +0800 Subject: [PATCH] void cleanups --- source/common/src/cos.c | 2 -- source/common/src/cos_cp.c | 2 +- source/dnode/vnode/src/inc/tsdb.h | 4 ++-- source/dnode/vnode/src/tsdb/tsdbCache.c | 7 ++----- source/dnode/vnode/src/tsdb/tsdbReaderWriter.c | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/common/src/cos.c b/source/common/src/cos.c index 88f97a498d..b5032bbecd 100644 --- a/source/common/src/cos.c +++ b/source/common/src/cos.c @@ -897,8 +897,6 @@ upload: if (partData.put_object_data.status != S3StatusOK) { s3PrintError(__FILE__, __LINE__, __func__, partData.put_object_data.status, partData.put_object_data.err_msg); TAOS_CHECK_GOTO(TAOS_SYSTEM_ERROR(EIO), &lino, _exit); - - //(void)cos_cp_dump(&cp); } if (!manager.etags[seq - 1]) { diff --git a/source/common/src/cos_cp.c b/source/common/src/cos_cp.c index adf4160abe..6aa84c0c3c 100644 --- a/source/common/src/cos_cp.c +++ b/source/common/src/cos_cp.c @@ -309,7 +309,7 @@ int32_t cos_cp_dump(SCheckpoint* cp) { if (!item) { TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit); } - (void)cJSON_AddItemToArray(ajson, item); + cJSON_AddItemToArray(ajson, item); if (NULL == cJSON_AddNumberToObject(item, "index", cp->parts[i].index)) { TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit); diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 20c43bb185..30efee42e5 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -375,7 +375,7 @@ struct STsdb { struct { SVHashTable *ht; SArray *arr; - } *commitInfo; + } * commitInfo; }; struct TSDBKEY { @@ -949,7 +949,7 @@ int32_t tsdbBICacheRelease(SLRUCache *pCache, LRUHandle *h); int32_t tsdbCacheGetBlockS3(SLRUCache *pCache, STsdbFD *pFD, LRUHandle **handle); int32_t tsdbCacheGetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, LRUHandle **handle); -int32_t tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_t *pPage); +void tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_t *pPage); int32_t tsdbCacheDeleteLastrow(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey); int32_t tsdbCacheDeleteLast(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey); diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 2c70fc1816..6da705423a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -3682,8 +3682,7 @@ int32_t tsdbCacheGetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, LRUHan return code; } -int32_t tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_t *pPage) { - int32_t code = 0; +void tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_t *pPage) { char key[128] = {0}; int keyLen = 0; LRUHandle *handle = NULL; @@ -3696,7 +3695,7 @@ int32_t tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_ _taos_lru_deleter_t deleter = deleteBCache; uint8_t *pPg = taosMemoryMalloc(charge); if (!pPg) { - TAOS_RETURN(terrno); + return; // ignore error with s3 cache and leave error untouched } memcpy(pPg, pPage, charge); @@ -3710,6 +3709,4 @@ int32_t tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_ (void)taosThreadMutexUnlock(&pFD->pTsdb->pgMutex); tsdbCacheRelease(pFD->pTsdb->pgCache, handle); - - TAOS_RETURN(code); } diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index c0d8f7f17d..d867318e1c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -483,7 +483,7 @@ static int32_t tsdbReadFileS3(STsdbFD *pFD, int64_t offset, uint8_t *pBuf, int64 int nPage = pgnoEnd - pgno + 1; for (int i = 0; i < nPage; ++i) { if (pFD->szFile != pgno) { // DONOT cache last volatile page - (void)tsdbCacheSetPageS3(pFD->pTsdb->pgCache, pFD, pgno, pBlock + i * pFD->szPage); + tsdbCacheSetPageS3(pFD->pTsdb->pgCache, pFD, pgno, pBlock + i * pFD->szPage); } if (szHint > 0 && n >= size) {