MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trx0purge.h File Reference
#include "univ.i"
#include "trx0types.h"
#include "mtr0mtr.h"
#include "trx0sys.h"
#include "que0types.h"
#include "page0page.h"
#include "usr0sess.h"
#include "fil0fil.h"
#include "trx0purge.ic"
Include dependency graph for trx0purge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  purge_iter_t
struct  trx_purge_t
struct  trx_purge_rec_t

Enumerations

enum  purge_state_t {
  PURGE_STATE_INIT, PURGE_STATE_RUN, PURGE_STATE_STOP, PURGE_STATE_EXIT,
  PURGE_STATE_DISABLED
}

Functions

UNIV_INLINE fil_addr_t trx_purge_get_log_from_hist (fil_addr_t node_addr)
UNIV_INTERN void trx_purge_sys_create (ulint n_purge_threads, ib_bh_t *ib_bh)
UNIV_INTERN void trx_purge_sys_close (void)
UNIV_INTERN void trx_purge_add_update_undo_to_history (trx_t *trx, page_t *undo_page, mtr_t *mtr)
UNIV_INTERN ulint trx_purge (ulint n_purge_threads, ulint limit, bool truncate)
UNIV_INTERN void trx_purge_stop (void)
UNIV_INTERN void trx_purge_run (void)
UNIV_INTERN purge_state_t trx_purge_state (void)

Variables

trx_purge_tpurge_sys
trx_undo_rec_t trx_purge_dummy_rec

Detailed Description

Purge old versions

Created 3/26/1996 Heikki Tuuri

Definition in file trx0purge.h.

Enumeration Type Documentation

Purge states

Enumerator:
PURGE_STATE_INIT 

Purge instance created

PURGE_STATE_RUN 

Purge should be running

PURGE_STATE_STOP 

Purge should be stopped

PURGE_STATE_EXIT 

Purge has been shutdown

PURGE_STATE_DISABLED 

Purge was never started

Definition at line 107 of file trx0purge.h.

Function Documentation

UNIV_INTERN ulint trx_purge ( ulint  n_purge_threads,
ulint  limit,
bool  truncate 
)

This function runs a purge batch.

Returns
number of undo log pages handled in the batch in: truncate history if true
Parameters
n_purge_threadsin: number of purge tasks to submit to task queue.
limitin: the maximum number of records to purge in one batch

Here is the caller graph for this function:

UNIV_INTERN void trx_purge_add_update_undo_to_history ( trx_t trx,
page_t undo_page,
mtr_t mtr 
)

in: mtr

Adds the update undo log as the first log in the history list. Removes the update undo log segment from the rseg slot if it is too big for reuse.

Parameters
trxin: transaction
undo_pagein: update undo log header page, x-latched
mtrin: mtr

Definition at line 201 of file trx0purge.cc.

Here is the call graph for this function:

UNIV_INLINE fil_addr_t trx_purge_get_log_from_hist ( fil_addr_t  node_addr)

Calculates the file address of an undo log header when we have the file address of its history list node.

Returns
file address of the log in: file address of the history list node of the log
UNIV_INTERN void trx_purge_run ( void  )

Resume purge, move to PURGE_STATE_RUN.

UNIV_INTERN purge_state_t trx_purge_state ( void  )

Get the purge state.

Returns
purge state.

Here is the caller graph for this function:

UNIV_INTERN void trx_purge_stop ( void  )

Stop purge and wait for it to stop, move to PURGE_STATE_STOP.

UNIV_INTERN void trx_purge_sys_close ( void  )

Frees the global purge system control structure.

Definition at line 162 of file trx0purge.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void trx_purge_sys_create ( ulint  n_purge_threads,
ib_bh_t ib_bh 
)

Creates the global purge system control structure and inits the history mutex. in/own: UNDO log min binary heap

Creates the global purge system control structure and inits the history mutex.

Parameters
n_purge_threadsin: number of purge threads
ib_bhin, own: UNDO log min binary heap

Definition at line 112 of file trx0purge.cc.

Here is the call graph for this function:

Variable Documentation

trx_purge_t* purge_sys

The global data structure coordinating a purge

Definition at line 56 of file trx0purge.cc.

trx_undo_rec_t trx_purge_dummy_rec
A dummy undo record used as a return value when we have a whole undo log

which needs no purge

Definition at line 60 of file trx0purge.cc.