diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index c12ab68607..59916b8c0d 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -615,6 +615,10 @@ _EXIT: bool streamBackendDataIsExist(const char* path, int64_t chkpId, int32_t vgId) { bool exist = true; char* state = taosMemoryCalloc(1, strlen(path) + 32); + if (state == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return false; + } sprintf(state, "%s%s%s", path, TD_DIRSEP, "state"); if (!taosDirExist(state)) { exist = false; diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 864f9514da..08e373fa56 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -195,7 +195,8 @@ int32_t streamMetaCvtDbFormat(SStreamMeta* pMeta) { bool exist = streamBackendDataIsExist(pMeta->path, chkpId, pMeta->vgId); if (exist == false) { - return code; + stError("failed to check backend data exist, reason:%s", tstrerror(terrno)); + return -1; } SBackendWrapper* pBackend = streamBackendInit(pMeta->path, chkpId, pMeta->vgId); @@ -319,7 +320,8 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskBuild buildTas } if (streamMetaMayCvtDbFormat(pMeta) < 0) { - stError("vgId:%d convert sub info format failed, open stream meta failed", pMeta->vgId); + stError("vgId:%d convert sub info format failed, open stream meta failed, reason: %s", pMeta->vgId, + tstrerror(terrno)); goto _err; }