From 1eea4101f14303604b944f7ea00989f3b183430c Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 19 Dec 2022 16:40:08 +0800 Subject: [PATCH] tdb/pager: new trace log for abort operation --- source/libs/tdb/src/db/tdbPager.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 2c7faad7f1..09c2206111 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -471,6 +471,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } + tdbTrace("tdb/abort: pgno:%p,", pPager); + for (int pgIndex = 0; pgIndex < journalSize; ++pgIndex) { // read pgno & the page from journal SPgno pgno; @@ -481,6 +483,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } + tdbTrace("tdb/abort: pgno:%d,", pgno); + ret = tdbOsRead(jfd, pageBuf, pPager->pageSize); if (ret < 0) { tdbOsFree(pageBuf); @@ -578,12 +582,12 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) { return -1; } - tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); + tdbTrace("tdb/flush:%p, pgno:%d, %d/%d/%d", pPager, pgno, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); pPager->dbOrigSize = maxPgno; pPage->isDirty = 0; - tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); + tdbTrace("pager/flush drop page: %p, pgno:%d, from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage); tdbPCacheRelease(pPager->pCache, pPage, pTxn); -- GitLab