support reopen stream state
This commit is contained in:
parent
6c8c575549
commit
6a69c56b32
|
@ -487,15 +487,15 @@ int32_t streamBackendLoadCheckpointInfo(void* arg) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
int32_t len = strlen(pMeta->path) + 30;
|
int32_t len = strlen(pMeta->path) + 30;
|
||||||
char* checkpointPath = taosMemoryCalloc(1, len);
|
char* chkpPath = taosMemoryCalloc(1, len);
|
||||||
sprintf(checkpointPath, "%s%s%s", pMeta->path, TD_DIRSEP, "checkpoints");
|
sprintf(chkpPath, "%s%s%s", pMeta->path, TD_DIRSEP, "checkpoints");
|
||||||
|
|
||||||
if (!taosDirExist(checkpointPath)) {
|
if (!taosDirExist(chkpPath)) {
|
||||||
// no checkpoint, nothing to load
|
// no checkpoint, nothing to load
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TdDirPtr pDir = taosOpenDir(checkpointPath);
|
TdDirPtr pDir = taosOpenDir(chkpPath);
|
||||||
if (pDir == NULL) return 0;
|
if (pDir == NULL) return 0;
|
||||||
|
|
||||||
TdDirEntryPtr de = NULL;
|
TdDirEntryPtr de = NULL;
|
||||||
|
@ -525,7 +525,7 @@ int32_t streamBackendLoadCheckpointInfo(void* arg) {
|
||||||
|
|
||||||
taosArrayDestroy(suffix);
|
taosArrayDestroy(suffix);
|
||||||
taosCloseDir(&pDir);
|
taosCloseDir(&pDir);
|
||||||
taosMemoryFree(checkpointPath);
|
taosMemoryFree(chkpPath);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int32_t streamBackendDoCheckpoint(void* arg, uint64_t checkpointId) {
|
int32_t streamBackendDoCheckpoint(void* arg, uint64_t checkpointId) {
|
||||||
|
|
Loading…
Reference in New Issue