提交 73e91f64 编写于 作者: M Minglei Jin

fix wal kill case

上级 24e40fcc
...@@ -132,7 +132,8 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ...@@ -132,7 +132,8 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg
} }
} }
tdbUnrefPage(pPage); // tdbUnrefPage(pPage);
tdbPCacheRelease(pPager->pCache, pPage, &txn);
tdbCommit(pPager->pEnv, &txn); tdbCommit(pPager->pEnv, &txn);
tdbTxnClose(&txn); tdbTxnClose(&txn);
} }
......
...@@ -474,7 +474,7 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) { ...@@ -474,7 +474,7 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) {
} }
TXN txn; TXN txn;
tdbTxnOpen(&txn, 0, tdbDefaultMalloc, tdbDefaultFree, NULL, 0); tdbTxnOpen(&txn, 0, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED);
SBtreeInitPageArg iArg; SBtreeInitPageArg iArg;
iArg.pBt = pBt; iArg.pBt = pBt;
iArg.flags = 0; iArg.flags = 0;
...@@ -494,6 +494,7 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) { ...@@ -494,6 +494,7 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) {
return -1; return -1;
} }
/*
ret = tdbPagerFetchPage(pPager, &pgno, &pPage, tdbBtreeInitPage, &iArg, &txn); ret = tdbPagerFetchPage(pPager, &pgno, &pPage, tdbBtreeInitPage, &iArg, &txn);
if (ret < 0) { if (ret < 0) {
return -1; return -1;
...@@ -506,6 +507,18 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) { ...@@ -506,6 +507,18 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) {
} }
tdbPCacheRelease(pPager->pCache, pPage, &txn); tdbPCacheRelease(pPager->pCache, pPage, &txn);
*/
i64 offset = pPager->pageSize * (pgno - 1);
if (tdbOsLSeek(pPager->fd, offset, SEEK_SET) < 0) {
ASSERT(0);
return -1;
}
ret = tdbOsWrite(pPager->fd, pageBuf, pPager->pageSize);
if (ret < 0) {
ASSERT(0);
return -1;
}
} }
tdbOsFSync(pPager->fd); tdbOsFSync(pPager->fd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册