Scroll to navigation

sds_bptree_transaction(3) dirsrv sds_bptree_transaction(3)

NAME

sds_bptree_transaction

SYNOPSIS

#include <sds.h>

Data Fields


uint32_t checksum
uint32_t reference_count
sds_txn_state state
struct _sds_bptree_cow_instance * binst
struct _sds_bptree_instance * bi
uint64_t txn_id
sds_bptree_node_list * owned
sds_bptree_node_list * created
struct _sds_bptree_node * root
struct _sds_bptree_transaction * parent_txn
struct _sds_bptree_transaction * child_txn

Detailed Description

sds_bptree_transaction Manages the content and lifetime of nodes within the tree. It is the basis of our garbage collection system, using atomic reference counts to synchronise our behaviour.

Field Documentation

struct _sds_bptree_instance* sds_bptree_transaction::bi

Pointer to the b+tree instance that this transaction holds.

struct _sds_bptree_cow_instance* sds_bptree_transaction::binst

Pointer to the cow b+tree instance that created us.

uint32_t sds_bptree_transaction::checksum

Checksum of the data in this structure.

struct _sds_bptree_transaction* sds_bptree_transaction::child_txn

The next transaction that derives from us.

sds_bptree_node_list* sds_bptree_transaction::created

The list of nodes that this transaction 'created'. This is used during an abort of the txn to roll back any changes that we made.

sds_bptree_node_list* sds_bptree_transaction::owned

The list of nodes that this transaction 'owns'. When the reference count moves to 0, these nodes will be freed. This list is created during a write transaction of 'items that will not be needed when we are removed.'.

IE, when we have a txn A, then a new transaction B is made, we 'copy' node 1a to node 1b. Node 1b is 'created' by txn B, and node 1a is 'owend' by txn A, because it's the last transaction that depends on this nodes existance.

struct _sds_bptree_transaction* sds_bptree_transaction::parent_txn

The previous transaction that we are derived from.

uint32_t sds_bptree_transaction::reference_count

Reference count to the number of consumers of this transaction. This is atomically updated. If this is the 'active' primary transaction, this is guaranteed to be 1 or greater. When a new write transaction is commited, if this reference count falls to 0, this transaction is implicitly destroy.

struct _sds_bptree_node* sds_bptree_transaction::root

The current root node. Each transaction owns a unique root node which anchors the branches of the copy on write structure.

sds_txn_state sds_bptree_transaction::state

The state of the transaction. All transactions start as SDS_WRITE_TXN, and upon commit move to the SDS_READ_TXN state.

uint64_t sds_bptree_transaction::txn_id

The unique identifier of this transaction.

Author

Generated automatically by Doxygen for dirsrv from the source code.

Fri May 31 2024 Version 2.4.5