Commit c3f9fdea authored by Marko Mäkelä's avatar Marko Mäkelä

Add DBUG "trx" instrumentation that was used for catching MDEV-13470

parent 2152fbdc
......@@ -740,6 +740,8 @@ row_mysql_handle_errors(
{
dberr_t err;
DBUG_ENTER("row_mysql_handle_errors");
handle_new_error:
err = trx->error_state;
......@@ -747,6 +749,9 @@ row_mysql_handle_errors(
trx->error_state = DB_SUCCESS;
DBUG_LOG("trx", "handle error: " << ut_strerr(err)
<< ";id=" << ib::hex(trx->id) << ", " << trx);
switch (err) {
case DB_LOCK_WAIT_TIMEOUT:
if (row_rollback_on_timeout) {
......@@ -795,7 +800,7 @@ row_mysql_handle_errors(
*new_err = err;
return(true);
DBUG_RETURN(true);
case DB_DEADLOCK:
case DB_LOCK_TABLE_FULL:
......@@ -840,7 +845,7 @@ row_mysql_handle_errors(
trx->error_state = DB_SUCCESS;
return(false);
DBUG_RETURN(false);
}
/********************************************************************//**
......
......@@ -238,6 +238,7 @@ struct TrxFactory {
trx_init(trx);
DBUG_LOG("trx", "Init: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
trx->dict_operation_lock_mode = 0;
......@@ -452,6 +453,7 @@ trx_create_low()
/* Trx state can be TRX_STATE_FORCED_ROLLBACK if
the trx was forced to rollback before it's reused.*/
DBUG_LOG("trx", "Create: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
heap = mem_heap_create(sizeof(ib_vector_t) + sizeof(void*) * 8);
......@@ -630,6 +632,7 @@ trx_free_prepared(
ut_d(trx->in_rw_trx_list = FALSE);
DBUG_LOG("trx", "Free prepared: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
/* Undo trx_resurrect_table_locks(). */
......@@ -1753,6 +1756,7 @@ trx_commit_in_memory(
ut_ad(!(trx->in_innodb
& (TRX_FORCE_ROLLBACK | TRX_FORCE_ROLLBACK_ASYNC)));
DBUG_LOG("trx", "Autocommit in memory: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
} else {
......@@ -1888,8 +1892,10 @@ trx_commit_in_memory(
if (trx->abort) {
trx->abort = false;
DBUG_LOG("trx", "Abort: " << trx);
trx->state = TRX_STATE_FORCED_ROLLBACK;
} else {
DBUG_LOG("trx", "Commit in memory: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
}
......@@ -2061,6 +2067,7 @@ trx_cleanup_at_db_startup(
ut_ad(trx->is_recovered);
ut_ad(!trx->in_rw_trx_list);
ut_ad(!trx->in_mysql_trx_list);
DBUG_LOG("trx", "Cleanup at startup: " << trx);
trx->state = TRX_STATE_NOT_STARTED;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment