未验证 提交 2e812191 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #18692 from taosdata/fix/TD-20962

fix: commit tdb in write thread
...@@ -43,7 +43,13 @@ int metaBegin(SMeta *pMeta, int8_t fromSys) { ...@@ -43,7 +43,13 @@ int metaBegin(SMeta *pMeta, int8_t fromSys) {
TXN *metaGetTxn(SMeta *pMeta) { return pMeta->txn; } TXN *metaGetTxn(SMeta *pMeta) { return pMeta->txn; }
int metaCommit(SMeta *pMeta, TXN *txn) { return tdbCommit(pMeta->pEnv, txn); } int metaCommit(SMeta *pMeta, TXN *txn) { return tdbCommit(pMeta->pEnv, txn); }
int metaFinishCommit(SMeta *pMeta, TXN *txn) { return tdbPostCommit(pMeta->pEnv, txn); } int metaFinishCommit(SMeta *pMeta, TXN *txn) { return tdbPostCommit(pMeta->pEnv, txn); }
int metaPrepareAsyncCommit(SMeta *pMeta) { return tdbPrepareAsyncCommit(pMeta->pEnv, pMeta->txn); } int metaPrepareAsyncCommit(SMeta *pMeta) {
// return tdbPrepareAsyncCommit(pMeta->pEnv, pMeta->txn);
int code = 0;
code = tdbCommit(pMeta->pEnv, pMeta->txn);
return code;
}
// abort the meta txn // abort the meta txn
int metaAbort(SMeta *pMeta) { return tdbAbort(pMeta->pEnv, pMeta->txn); } int metaAbort(SMeta *pMeta) { return tdbAbort(pMeta->pEnv, pMeta->txn); }
...@@ -193,7 +193,6 @@ static void vnodePrepareCommit(SVnode *pVnode) { ...@@ -193,7 +193,6 @@ static void vnodePrepareCommit(SVnode *pVnode) {
metaPrepareAsyncCommit(pVnode->pMeta); metaPrepareAsyncCommit(pVnode->pMeta);
smaPrepareAsyncCommit(pVnode->pSma); smaPrepareAsyncCommit(pVnode->pSma);
vnodeBufPoolUnRef(pVnode->inUse); vnodeBufPoolUnRef(pVnode->inUse);
pVnode->inUse = NULL; pVnode->inUse = NULL;
} }
...@@ -283,11 +282,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { ...@@ -283,11 +282,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
syncBeginSnapshot(pVnode->sync, pVnode->state.applied); syncBeginSnapshot(pVnode->sync, pVnode->state.applied);
// commit each sub-system // commit each sub-system
if (metaCommit(pVnode->pMeta, pInfo->txn) < 0) {
code = TSDB_CODE_FAILED;
TSDB_CHECK_CODE(code, lino, _exit);
}
code = tsdbCommit(pVnode->pTsdb, pInfo); code = tsdbCommit(pVnode->pTsdb, pInfo);
TSDB_CHECK_CODE(code, lino, _exit); TSDB_CHECK_CODE(code, lino, _exit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册