Skip to content

Commit

Permalink
Merge bb-10.6-release into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed May 24, 2023
2 parents 270eeeb + 98de15a commit b220bb7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions storage/innobase/trx/trx0purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,13 @@ static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr)
}

/** Remove unnecessary history data from a rollback segment.
@param[in,out] rseg rollback segment
@param[in] limit truncate anything before this
@param rseg rollback segment
@param limit truncate anything before this
@param all whether everything can be truncated
@return error code */
static dberr_t
trx_purge_truncate_rseg_history(trx_rseg_t& rseg,
const purge_sys_t::iterator& limit)
trx_purge_truncate_rseg_history(trx_rseg_t &rseg,
const purge_sys_t::iterator &limit, bool all)
{
fil_addr_t hdr_addr;
mtr_t mtr;
Expand Down Expand Up @@ -447,6 +448,9 @@ trx_purge_truncate_rseg_history(trx_rseg_t& rseg,
goto func_exit;
}

if (!all)
goto func_exit;

fil_addr_t prev_hdr_addr=
flst_get_prev_addr(b->page.frame + hdr_addr.boffset +
TRX_UNDO_HISTORY_NODE);
Expand Down Expand Up @@ -584,9 +588,11 @@ TRANSACTIONAL_TARGET static void trx_purge_truncate_history()
{
ut_ad(rseg.is_persistent());
rseg.latch.wr_lock(SRW_LOCK_CALL);
if (!rseg.is_referenced() && rseg.needs_purge <= head.trx_no)
if (dberr_t e= trx_purge_truncate_rseg_history(rseg, head))
err= e;
if (dberr_t e=
trx_purge_truncate_rseg_history(rseg, head,
!rseg.is_referenced() &&
rseg.needs_purge <= head.trx_no))
err= e;
rseg.latch.wr_unlock();
}

Expand Down

0 comments on commit b220bb7

Please sign in to comment.