Merge pull request #22772 from taosdata/fix/TD-25996-main
fix/TD-25996: tdbBtcDelete release pages before modifying pBtc->pPage
This commit is contained in:
commit
42d63bef3f
|
@ -2200,10 +2200,15 @@ int tdbBtcDelete(SBTC *pBtc) {
|
|||
tdbOsFree(pCell);
|
||||
|
||||
if (pPage->nOverflow > 0) {
|
||||
tdbDebug("tdb/btc-delete: btree balance after update cell, pPage/nOverflow: %p/%d.", pPage,
|
||||
pPage->nOverflow);
|
||||
tdbDebug("tdb/btc-delete: btree balance after update cell, pPage/nOverflow/pgno: %p/%d/%" PRIu32 ".", pPage,
|
||||
pPage->nOverflow, TDB_PAGE_PGNO(pPage));
|
||||
|
||||
pBtc->iPage = iPage;
|
||||
tdbPagerReturnPage(pBtc->pBt->pPager, pBtc->pPage, pBtc->pTxn);
|
||||
while (--pBtc->iPage != iPage) {
|
||||
tdbPagerReturnPage(pBtc->pBt->pPager, pBtc->pgStack[pBtc->iPage], pBtc->pTxn);
|
||||
}
|
||||
|
||||
// pBtc->iPage = iPage;
|
||||
pBtc->pPage = pPage;
|
||||
ret = tdbBtreeBalance(pBtc);
|
||||
if (ret < 0) {
|
||||
|
|
|
@ -295,7 +295,7 @@ static SPage *tdbPCacheFetchImpl(SPCache *pCache, const SPgid *pPgid, TXN *pTxn)
|
|||
}
|
||||
|
||||
// 1. pPage == NULL
|
||||
// 2. pPage && pPage->isLocal == 0 && !TDB_TXN_IS_WRITE(pTxn)
|
||||
// 2. pPage && !pPage->isLocal == 0 && !TDB_TXN_IS_WRITE(pTxn)
|
||||
pPageH = pPage;
|
||||
pPage = NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue