NCBI C++ ToolKit
Public Attributes | List of all members
MDB_txn Struct Reference

Search Toolkit Book for MDB_txn

A database transaction. More...

+ Collaboration diagram for MDB_txn:

Public Attributes

MDB_txnmt_parent
 parent of a nested txn More...
 
MDB_txnmt_child
 Nested txn under this txn, set together with flag MDB_TXN_HAS_CHILD. More...
 
pgno_t mt_next_pgno
 next unallocated page More...
 
txnid_t mt_txnid
 The ID of this transaction. More...
 
MDB_envmt_env
 the DB environment More...
 
MDB_IDL mt_free_pgs
 The list of pages that became unused during this transaction. More...
 
MDB_pagemt_loose_pgs
 The list of loose pages that became unused and may be reused in this transaction, linked through NEXT_LOOSE_PAGE(page). More...
 
int mt_loose_count
 Number of loose pages (mt_loose_pgs) More...
 
MDB_IDL mt_spill_pgs
 The sorted list of dirty pages we temporarily wrote to disk because the dirty list was full. More...
 
union {
   MDB_ID2L   dirty_list
 For write txns: Modified pages. More...
 
   MDB_reader *   reader
 For read txns: This thread/txn's reader table slot, or NULL. More...
 
mt_u
 
MDB_dbxmt_dbxs
 Array of records for each DB known in the environment. More...
 
MDB_dbmt_dbs
 Array of MDB_db records for each known DB. More...
 
unsigned intmt_dbiseqs
 Array of sequence numbers for each DB handle. More...
 
MDB_cursor ** mt_cursors
 In write txns, array of cursors for each DB. More...
 
unsigned char * mt_dbflags
 Array of flags for each DB. More...
 
MDB_dbi mt_numdbs
 Number of DB records in use, or 0 when the txn is finished. More...
 
unsigned int mt_flags
 Transaction Flags More...
 
unsigned int mt_dirty_room
 dirty_list room: Array size - #dirty pages visible to this txn. More...
 

Detailed Description

A database transaction.

Every operation requires a transaction handle.

Definition at line 1084 of file mdb.c.

Member Data Documentation

◆ dirty_list

MDB_ID2L MDB_txn::dirty_list

◆ mt_child

MDB_txn* MDB_txn::mt_child

Nested txn under this txn, set together with flag MDB_TXN_HAS_CHILD.

Definition at line 1087 of file mdb.c.

Referenced by mdb_txn_abort(), mdb_txn_begin(), mdb_txn_commit(), mdb_txn_end(), and mdb_txn_renew0().

◆ mt_cursors

MDB_cursor** MDB_txn::mt_cursors

◆ mt_dbflags

unsigned char* MDB_txn::mt_dbflags

◆ mt_dbiseqs

unsigned int* MDB_txn::mt_dbiseqs

Array of sequence numbers for each DB handle.

Definition at line 1120 of file mdb.c.

Referenced by mdb_dbi_open(), mdb_env_open(), mdb_txn_begin(), and mdb_txn_renew0().

◆ mt_dbs

MDB_db* MDB_txn::mt_dbs

◆ mt_dbxs

MDB_dbx* MDB_txn::mt_dbxs

Array of records for each DB known in the environment.

Definition at line 1116 of file mdb.c.

Referenced by mdb_cmp(), mdb_cursor_init(), mdb_dbi_open(), mdb_dcmp(), mdb_default_cmp(), mdb_env_open(), mdb_set_compare(), mdb_set_dupsort(), mdb_set_relctx(), mdb_set_relfunc(), mdb_txn_begin(), and mdb_txn_commit().

◆ mt_dirty_room

unsigned int MDB_txn::mt_dirty_room

dirty_list room: Array size - #dirty pages visible to this txn.

Includes ancestor txns' dirty pages not hidden by other txns' dirty/spilled pages. Thus commit(nested txn) has room to merge dirty_list into mt_parent after freeing hidden mt_parent pages.

Definition at line 1165 of file mdb.c.

Referenced by mdb_ovpage_free(), mdb_page_alloc(), mdb_page_dirty(), mdb_page_flush(), mdb_page_spill(), mdb_page_unspill(), mdb_txn_begin(), mdb_txn_commit(), and mdb_txn_renew0().

◆ mt_env

MDB_env* MDB_txn::mt_env

◆ mt_flags

unsigned int MDB_txn::mt_flags

◆ mt_free_pgs

MDB_IDL MDB_txn::mt_free_pgs

The list of pages that became unused during this transaction.

Definition at line 1097 of file mdb.c.

Referenced by mdb_drop0(), mdb_freelist_save(), mdb_ovpage_free(), mdb_page_loose(), mdb_page_touch(), mdb_rebalance(), mdb_txn_begin(), mdb_txn_commit(), mdb_txn_end(), and mdb_txn_renew0().

◆ mt_loose_count

int MDB_txn::mt_loose_count

Number of loose pages (mt_loose_pgs)

Definition at line 1103 of file mdb.c.

Referenced by mdb_freelist_save(), mdb_page_alloc(), mdb_page_loose(), mdb_txn_commit(), and mdb_txn_renew0().

◆ mt_loose_pgs

MDB_page* MDB_txn::mt_loose_pgs

The list of loose pages that became unused and may be reused in this transaction, linked through NEXT_LOOSE_PAGE(page).

Definition at line 1101 of file mdb.c.

Referenced by mdb_freelist_save(), mdb_page_alloc(), mdb_page_loose(), mdb_txn_commit(), and mdb_txn_renew0().

◆ mt_next_pgno

pgno_t MDB_txn::mt_next_pgno

◆ mt_numdbs

MDB_dbi MDB_txn::mt_numdbs

Number of DB records in use, or 0 when the txn is finished.

This number only ever increments until the txn finishes; we don't decrement it when individual DB handles are closed.

Definition at line 1140 of file mdb.c.

Referenced by mdb_cursor_shadow(), mdb_cursors_close(), mdb_dbi_open(), mdb_dbis_update(), mdb_pages_xkeep(), mdb_txn_begin(), mdb_txn_commit(), mdb_txn_end(), and mdb_txn_renew0().

◆ mt_parent

MDB_txn* MDB_txn::mt_parent

◆ mt_spill_pgs

MDB_IDL MDB_txn::mt_spill_pgs

The sorted list of dirty pages we temporarily wrote to disk because the dirty list was full.

page numbers in here are shifted left by 1, deleted slots have the LSB set.

Definition at line 1108 of file mdb.c.

Referenced by mdb_ovpage_free(), mdb_page_get(), mdb_page_spill(), mdb_page_unspill(), mdb_txn_begin(), mdb_txn_commit(), mdb_txn_end(), and mdb_txn_renew0().

◆ mt_txnid

txnid_t MDB_txn::mt_txnid

The ID of this transaction.

IDs are integers incrementing from 1. Only committed write transactions increment the ID. If a transaction aborts, the ID may be re-used by the next writer.

Definition at line 1093 of file mdb.c.

Referenced by mdb_env_write_meta(), mdb_find_oldest(), mdb_freelist_save(), mdb_txn_begin(), mdb_txn_commit(), mdb_txn_end(), mdb_txn_id(), mdb_txn_renew(), and mdb_txn_renew0().

◆ 

union { ... } MDB_txn::mt_u

◆ reader

MDB_reader* MDB_txn::reader

For read txns: This thread/txn's reader table slot, or NULL.

Definition at line 1113 of file mdb.c.

Referenced by mdb_txn_end(), and mdb_txn_renew0().


The documentation for this struct was generated from the following file:
Modified on Sat Dec 02 09:20:18 2023 by modify_doxy.py rev. 669887