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 | Database connection handle |
info |
A pointer to a structure defined as: typedef struct mco_TL_current_info_ { uint2 flags; mco_trans_counter_t start_trans_count; mco_trans_counter_t last_trans_counter; mco_trans_counter_t stored_transactions; mco_size_t log_size; mco_size_t pipe_used_size; int labels_count; uint4 max_parallel_trans; uint4 exceeded_trans_slots_count; uint4 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 | Log file read successfully. |
MCO_E_TL_INVAL |
Arguments are wrong or incompatible. |
MCO_E_TL_NOT_STARTED |
Transaction logging was not started. |
The structure elements for structure mco_TL_current_info 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 count of transactions stored in the log file. |
log_size |
The current size of the log file in bytes. In the pipe mode, this indicates the current size of the pipe, in bytes (could be less than or equal to the size of the pipe device). |
pipe_used_size |
Current pipe size. |
labels_count |
The count 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 |
exceeded_trans_slots_count |
The number of times the max number of logging slots was exceeded. |
max_transaction_size |
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 |
Note that when the MVCC
transaction manager is used, the structure element exceeded_trans_slots_count
is for informational value. If the count of parallel transactions reaches its limit (max_connections * 2) then the TL runtime “holds” other parallel transactions until all previous transactions are saved. So exceeded_trans_slots_count
retains the count 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
.