InnoDB Plugin  1.0
Data Structures | Enumerations | Functions | Variables
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:

Go to the source code of this file.

Data Structures

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

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

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
UNIV_INTERN void trx_purge_add_update_undo_to_history ( trx_t trx,
page_t undo_page,
mtr_t mtr 
)

in: mtr

Parameters
trxin: transaction
undo_pagein: update undo log header page, x-latched
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

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
Parameters
node_addrin: 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.
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.

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

Parameters
n_purge_threadsin: number of purge threads

Variable Documentation

trx_purge_t* purge_sys

The global data structure coordinating a purge

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