MCO_RET mco_trans_rt_estimate_rollback_time(mco_trans_h t, mco_interval_t* estimation)
t
estimation
This function returns the time in milliseconds required to roll back the current transaction. The time is calculated based on the current number of memory and persistent dirty pages (pages that have been modified by the current transaction).
This function can be used by the deadline policy callbacks. For instance the predefined callback for the adjustable deadline policy is implemented as follows:
MCO_RET mco_trans_rt_rollback_deadline_check(mco_trans_h t) { mco_interval_t remaining; MCO_RET ret = mco_trans_rt_get_remaining_time(t, &remaining); if (ret == MCO_S_OK) { mco_interval_t rollback_time_estimation; ret = mco_trans_rt_estimate_rollback_time(t, &rollback_time_estimation); if (ret == MCO_S_OK) { if (remaining < rollback_time_estimation) { ret = MCO_E_INTERRUPTED; } } } return ret; }
MCO_S_OK