diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-04-23 20:21:58 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-04-23 20:21:58 +0530 |
commit | 34bed41f0df2a3a0af127932f95a1ff297812594 (patch) | |
tree | 97434ccb466f45fb5ba946dc573408f4bbc604d4 | |
parent | 7f2215f07e80d4287a085c082d12ecb2cff370a4 (diff) | |
download | mariadb-git-bb-5.5-thiru.tar.gz |
- Addressed marko's review comments.bb-5.5-thiru
-rw-r--r-- | mysql-test/suite/innodb/r/xa_debug.result (renamed from mysql-test/r/xa_debug.result) | 52 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/xa_debug.test (renamed from mysql-test/t/xa_debug.test) | 4 | ||||
-rw-r--r-- | storage/innobase/include/trx0trx.h | 16 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.c | 31 | ||||
-rw-r--r-- | storage/xtradb/include/trx0trx.h | 16 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0trx.c | 31 |
6 files changed, 67 insertions, 83 deletions
diff --git a/mysql-test/r/xa_debug.result b/mysql-test/suite/innodb/r/xa_debug.result index f35f966de9f..9aac422c4d4 100644 --- a/mysql-test/r/xa_debug.result +++ b/mysql-test/suite/innodb/r/xa_debug.result @@ -251,4 +251,56 @@ xa start 'test1'; insert into t1 values(1); xa end 'test1'; xa prepare 'test1'; +xa recover; +formatID gtrid_length bqual_length data +1 6 0 test50 +1 6 0 test43 +1 6 0 test22 +1 6 0 test14 +1 6 0 test27 +1 6 0 test24 +1 6 0 test26 +1 5 0 test2 +1 6 0 test31 +1 6 0 test30 +1 6 0 test42 +1 6 0 test49 +1 5 0 test4 +1 5 0 test5 +1 6 0 test17 +1 6 0 test35 +1 6 0 test10 +1 5 0 test9 +1 5 0 test6 +1 6 0 test41 +1 6 0 test34 +1 6 0 test37 +1 6 0 test12 +1 6 0 test45 +1 6 0 test44 +1 6 0 test33 +1 6 0 test36 +1 6 0 test39 +1 6 0 test48 +1 6 0 test13 +1 6 0 test21 +1 6 0 test15 +1 6 0 test38 +1 6 0 test11 +1 6 0 test16 +1 5 0 test7 +1 6 0 test40 +1 6 0 test47 +1 6 0 test29 +1 6 0 test28 +1 6 0 test18 +1 5 0 test3 +1 5 0 test1 +1 6 0 test19 +1 6 0 test25 +1 6 0 test32 +1 6 0 test46 +1 6 0 test20 +1 5 0 test8 +1 6 0 test23 drop table t1; diff --git a/mysql-test/t/xa_debug.test b/mysql-test/suite/innodb/t/xa_debug.test index 92ff0e5b50c..4c2f1e1fd4e 100644 --- a/mysql-test/t/xa_debug.test +++ b/mysql-test/suite/innodb/t/xa_debug.test @@ -1,5 +1,7 @@ -- source include/have_innodb.inc +-- source include/have_debug.inc -- source include/not_embedded.inc + call mtr.add_suppression("Found 50 prepared XA transactions"); create table t1 (a int) engine=innodb; insert into t1 values(1); @@ -27,5 +29,5 @@ connection default; -- enable_reconnect -- source include/wait_until_connected_again.inc -- disable_reconnect - +xa recover; drop table t1; diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 38a281985dc..9fa087bdc43 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -48,18 +48,6 @@ extern ulint trx_n_mysql_transactions; the kernel mutex */ extern ulint trx_n_prepared; -/** Reset the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_reset_xid_list(trx_t* trx); - -/** Set the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_set_xid_list(trx_t* trx); - -/** Get the xid list value of transaction. -@return true if prepared transaction is in xid list. */ -UNIV_INTERN ibool trx_get_xid_list(const trx_t* trx); - /********************************************************************//** Releases the search latch if trx has reserved it. */ UNIV_INTERN @@ -741,8 +729,8 @@ struct trx_struct{ /*------------------------------*/ char detailed_error[256]; /*!< detailed error message for last error, or empty. */ - /* True, if it is present in xid list. */ - ibool is_in_xid_list; + /* True, if it is present in recovered list. */ + ibool ha_recovered; }; #define TRX_MAX_N_THREADS 32 /* maximum number of diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 795261687ce..b753676b0a2 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -189,7 +189,7 @@ trx_create( trx->n_autoinc_rows = 0; - trx_reset_xid_list(trx); + trx->ha_recovered = FALSE; /* Remember to free the vector explicitly. */ trx->autoinc_locks = ib_vector_create( @@ -1757,27 +1757,6 @@ trx_mark_sql_stat_end( trx->last_sql_stat_start.least_undo_no = trx->undo_no; } -/** Reset the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_reset_xid_list(trx_t* trx) -{ - trx->is_in_xid_list = FALSE; -} - -/** Set the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_set_xid_list(trx_t* trx) -{ - trx->is_in_xid_list = TRUE; -} - -/** Get the xid list value of transaction -@return true if prepared transaction is in xid list. */ -UNIV_INTERN ibool trx_get_xid_list(const trx_t* trx) -{ - return trx->is_in_xid_list; -} - /**********************************************************************//** Prints info about a transaction to the given file. The caller must own the kernel mutex. */ @@ -2095,7 +2074,7 @@ trx_recover_for_mysql( while (trx) { if (trx->conc_state == TRX_PREPARED - && trx_get_xid_list(trx) == FALSE) { + && trx->ha_recovered == FALSE) { xid_list[count] = trx->xid; if (count == 0) { @@ -2119,7 +2098,7 @@ trx_recover_for_mysql( count++; - trx_set_xid_list(trx); + trx->ha_recovered = TRUE; if (count == len) { break; @@ -2135,9 +2114,7 @@ trx_recover_for_mysql( trx != NULL; trx = UT_LIST_GET_NEXT(trx_list, trx)) { - if (trx_get_xid_list(trx) == TRUE) { - trx_reset_xid_list(trx); - } + trx->ha_recovered = FALSE; } } diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h index c3e9faf2c10..be37055c04c 100644 --- a/storage/xtradb/include/trx0trx.h +++ b/storage/xtradb/include/trx0trx.h @@ -48,18 +48,6 @@ extern ulint trx_n_mysql_transactions; the kernel mutex */ extern ulint trx_n_prepared; -/** Reset the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_reset_xid_list(trx_t* trx); - -/** Set the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_set_xid_list(trx_t* trx); - -/** Get the xid list value of transaction. -@return true if prepared transaction is in xid list. */ -UNIV_INTERN ibool trx_get_xid_list(const trx_t* trx); - /********************************************************************//** In XtraDB it is impossible for a transaction to own a search latch outside of InnoDB code, so there is nothing to release on demand. We keep this function to @@ -802,8 +790,8 @@ struct trx_struct{ #define DPAH_SIZE 8192 byte* distinct_page_access_hash; ibool take_stats; - /* True if it is present in xid list. */ - ibool is_in_xid_list; + /* True if it is present in recovered list. */ + ibool ha_recovered; }; #define TRX_MAX_N_THREADS 32 /* maximum number of diff --git a/storage/xtradb/trx/trx0trx.c b/storage/xtradb/trx/trx0trx.c index 7a91d8fb27f..50125f1940a 100644 --- a/storage/xtradb/trx/trx0trx.c +++ b/storage/xtradb/trx/trx0trx.c @@ -333,7 +333,7 @@ trx_create( trx->autoinc_locks = ib_vector_create( mem_heap_create(sizeof(ib_vector_t) + sizeof(void*) * 4), 4); - trx_reset_xid_list(trx); + trx->ha_recovered = FALSE; return(trx); } @@ -2015,27 +2015,6 @@ trx_mark_sql_stat_end( trx->last_sql_stat_start.least_undo_no = trx->undo_no; } -/** Reset the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_reset_xid_list(trx_t* trx) -{ - trx->is_in_xid_list = FALSE; -} - -/** Set the xid list variable in transaction -@param[in,out] trx prepared transaction. */ -UNIV_INTERN void trx_set_xid_list(trx_t* trx) -{ - trx->is_in_xid_list = TRUE; -} - -/** Get the xid list value of transaction -@return true if prepared transaction is in xid list. */ -UNIV_INTERN ibool trx_get_xid_list(const trx_t* trx) -{ - return trx->is_in_xid_list; -} - /**********************************************************************//** Prints info about a transaction to the given file. The caller must own the kernel mutex. */ @@ -2382,7 +2361,7 @@ trx_recover_for_mysql( while (trx) { if (trx->state == TRX_PREPARED - && trx_get_xid_list(trx) == FALSE) { + && trx->ha_recovered == FALSE) { xid_list[count] = trx->xid; if (count == 0) { @@ -2406,7 +2385,7 @@ trx_recover_for_mysql( count++; - trx_set_xid_list(trx); + trx->ha_recovered = TRUE; if (count == len) { break; @@ -2421,9 +2400,7 @@ trx_recover_for_mysql( trx != NULL; trx = UT_LIST_GET_NEXT(trx_list, trx)) { - if (trx_get_xid_list(trx) == TRUE) { - trx_reset_xid_list(trx); - } + trx->ha_recovered = FALSE; } } |