InnoDB Plugin  1.0
Data Structures | Macros | Functions
trx0rseg.h File Reference
#include "univ.i"
#include "trx0types.h"
#include "trx0sys.h"
#include "ut0bh.h"
#include "trx0rseg.ic"
Include dependency graph for trx0rseg.h:

Go to the source code of this file.

Data Structures

struct  trx_rseg_t
struct  rseg_queue_t

Macros

#define TRX_RSEG_N_SLOTS   (UNIV_PAGE_SIZE / 16)
#define TRX_RSEG_MAX_N_TRXS   (TRX_RSEG_N_SLOTS / 2)
#define TRX_RSEG_SLOT_PAGE_NO
#define TRX_RSEG_SLOT_SIZE   4
#define TRX_RSEG   FSEG_PAGE_DATA
#define TRX_RSEG_MAX_SIZE
#define TRX_RSEG_HISTORY_SIZE
#define TRX_RSEG_HISTORY
#define TRX_RSEG_FSEG_HEADER   (8 + FLST_BASE_NODE_SIZE)
#define TRX_RSEG_UNDO_SLOTS   (8 + FLST_BASE_NODE_SIZE + FSEG_HEADER_SIZE)

Functions

UNIV_INLINE trx_rsegf_ttrx_rsegf_get (ulint space, ulint zip_size, ulint page_no, mtr_t *mtr)
UNIV_INLINE trx_rsegf_ttrx_rsegf_get_new (ulint space, ulint zip_size, ulint page_no, mtr_t *mtr)
UNIV_INLINE ulint trx_rsegf_get_nth_undo (trx_rsegf_t *rsegf, ulint n, mtr_t *mtr)
UNIV_INLINE void trx_rsegf_set_nth_undo (trx_rsegf_t *rsegf, ulint n, ulint page_no, mtr_t *mtr)
UNIV_INLINE ulint trx_rsegf_undo_find_free (trx_rsegf_t *rsegf, mtr_t *mtr)
UNIV_INLINE trx_rseg_ttrx_rseg_get_on_id (ulint id)
UNIV_INTERN ulint trx_rseg_header_create (ulint space, ulint zip_size, ulint max_size, ulint rseg_slot_no, mtr_t *mtr)
UNIV_INTERN void trx_rseg_array_init (trx_sysf_t *sys_header, ib_bh_t *ib_bh, mtr_t *mtr)
UNIV_INTERN void trx_rseg_mem_free (trx_rseg_t *rseg)
UNIV_INTERN trx_rseg_ttrx_rseg_create (ulint space)
UNIV_INTERN ulint trx_rseg_get_n_undo_tablespaces (ulint *space_ids)

Detailed Description

Rollback segment

Created 3/26/1996 Heikki Tuuri

Macro Definition Documentation

#define TRX_RSEG_HISTORY
Value:
8 /* The update undo logs for committed
transactions */
#define TRX_RSEG_HISTORY_SIZE
Value:
4 /* Number of file pages occupied
by the logs in the history list */
#define TRX_RSEG_MAX_SIZE
Value:
0 /* Maximum allowed size for rollback
segment in pages */
#define TRX_RSEG_SLOT_PAGE_NO
Value:
0 /* Page number of the header page of
an undo log segment */

Function Documentation

UNIV_INTERN void trx_rseg_array_init ( trx_sysf_t sys_header,
ib_bh_t ib_bh,
mtr_t mtr 
)

Creates the memory copies for rollback segments and initializes the rseg array in trx_sys at a database startup. in/out: mtr

Parameters
sys_headerin/out: trx system header
ib_bhin: rseg queue
UNIV_INTERN trx_rseg_t* trx_rseg_create ( ulint  space)

in: id of UNDO tablespace

UNIV_INTERN ulint trx_rseg_get_n_undo_tablespaces ( ulint *  space_ids)

out: array of space ids of UNDO tablespaces

UNIV_INLINE trx_rseg_t* trx_rseg_get_on_id ( ulint  id)

Looks for a rollback segment, based on the rollback segment id.

Returns
rollback segment in: rollback segment id

Looks for a rollback segment, based on the rollback segment id.

Returns
rollback segment
Parameters
idin: rollback segment id
UNIV_INTERN ulint trx_rseg_header_create ( ulint  space,
ulint  zip_size,
ulint  max_size,
ulint  rseg_slot_no,
mtr_t mtr 
)

Creates a rollback segment header. This function is called only when a new rollback segment is created in the database.

Returns
page number of the created segment, FIL_NULL if fail in: mtr
Parameters
spacein: space id
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
max_sizein: max size in pages
rseg_slot_noin: rseg id == slot number in trx sys
UNIV_INTERN void trx_rseg_mem_free ( trx_rseg_t rseg)

in, own: instance to free

UNIV_INLINE trx_rsegf_t* trx_rsegf_get ( ulint  space,
ulint  zip_size,
ulint  page_no,
mtr_t mtr 
)

Gets a rollback segment header.

Returns
rollback segment header, page x-latched in: mtr

Gets a rollback segment header.

Returns
rollback segment header, page x-latched
Parameters
spacein: space where placed
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
page_noin: page number of the header
mtrin: mtr
UNIV_INLINE trx_rsegf_t* trx_rsegf_get_new ( ulint  space,
ulint  zip_size,
ulint  page_no,
mtr_t mtr 
)

Gets a newly created rollback segment header.

Returns
rollback segment header, page x-latched in: mtr

Gets a newly created rollback segment header.

Returns
rollback segment header, page x-latched
Parameters
spacein: space where placed
zip_sizein: compressed page size in bytes or 0 for uncompressed pages
page_noin: page number of the header
mtrin: mtr
UNIV_INLINE ulint trx_rsegf_get_nth_undo ( trx_rsegf_t rsegf,
ulint  n,
mtr_t mtr 
)

Gets the file page number of the nth undo log slot.

Returns
page number of the undo log segment in: mtr

Gets the file page number of the nth undo log slot.

Returns
page number of the undo log segment
Parameters
rsegfin: rollback segment header
nin: index of slot
mtrin: mtr
UNIV_INLINE void trx_rsegf_set_nth_undo ( trx_rsegf_t rsegf,
ulint  n,
ulint  page_no,
mtr_t mtr 
)

Sets the file page number of the nth undo log slot. in: mtr

Sets the file page number of the nth undo log slot.

Parameters
rsegfin: rollback segment header
nin: index of slot
page_noin: page number of the undo log segment
mtrin: mtr
UNIV_INLINE ulint trx_rsegf_undo_find_free ( trx_rsegf_t rsegf,
mtr_t mtr 
)

Looks for a free slot for an undo log segment.

Returns
slot index or ULINT_UNDEFINED if not found in: mtr

Looks for a free slot for an undo log segment.

Returns
slot index or ULINT_UNDEFINED if not found
Parameters
rsegfin: rollback segment header
mtrin: mtr