提交 6fc47beb 编写于 作者: B Benguang Zhao

enh: streamMetaCommit in sync with vnodeCommit

上级 92e05b8e
......@@ -124,6 +124,7 @@ FAIL:
}
void sndClose(SSnode *pSnode) {
streamMetaCommit(pSnode->pMeta);
streamMetaClose(pSnode->pMeta);
taosMemoryFree(pSnode->path);
taosMemoryFree(pSnode);
......
......@@ -15,4 +15,11 @@
#include "tq.h"
int tqCommit(STQ* pTq) { return tqOffsetCommitFile(pTq->pOffsetStore); }
int tqCommit(STQ* pTq) {
if (streamMetaCommit(pTq->pStreamMeta) < 0) {
tqError("vgId:%d, failed to commit stream meta since %s", TD_VID(pTq->pVnode), terrstr());
return -1;
}
return tqOffsetCommitFile(pTq->pOffsetStore);
}
......@@ -251,10 +251,9 @@ void vnodePreClose(SVnode *pVnode) {
void vnodeClose(SVnode *pVnode) {
if (pVnode) {
tsem_wait(&pVnode->canCommit);
vnodeSyncClose(pVnode);
vnodeQueryClose(pVnode);
tsem_wait(&pVnode->canCommit);
walClose(pVnode->pWal);
tqClose(pVnode->pTq);
if (pVnode->pTsdb) tsdbClose(&pVnode->pTsdb);
......
......@@ -69,8 +69,7 @@ _err:
}
void streamMetaClose(SStreamMeta* pMeta) {
tdbCommit(pMeta->db, pMeta->txn);
tdbPostCommit(pMeta->db, pMeta->txn);
tdbTxnClose(pMeta->txn);
tdbTbClose(pMeta->pTaskDb);
tdbTbClose(pMeta->pCheckpointDb);
tdbClose(pMeta->db);
......@@ -88,6 +87,7 @@ void streamMetaClose(SStreamMeta* pMeta) {
/*streamMetaReleaseTask(pMeta, pTask);*/
}
taosHashCleanup(pMeta->pTasks);
taosHashCleanup(pMeta->pRecoverStatus);
taosMemoryFree(pMeta->path);
taosMemoryFree(pMeta);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册