add self check
This commit is contained in:
parent
0a35d7ef6b
commit
f2fc09cd02
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue