fix(stream): avoid clear the restart flag .

This commit is contained in:
Haojun Liao 2023-10-27 14:12:06 +08:00
parent 951442e3db
commit afe7fdf672
1 changed files with 6 additions and 1 deletions

View File

@ -211,7 +211,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
stage);
return pMeta;
_err:
_err:
taosMemoryFree(pMeta->path);
if (pMeta->pTasksMap) taosHashCleanup(pMeta->pTasksMap);
if (pMeta->pTaskList) taosArrayDestroy(pMeta->pTaskList);
@ -228,8 +228,12 @@ _err:
}
int32_t streamMetaReopen(SStreamMeta* pMeta) {
// backup the restart flag
int32_t restartFlag = pMeta->startInfo.startedAfterNodeUpdate;
streamMetaClear(pMeta);
pMeta->startInfo.startedAfterNodeUpdate = restartFlag;
// NOTE: role should not be changed during reopen meta
pMeta->streamBackendRid = -1;
pMeta->streamBackend = NULL;
@ -1059,4 +1063,5 @@ void streamMetaInitForSnode(SStreamMeta* pMeta) {
void streamMetaResetStartInfo(STaskStartInfo* pStartInfo) {
taosHashClear(pStartInfo->pReadyTaskSet);
pStartInfo->startedAfterNodeUpdate = 0;
pStartInfo->readyTs = 0;
}