提交 ac18d377 编写于 作者: H Hongze Cheng

fix some error

上级 b772ec14
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
extern int32_t tsdbCompact(STsdb *pTsdb, int32_t flag); extern int32_t tsdbCompact(STsdb *pTsdb, int32_t flag);
extern void vnodePrepareCommit(SVnode *pVnode); int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo);
static int32_t vnodeCompactImpl(SCommitInfo *pInfo) { static int32_t vnodeCompactImpl(SCommitInfo *pInfo) {
int32_t code = 0; int32_t code = 0;
...@@ -56,21 +56,14 @@ _exit: ...@@ -56,21 +56,14 @@ _exit:
int32_t vnodeAsyncCompact(SVnode *pVnode) { int32_t vnodeAsyncCompact(SVnode *pVnode) {
int32_t code = 0; int32_t code = 0;
// prepare
vnodePrepareCommit(pVnode);
// schedule compact task // schedule compact task
SCommitInfo *pInfo = taosMemoryCalloc(1, sizeof(*pInfo)); SCommitInfo *pInfo = taosMemoryCalloc(1, sizeof(*pInfo));
if (NULL == pInfo) { if (NULL == pInfo) {
code = TSDB_CODE_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit; goto _exit;
} }
pInfo->info.config = pVnode->config;
pInfo->info.state.committed = pVnode->state.applied; vnodePrepareCommit(pVnode, pInfo);
pInfo->info.state.commitTerm = pVnode->state.applyTerm;
pInfo->info.state.commitID = pVnode->state.commitID;
pInfo->pVnode = pVnode;
pInfo->txn = metaGetTxn(pVnode->pMeta);
vnodeScheduleTask(vnodeCompactTask, pInfo); vnodeScheduleTask(vnodeCompactTask, pInfo);
_exit: _exit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册