This function obtains information about the currently running TL runtime.
MCO_RET mco_translog_get_info(mco_db_h db,
mco_TL_current_info_h info);
db
info
A pointer to a structure defined as:
typedef struct mco_TL_current_info_
{
mco_uint4 flags;
mco_trans_counter_t start_trans_counter;
mco_trans_counter_t last_trans_counter;
mco_trans_counter_t stored_transactions;
mco_size_t log_size;
mco_size_t pipe_used_size;
mco_uint2 pipe_readers_connected;
int labels_count;
uint4 max_parallel_trans;
uint4 exceeded_trans_slots_count;
mco_size_t max_transaction_size;
} mco_TL_current_info_t,
*mco_TL_current_info_h;
(The structure elements are explained below.)
This function obtains information about the currently running TL runtime.
MCO_S_OK
MCO_E_TL_INVAL
MCO_E_TL_NOT_STARTED
The elements of the mco_TL_current_info_t structure are defined as follows:
flags
The combination of MCO_TL_FLAGS values
specified in the flags element of the mco_TL_start_data structure
passed to mco_translog_start().
start_trans_counter
last_trans_counter
stored_transactions
log_size
The current size of the log file in bytes. In pipe mode, this indicates the current size of the pipe, in bytes (less than or equal to the size of the pipe device).
pipe_used_size
pipe_readers_connected
labels_count
max_parallel_trans
The maximum number of logging slots used simultaneously for parallel transaction commits since
logging started when using the
MVCC transaction
manager. The total number of slots may range from 0 to max_connections * 2.
Note: The logging option
MCO_TRANSLOG_SYNC_INSTANTLY disables this
optimization.
exceeded_trans_slots_count
max_transaction_size
The size of the largest transaction since the log was started. It may be used as a statistic for
optimizing the size of memory supplied for the function mco_translog_iterate() and also
to tune the value of the field disk_page_size in pipe mode with the flag
MCO_TRANSLOG_SYNC_INSTANTLY.
Note that when the
MVCC transaction manager
is used, the structure element exceeded_trans_slots_count is for informational purposes.
If the number of parallel transactions reaches its limit (max_connections * 2), then the TL
runtime holds other parallel transactions until all previous transactions are saved. Thus,
exceeded_trans_slots_count retains the number of times that all available log slots were used
and other parallel transactions were held. If this count is large, it is recommended that the database be
opened with a higher value for
max_connections.