Skip to content

Commit b220bb7

Browse files
committed
Merge bb-10.6-release into 10.6
2 parents 270eeeb + 98de15a commit b220bb7

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

storage/innobase/trx/trx0purge.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,13 @@ static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr)
399399
}
400400

401401
/** Remove unnecessary history data from a rollback segment.
402-
@param[in,out] rseg rollback segment
403-
@param[in] limit truncate anything before this
402+
@param rseg rollback segment
403+
@param limit truncate anything before this
404+
@param all whether everything can be truncated
404405
@return error code */
405406
static dberr_t
406-
trx_purge_truncate_rseg_history(trx_rseg_t& rseg,
407-
const purge_sys_t::iterator& limit)
407+
trx_purge_truncate_rseg_history(trx_rseg_t &rseg,
408+
const purge_sys_t::iterator &limit, bool all)
408409
{
409410
fil_addr_t hdr_addr;
410411
mtr_t mtr;
@@ -447,6 +448,9 @@ trx_purge_truncate_rseg_history(trx_rseg_t& rseg,
447448
goto func_exit;
448449
}
449450

451+
if (!all)
452+
goto func_exit;
453+
450454
fil_addr_t prev_hdr_addr=
451455
flst_get_prev_addr(b->page.frame + hdr_addr.boffset +
452456
TRX_UNDO_HISTORY_NODE);
@@ -584,9 +588,11 @@ TRANSACTIONAL_TARGET static void trx_purge_truncate_history()
584588
{
585589
ut_ad(rseg.is_persistent());
586590
rseg.latch.wr_lock(SRW_LOCK_CALL);
587-
if (!rseg.is_referenced() && rseg.needs_purge <= head.trx_no)
588-
if (dberr_t e= trx_purge_truncate_rseg_history(rseg, head))
589-
err= e;
591+
if (dberr_t e=
592+
trx_purge_truncate_rseg_history(rseg, head,
593+
!rseg.is_referenced() &&
594+
rseg.needs_purge <= head.trx_no))
595+
err= e;
590596
rseg.latch.wr_unlock();
591597
}
592598

0 commit comments

Comments
 (0)