mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
TODO: enable MDEV-13049 optimization for 10.3
This commit is contained in:
commit
835cbbcc7b
644 changed files with 35219 additions and 4051 deletions
|
|
@ -116,15 +116,6 @@ trx_undo_mem_create(
|
|||
const XID* xid, /*!< in: X/Open XA transaction identification*/
|
||||
ulint page_no,/*!< in: undo log header page number */
|
||||
ulint offset);/*!< in: undo log header byte offset on page */
|
||||
/**********************************************************************//**
|
||||
If an update undo log can be discarded immediately, this function frees the
|
||||
space, resetting the page to the proper state for caching. */
|
||||
static
|
||||
void
|
||||
trx_undo_discard_latest_update_undo(
|
||||
/*================================*/
|
||||
page_t* undo_page, /*!< in: header page of an undo log of size 1 */
|
||||
mtr_t* mtr); /*!< in: mtr */
|
||||
|
||||
/***********************************************************************//**
|
||||
Gets the previous record in an undo log from the previous page.
|
||||
|
|
@ -674,80 +665,6 @@ trx_undo_parse_page_header(
|
|||
return(const_cast<byte*>(ptr));
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
Writes the redo log entry of an update undo log header discard. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
trx_undo_discard_latest_log(
|
||||
/*========================*/
|
||||
page_t* undo_page, /*!< in: undo log header page */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_DISCARD, mtr);
|
||||
}
|
||||
|
||||
/***********************************************************//**
|
||||
Parses the redo log entry of an undo log page header discard.
|
||||
@return end of log record or NULL */
|
||||
byte*
|
||||
trx_undo_parse_discard_latest(
|
||||
/*==========================*/
|
||||
byte* ptr, /*!< in: buffer */
|
||||
byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
|
||||
page_t* page, /*!< in: page or NULL */
|
||||
mtr_t* mtr) /*!< in: mtr or NULL */
|
||||
{
|
||||
ut_ad(end_ptr);
|
||||
|
||||
if (page) {
|
||||
trx_undo_discard_latest_update_undo(page, mtr);
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
If an update undo log can be discarded immediately, this function frees the
|
||||
space, resetting the page to the proper state for caching. */
|
||||
static
|
||||
void
|
||||
trx_undo_discard_latest_update_undo(
|
||||
/*================================*/
|
||||
page_t* undo_page, /*!< in: header page of an undo log of size 1 */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
trx_usegf_t* seg_hdr;
|
||||
trx_upagef_t* page_hdr;
|
||||
trx_ulogf_t* log_hdr;
|
||||
trx_ulogf_t* prev_log_hdr;
|
||||
ulint free;
|
||||
ulint prev_hdr_offset;
|
||||
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
||||
free = mach_read_from_2(seg_hdr + TRX_UNDO_LAST_LOG);
|
||||
log_hdr = undo_page + free;
|
||||
|
||||
prev_hdr_offset = mach_read_from_2(log_hdr + TRX_UNDO_PREV_LOG);
|
||||
|
||||
if (prev_hdr_offset != 0) {
|
||||
prev_log_hdr = undo_page + prev_hdr_offset;
|
||||
|
||||
mach_write_to_2(page_hdr + TRX_UNDO_PAGE_START,
|
||||
mach_read_from_2(prev_log_hdr
|
||||
+ TRX_UNDO_LOG_START));
|
||||
mach_write_to_2(prev_log_hdr + TRX_UNDO_NEXT_LOG, 0);
|
||||
}
|
||||
|
||||
mach_write_to_2(page_hdr + TRX_UNDO_PAGE_FREE, free);
|
||||
|
||||
mach_write_to_2(seg_hdr + TRX_UNDO_STATE, TRX_UNDO_CACHED);
|
||||
mach_write_to_2(seg_hdr + TRX_UNDO_LAST_LOG, prev_hdr_offset);
|
||||
|
||||
trx_undo_discard_latest_log(undo_page, mtr);
|
||||
}
|
||||
|
||||
/** Allocate an undo log page.
|
||||
@param[in,out] trx transaction
|
||||
@param[in,out] undo undo log
|
||||
|
|
@ -1677,6 +1594,12 @@ trx_undo_free_prepared(
|
|||
switch (undo->state) {
|
||||
case TRX_UNDO_PREPARED:
|
||||
break;
|
||||
case TRX_UNDO_CACHED:
|
||||
case TRX_UNDO_TO_FREE:
|
||||
case TRX_UNDO_TO_PURGE:
|
||||
ut_ad(trx_state_eq(trx,
|
||||
TRX_STATE_COMMITTED_IN_MEMORY));
|
||||
/* fall through */
|
||||
case TRX_UNDO_ACTIVE:
|
||||
/* lock_trx_release_locks() assigns
|
||||
trx->is_recovered=false */
|
||||
|
|
@ -1697,6 +1620,12 @@ trx_undo_free_prepared(
|
|||
switch (undo->state) {
|
||||
case TRX_UNDO_PREPARED:
|
||||
break;
|
||||
case TRX_UNDO_CACHED:
|
||||
case TRX_UNDO_TO_FREE:
|
||||
case TRX_UNDO_TO_PURGE:
|
||||
ut_ad(trx_state_eq(trx,
|
||||
TRX_STATE_COMMITTED_IN_MEMORY));
|
||||
/* fall through */
|
||||
case TRX_UNDO_ACTIVE:
|
||||
/* lock_trx_release_locks() assigns
|
||||
trx->is_recovered=false */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue