drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
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 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  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 (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 trx_undo_rec_t * trx_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_t * purge_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

◆ trx0purge_h

#define trx0purge_h

Definition at line 28 of file trx0purge.h.

◆ TRX_PURGE_ON

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

Definition at line 191 of file trx0purge.h.

◆ TRX_STOP_PURGE

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

Definition at line 192 of file trx0purge.h.

Function Documentation

◆ trx_purge()

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

◆ trx_purge_add_update_undo_to_history()

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

◆ trx_purge_fetch_next_rec()

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

◆ trx_purge_get_log_from_hist()

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

◆ trx_purge_rec_release()

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

◆ trx_purge_sys_close()

UNIV_INTERN void trx_purge_sys_close ( void )

Frees the global purge system control structure.

Definition at line 269 of file trx0purge.cc.

◆ trx_purge_sys_create()

UNIV_INTERN void trx_purge_sys_create ( 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
ib_bhin, own: UNDO log min binary heap

Definition at line 222 of file trx0purge.cc.

◆ trx_purge_sys_print()

UNIV_INTERN void trx_purge_sys_print ( void )

Prints information of the purge system to stderr.

Definition at line 1213 of file trx0purge.cc.

◆ trx_purge_update_undo_must_exist()

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.

Variable Documentation

◆ purge_sys

trx_purge_t* purge_sys
extern

The global data structure coordinating a purge

Definition at line 48 of file trx0purge.cc.

◆ trx_purge_dummy_rec

trx_undo_rec_t trx_purge_dummy_rec
extern

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.