From a0fd56c84f539ce6c1bc65827c03de368bda675a Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 22 Aug 2023 10:48:15 +0800 Subject: [PATCH 1/2] fix invalid cmp --- source/libs/stream/src/streamMeta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 11574e6d70..f4d990de4c 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -93,7 +93,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); pMeta->chkpSaved = taosArrayInit(4, sizeof(int64_t)); pMeta->chkpInUse = taosArrayInit(4, sizeof(int64_t)); - pMeta->chkpCap = 8; + pMeta->chkpCap = 2; taosInitRWLatch(&pMeta->chkpDirLock); int64_t chkpId = streamGetLatestCheckpointId(pMeta); @@ -142,11 +142,11 @@ int32_t streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) { pMeta->streamBackendRid = -1; pMeta->streamBackend = NULL; - char* defaultPath = taosMemoryCalloc(1, strlen(pMeta->path) + 64); + char* defaultPath = taosMemoryCalloc(1, strlen(pMeta->path) + 128); sprintf(defaultPath, "%s%s%s", pMeta->path, TD_DIRSEP, "state"); taosRemoveDir(defaultPath); - char* newPath = taosMemoryCalloc(1, strlen(pMeta->path) + 64); + char* newPath = taosMemoryCalloc(1, strlen(pMeta->path) + 128); sprintf(newPath, "%s%s%s", pMeta->path, TD_DIRSEP, "received"); int32_t code = taosStatFile(newPath, NULL, NULL, NULL); @@ -155,7 +155,7 @@ int32_t streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) { code = taosRenameFile(newPath, defaultPath); if (code != 0) { terrno = TAOS_SYSTEM_ERROR(code); - qError("vgId:%d failed to rename file, from %s to %s, code:%s", newPath, defaultPath, pMeta->vgId, + qError("vgId:%d failed to rename file, from %s to %s, code:%s", pMeta->vgId, newPath, defaultPath, tstrerror(terrno)); taosMemoryFree(defaultPath); From 2c1ca6d325a622c8c6d722baf18a790dda75889f Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 22 Aug 2023 10:51:39 +0800 Subject: [PATCH 2/2] Merge branch 'enh/3.0' into enh/triggerCheckPoint2 --- source/libs/stream/src/streamBackendRocksdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index c5da5eb213..1e26086cfa 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -1446,8 +1446,8 @@ int32_t streamStateOpenBackendCf(void* backend, char* name, char** cfs, int32_t } // close default cf if (((rocksdb_column_family_handle_t**)cfHandle)[0] != 0) { - // rocksdb_column_family_handle_destroy(cfHandle[0]); - // cfHandle[0] = NULL; + rocksdb_column_family_handle_destroy(cfHandle[0]); + cfHandle[0] = NULL; } rocksdb_options_destroy(cfOpts[0]);