Drizzled Public API Documentation

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"

Go to the source code of this file.

Classes

struct  trx_purge_struct
 

Macros

#define trx0purge_h
 
#define TRX_PURGE_ON   1 /* purge operation is running */
 
#define TRX_STOP_PURGE
 

Functions

UNIV_INLINE fil_addr_t trx_purge_get_log_from_hist (fil_addr_t node_addr)
 
UNIV_INTERN ibool trx_purge_update_undo_must_exist (trx_id_t trx_id)
 
UNIV_INTERN void trx_purge_sys_create (void)
 
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 trx_undo_rec_ttrx_purge_fetch_next_rec (roll_ptr_t *roll_ptr, trx_undo_inf_t **cell, mem_heap_t *heap)
 
UNIV_INTERN void trx_purge_rec_release (trx_undo_inf_t *cell)
 
UNIV_INTERN ulint trx_purge (ulint limit)
 
UNIV_INTERN void trx_purge_sys_print (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.

Macro Definition Documentation

#define TRX_STOP_PURGE
Value:
2 /* purge operation is stopped, or
it should be stopped */

Definition at line 186 of file trx0purge.h.

Function Documentation

UNIV_INTERN ulint trx_purge ( ulint  limit)

This function runs a purge batch.

Returns
number of undo log pages handled in the batch in: the maximum number of records to purge in one batch

This function runs a purge batch.

Returns
number of undo log pages handled in the batch
Parameters
limitin: the maximum number of records to purge in one batch

Definition at line 1094 of file trx0purge.cc.

References trx_purge_struct::handle_limit, trx_purge_struct::heap, trx_purge_struct::latch, mem_heap_empty(), trx_purge_struct::mutex, trx_struct::n_active_thrs, trx_purge_struct::n_pages_handled, purge_sys, que_fork_start_command(), que_run_threads(), trx_purge_struct::query, read_view_close(), read_view_oldest_copy_or_open_new(), trx_sys_struct::rseg_history_len, trx_purge_struct::state, trx_purge_struct::trx, trx_purge(), trx_sys, ut_ad, ut_error, UT_LIST_GET_LAST, and trx_purge_struct::view.

Referenced by srv_purge_thread(), and trx_purge().

UNIV_INTERN trx_undo_rec_t* trx_purge_fetch_next_rec ( roll_ptr_t roll_ptr,
trx_undo_inf_t **  cell,
mem_heap_t heap 
)

Fetches the next undo log record from the history list to purge. It must be released with the corresponding release function.

Returns
copy of an undo log record or pointer to trx_purge_dummy_rec, if the whole undo log can skipped in purge; NULL if none left in: memory heap where copied

Fetches the next undo log record from the history list to purge. It must be released with the corresponding release function.

Returns
copy of an undo log record or pointer to trx_purge_dummy_rec, if the whole undo log can skipped in purge; NULL if none left
Parameters
roll_ptrout: roll pointer to undo record
cellout: storage cell for the record in the purge array
heapin: memory heap where copied

Definition at line 989 of file trx0purge.cc.

References trx_purge_struct::handle_limit, read_view_struct::low_limit_no, trx_purge_struct::mutex, trx_purge_struct::n_pages_handled, trx_purge_struct::next_stored, trx_purge_struct::offset, trx_purge_struct::page_no, purge_sys, trx_purge_struct::purge_trx_no, trx_purge_struct::purge_undo_no, trx_purge_struct::rseg, trx_purge_struct::state, trx_purge_fetch_next_rec(), trx_undo_build_roll_ptr(), ut_ad, and trx_purge_struct::view.

Referenced by trx_purge_fetch_next_rec().

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_rec_release ( trx_undo_inf_t cell)

Releases a reserved purge undo record. in: storage cell

Releases a reserved purge undo record.

Parameters
cellin: storage cell

Definition at line 1078 of file trx0purge.cc.

References trx_purge_struct::mutex, purge_sys, and trx_purge_rec_release().

Referenced by trx_purge_rec_release().

UNIV_INTERN ibool trx_purge_update_undo_must_exist ( trx_id_t  trx_id)

Checks if trx_id is >= purge_view: then it is guaranteed that its update undo log still exists in the system.

Returns
TRUE if is sure that it is preserved, also if the function returns FALSE, it is possible that the undo log still exists in the system in: transaction id

Checks if trx_id is >= purge_view: then it is guaranteed that its update undo log still exists in the system.

Returns
TRUE if is sure that it is preserved, also if the function returns FALSE, it is possible that the undo log still exists in the system
Parameters
trx_idin: transaction id

Definition at line 72 of file trx0purge.cc.

References trx_purge_struct::latch, purge_sys, read_view_sees_trx_id(), trx_purge_update_undo_must_exist(), ut_ad, and trx_purge_struct::view.

Referenced by row_vers_must_preserve_del_marked(), trx_purge_update_undo_must_exist(), and trx_undo_get_undo_rec().

Variable Documentation

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 52 of file trx0purge.cc.