summaryrefslogtreecommitdiff
path: root/storage/innobase/trx/trx0roll.cc
Commit message (Collapse)AuthorAgeFilesLines
* Bug #25167032 CRASH WHEN ASSIGNING MY_ERRNO - MISSING MY_THREAD_INIT IN ↵Thirunarayanan Balathandayuthapani2017-04-261-1/+4
| | | | | | | | | | | | BACKGROUND THREAD Description: =========== Add my_thread_init() and my_thread_exit() for background threads which initializes and frees the st_my_thread_var structure. Reviewed-by: Jimmy Yang<jimmy.yang@oracle.com> RB: 15003
* Rename InnoDB transaction undo logging predicates.Marko Mäkelä2017-03-301-3/+3
| | | | | | | | trx::has_logged_persistent(): Renamed from trx_is_redo_rseg_updated(). Determines if a transaction has generated any persistent undo log. trx::has_logged(): Renamed from trx_is_rseg_updated(). Determines if a transaction has generated any undo log.
* MDEV-12258 InnoDB: Fix the bogus debug assertion introduced in MDEV-12219Marko Mäkelä2017-03-181-3/+3
| | | | | | | After a partial rollback, an undo log segment that is empty may carry a duplicate-looking top_undo_no. Adjust the debug assertions and add a test.
* MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND ↵Marko Mäkelä2017-03-171-4/+0
| | | | | | | | | | | | | | | | | | | | UNIV_NONINL Also, remove empty .ic files that were not removed by my MySQL commit. Problem: InnoDB used to support a compilation mode that allowed to choose whether the function definitions in .ic files are to be inlined or not. This stopped making sense when InnoDB moved to C++ in MySQL 5.6 (and ha_innodb.cc started to #include .ic files), and more so in MySQL 5.7 when inline methods and functions were introduced in .h files. Solution: Remove all references to UNIV_NONINL and UNIV_MUST_NOT_INLINE from all files, assuming that the symbols are never defined. Remove the files fut0fut.cc and ut0byte.cc which only mattered when UNIV_NONINL was defined.
* MDEV-12219 Discard temporary undo logs at transaction commitMarko Mäkelä2017-03-131-98/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with MySQL 5.7, temporary tables in InnoDB are handled differently from persistent tables. Because temporary tables are private to a connection, concurrency control and multi-versioning (MVCC) are not applicable. For performance reasons, purge is disabled as well. Rollback is supported for temporary tables; that is why we have the temporary undo logs in the first place. Because MVCC and purge are disabled for temporary tables, we should discard all temporary undo logs already at transaction commit, just like we discard the persistent insert_undo logs. Before this change, update_undo logs were being preserved. trx_temp_undo_t: A wrapper for temporary undo logs, comprising a rollback segment and a single temporary undo log. trx_rsegs_t::m_noredo: Use trx_temp_undo_t. (Instead of insert_undo, update_undo, there will be a single undo.) trx_is_noredo_rseg_updated(), trx_is_rseg_assigned(): Remove. trx_undo_add_page(): Remove the parameter undo_ptr. Acquire and release the rollback segment mutex inside the function. trx_undo_free_last_page(): Remove the parameter trx. trx_undo_truncate_end(): Remove the parameter trx, and add the parameter is_temp. Clean up the code a bit. trx_undo_assign_undo(): Split the parameter undo_ptr into rseg, undo. trx_undo_commit_cleanup(): Renamed from trx_undo_insert_cleanup(). Replace the parameter undo_ptr with undo. This will discard the temporary undo or insert_undo log at commit/rollback. trx_purge_add_update_undo_to_history(), trx_undo_update_cleanup(): Remove 3 parameters. Always operate on the persistent update_undo. trx_serialise(): Renamed from trx_serialisation_number_get(). trx_write_serialisation_history(): Simplify the code flow. If there are no persistent changes, do not update MONITOR_TRX_COMMIT_UNDO. trx_commit_in_memory(): Simplify the logic, and add assertions. trx_undo_page_report_modify(): Keep a direct reference to the persistent update_undo log. trx_undo_report_row_operation(): Simplify some code. Always assign TRX_UNDO_INSERT for temporary undo logs. trx_prepare_low(): Keep only one parameter. Prepare all 3 undo logs. trx_roll_try_truncate(): Remove the parameter undo_ptr. Try to truncate all 3 undo logs of the transaction. trx_roll_pop_top_rec_of_trx_low(): Remove. trx_roll_pop_top_rec_of_trx(): Remove the redundant parameter trx->roll_limit. Clear roll_limit when exhausting the undo logs. Consider all 3 undo logs at once, prioritizing the persistent undo logs. row_undo(): Minor cleanup. Let trx_roll_pop_top_rec_of_trx() reset the trx->roll_limit.
* MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to ↵Marko Mäkelä2017-03-131-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | finish In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was misplaced. The event could be triggered by rollback of resurrected transactions while shutdown was in progress. This bug was caught by cmake -DWITH_ASAN testing. This call was only present in the 10.1 InnoDB Plugin, not in other versions, or in XtraDB. That said, the bug affects all InnoDB versions. Shutdown assumes the cessation of any page-dirtying activity, including the activity of the background rollback thread. InnoDB only waited for the background rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0). The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario where InnoDB is killed, restarted, and shut down soon enough, the data files could become corrupted. logs_empty_and_mark_files_at_shutdown(): Wait for the rollback to finish, except if innodb_fast_shutdown=2 (crash-like shutdown) was requested. trx_rollback_or_clean_recovered(): Before choosing the next recovered transaction to roll back, terminate early if non-slow shutdown was initiated. Roll back everything on slow shutdown (innodb_fast_shutdown=0). srv_innodb_monitor_mutex: Declare as static, because the mutex is only used within one module. In 10.2, os_event_destroy() sets the event to a NULL pointer, while os_event_free() in earlier versions did not do that.
* Hard-code innodb_page_size as the undo log page size.Marko Mäkelä2017-03-101-2/+1
| | | | | | | | | InnoDB undo logs currently always use the innodb_page_size, whether they are stored in the system tablespace, in a dedicated undo tablespace, or in the temporary tablespace. Remove redundant page_size parameters. TrxUndoRsegsIterator::set_next(): return bool instead of page_size.
* MDEV-11236 Failing assertion: state == TRX_STATE_NOT_STARTEDMarko Mäkelä2016-12-021-1/+3
| | | | | | | | | | | trx_state_eq(): Add the parameter bool relaxed=false, to allow trx->state==TRX_STATE_NOT_STARTED where a different state is expected, if an error has been reported. trx_release_savepoint_for_mysql(): Pass relaxed=true to trx_state_eq(). That is, allow the transaction to be idle when ROLLBACK TO SAVEPOINT is attempted after an error has been reported to the client.
* Remove a bunch of TODO's, fix perfschema.threads_innodb testSergei Golubchik2016-09-111-2/+1
|
* Merge InnoDB 5.7 from mysql-5.7.14.Jan Lindström2016-09-081-13/+5
| | | | | | | | | | | | Contains also: MDEV-10549 mysqld: sql/handler.cc:2692: int handler::ha_index_first(uchar*): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed. (branch bb-10.2-jan) Unlike MySQL, InnoDB still uses THR_LOCK in MariaDB MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) enable tests that were fixed in MDEV-10549 MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) fix main.innodb_mysql_sync - re-enable online alter for partitioned innodb tables
* Merge InnoDB 5.7 from mysql-5.7.9.Jan Lindström2016-09-021-400/+256
| | | | | | | | | | | | | | | | | | | | | | | Contains also MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7 The failure happened because 5.7 has changed the signature of the bool handler::primary_key_is_clustered() const virtual function ("const" was added). InnoDB was using the old signature which caused the function not to be used. MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7 Fixed mutexing problem on lock_trx_handle_wait. Note that rpl_parallel and rpl_optimistic_parallel tests still fail. MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan) Reason: incorrect merge MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan) Reason: incorrect merge
* Merge following commit from 5.5:Jan Lindström2016-06-231-1/+1
| | | | | | | | | | | | | | | commit ef92aaf9ece92c873ae0f3448ab2274c958ba3fe Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Wed Jun 22 22:37:28 2016 +0300 MDEV-10083: Orphan ibd file when playing with foreign keys Analysis: row_drop_table_for_mysql did not allow dropping referenced table even in case when actual creating of the referenced table was not successfull if foreign_key_checks=1. Fix: Allow dropping referenced table even if foreign_key_checks=1 if actual table create returned error.
* Merge branch 'merge-innodb-5.6' into 10.0Sergei Golubchik2016-06-211-3/+3
|\
| * 5.6.31Sergei Golubchik2016-06-211-3/+3
| |
| * move to storage/innobaseSergei Golubchik2015-05-041-0/+1391
|
* MDEV-7908: assertion in innobase_release_savepointJan Lindström2015-04-061-1/+1
| | | | | Problem was that in XA prepared state we should still be able to release a savepoint, but assertions were too strict.
* innodb 5.6.23Sergei Golubchik2015-02-181-0/+5
|
* InnoDB 5.6.21Sergei Golubchik2014-11-201-15/+4
|
* MDEV-5574 Set AUTO_INCREMENT below max value of column.Sergei Golubchik2014-02-011-11/+14
| | | | | | | Update InnoDB to 5.6.14 Apply MySQL-5.6 hack for MySQL Bug#16434374 Move Aria-only HA_RTREE_INDEX from my_base.h to maria_def.h (breaks an assert in InnoDB) Fix InnoDB memory leak
* Temporary commit of 10.0-mergeMichael Widenius2013-03-261-32/+32
|
* Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6Michael Widenius2012-08-011-0/+1394