mco_translog_get_info

This function obtains information about the currently running TL runtime.

For an overview, see TL Applications

Prototype

    MCO_RET mco_translog_get_info(mco_db_h db,
                                mco_TL_current_info_h info);

Arguments

db
Database connection handle.
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.)

Description

This function obtains information about the currently running TL runtime.

Return Codes

MCO_S_OK
Current TL runtime information was obtained successfully.
MCO_E_TL_INVAL
Arguments are wrong or incompatible.
MCO_E_TL_NOT_STARTED
Transaction logging was 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
The value of the transaction counter when the log file was started.
last_trans_counter
The current value of the transaction counter.
stored_transactions
The number of transactions stored in the log file.
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
The size of data currently in the pipe, in bytes.
pipe_readers_connected
The number of currently connected pipe readers.
labels_count
The number of labels stored in the log file.
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
The number of times the maximum number of logging slots was exceeded.
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.

Files

Header file:
mcolog.h
Source file:
mcolog.c
Library:
libmcolog.a