From 6cdfa6d60f3fd46989ff084b2793d229dd0254ec Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 2 Feb 2023 17:51:04 +0800 Subject: [PATCH] fix(tdb): return success if txn is commited --- source/libs/tdb/src/db/tdbPager.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 62d82edeb1..63e88b0a12 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -457,6 +457,11 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { SPgno journalSize = 0; int ret; + if (pTxn->jfd == 0) { + // txn is commited + return 0; + } + // sync the journal file ret = tdbOsFSync(pTxn->jfd); if (ret < 0) {