summaryrefslogtreecommitdiff
path: root/storage/innobase/sync/sync0sync.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-15914: Remove trx_t::undo_mutexMarko Mäkelä2018-04-261-1/+0
| | | | | | | | | | | | | | | | | | The trx_t::undo_mutex covered both some main-memory data structures (trx_undo_t) and access to undo pages. The trx_undo_t is only accessed by the thread that is associated with a running transaction. Likewise, each transaction has its private set of undo pages. The thread that is associated with an active transaction may lock multiple undo pages concurrently, but no other thread may lock multiple pages of a foreign transaction. Concurrent access to the undo logs of an active transaction is possible, but trx_undo_get_undo_rec_low() only locks one undo page at a time, without ever holding any undo_mutex. It seems that the trx_t::undo_mutex would have been necessary if multi-threaded execution or rollback of a single transaction had been implemented in InnoDB.
* Windows, compiling : use /permissive- switch to improve conformanceVladislav Vaintroub2018-02-071-3/+3
| | | | fix a couple "initialization skipped by goto" and other new errors.
* Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-301-1/+0
|\
| * Remove unused metadata for non-existing sync_thread_mutexMarko Mäkelä2018-01-281-1/+0
| |
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-241-1/+1
|\ \ | |/
| * Allocate mutex_monitor, create_tracker staticallyMarko Mäkelä2018-01-221-1/+1
| |
* | MDEV-14638 - Replace trx_sys_t::rw_trx_set with LF_HASHSergey Vojtovich2018-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trx_sys_t::rw_trx_set is implemented as std::set, which does a few quite expensive operations under trx_sys_t::mutex protection: e.g. malloc/free when adding/removing elements. Traversing b-tree is not that cheap either. This has negative scalability impact, which is especially visible when running oltp_update_index.lua benchmark on a ramdisk. To reduce trx_sys_t::mutex contention std::set is replaced with LF_HASH. None of LF_HASH operations require trx_sys_t::mutex (nor any other global mutex) protection. Another interesting issue observed with std::set is reproducible ~2% performance decline after benchmark is ran for ~60 seconds. With LF_HASH results are stable. All in all this patch optimises away one of three trx_sys->mutex locks per oltp_update_index.lua query. The other two critical sections became smaller. Relevant clean-ups: Replaced rw_trx_set iteration at startup with local set. The latter is needed because values inserted to rw_trx_list must be ordered by trx->id. Removed redundant conditions from trx_reference(): it is (and even was) never called with transactions that have trx->state == TRX_STATE_COMMITTED_IN_MEMORY. do_ref_count doesn't (and probably even didn't) make any sense: now it is called only when reference counter increment is actually requested. Moved condition out of mutex in trx_erase_lists(). trx_rw_is_active(), trx_rw_is_active_low() and trx_get_rw_trx_by_id() were greatly simplified and replaced by appropriate trx_rw_hash_t methods. Compared to rw_trx_set, rw_trx_hash holds transactions only in PREPARED or ACTIVE states. Transactions in COMMITTED state were required to be found at InnoDB startup only. They are now looked up in the local set. Removed unused trx_assert_recovered(). Removed unused innobase_get_trx() declaration. Removed rather semantically incorrect trx_sys_rw_trx_add(). Moved information printout from trx_sys_init_at_db_start() to trx_lists_init_at_db_start().
* | Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2017-08-261-1/+0
|\ \ | |/
| * MDEV-13485 MTR tests fail massively with --innodb-sync-debugMarko Mäkelä2017-08-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter --innodb-sync-debug, which is disabled by default, aims to find potential deadlocks in InnoDB. When the parameter is enabled, lots of tests failed. Most of these failures were due to bogus diagnostics. But, as part of this fix, we are also fixing a bug in error handling code and removing dead code, and fixing cases where an uninitialized mutex was being locked and unlocked. dict_create_foreign_constraints_low(): Remove an extraneous mutex_exit() call that could cause corruption in an error handling path. Also, do not unnecessarily acquire dict_foreign_err_mutex. Its only purpose is to control concurrent access to dict_foreign_err_file. row_ins_foreign_trx_print(): Replace a redundant condition with a debug assertion. srv_dict_tmpfile, srv_dict_tmpfile_mutex: Remove. The temporary file is never being written to or read from. log_free_check(): Allow SYNC_FTS_CACHE (fts_cache_t::lock) to be held. ha_innobase::inplace_alter_table(), row_merge_insert_index_tuples(): Assert that no unexpected latches are being held. sync_latch_meta_init(): Properly initialize dict_operation_lock_key at SYNC_DICT_OPERATION. dict_sys->mutex is SYNC_DICT, and the now-removed SRV_DICT_TMPFILE was wrongly registered at SYNC_DICT_OPERATION. buf_block_init(): Correctly register buf_block_t::debug_latch. It was previously misleadingly reported as LATCH_ID_DICT_FOREIGN_ERR. latch_level_t: Correct the relative latching order of SYNC_IBUF_PESS_INSERT_MUTEX,SYNC_INDEX_TREE and SYNC_FILE_FORMAT_TAG,SYNC_DICT_OPERATION to avoid bogus failures. row_drop_table_for_mysql(): Avoid accessing btr_defragment_mutex if the defragmentation thread has not been started. This is the case during fts_drop_orphaned_tables() in recv_recovery_rollback_active(). fil_space_destroy_crypt_data(): Avoid acquiring fil_crypt_threads_mutex when it is uninitialized. We may have created crypt_data before the mutex was created, and the mutex creation would be skipped if InnoDB startup failed or --innodb-read-only was specified.
* | Remove deprecated InnoDB file format parametersMarko Mäkelä2017-06-021-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following options will be removed: innodb_file_format innodb_file_format_check innodb_file_format_max innodb_large_prefix They have been deprecated in MySQL 5.7.7 (and MariaDB 10.2.2) in WL#7703. The file_format column in two INFORMATION_SCHEMA tables will be removed: innodb_sys_tablespaces innodb_sys_tables Code to update the file format tag at the end of page 0:5 (TRX_SYS_PAGE in the InnoDB system tablespace) will be removed. When initializing a new database, the bytes will remain 0. All references to the Barracuda file format will be removed. Some references to the Antelope file format (meaning ROW_FORMAT=REDUNDANT or ROW_FORMAT=COMPACT) will remain. This basically ports WL#7704 from MySQL 8.0.0 to MariaDB 10.3.1: commit 4a69dc2a95995501ed92d59a1de74414a38540c6 Author: Marko Mäkelä <marko.makela@oracle.com> Date: Wed Mar 11 22:19:49 2015 +0200
* Remove MYSQL_ENCRYPTION.Marko Mäkelä2017-01-181-1/+0
| | | | | | MariaDB will likely never support MySQL-style encryption for InnoDB, because we cannot link with the Oracle encryption plugin. This is preparation for merging MDEV-11623.
* Merge InnoDB 5.7 from mysql-5.7.14.Jan Lindström2016-09-081-7/+3
| | | | | | | | | | | | 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-1487/+184
| | | | | | | | | | | | | | | | | | | | | | | 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 branch '10.0' into 10.1Sergei Golubchik2016-06-281-3/+3
|\
| * Merge branch 'merge-innodb-5.6' into 10.0Sergei Golubchik2016-06-211-3/+3
| |\
| | * 5.6.31Sergei Golubchik2016-06-211-3/+3
| | |
* | | MDEV-9359: encryption.create_or_replace fails sporadically in buildbot: ↵Jan Lindström2016-01-051-1/+7
| | | | | | | | | | | | | | | | | | | | | failing assertion: mutex->magic_n == MUTEX_MAGIC_N Make sure that encryption threads mutex is initialized before starting encryption threads.
* | | Merge tag 'mariadb-10.0.19' into 10.1Sergei Golubchik2015-06-011-3/+3
|\ \ \ | |/ /
| * | InnoDB-5.6.24Sergei Golubchik2015-05-051-3/+3
| |\ \ | | |/
| | * 5.6.24Sergei Golubchik2015-05-041-3/+3
| | |
| | * move to storage/innobaseSergei Golubchik2015-05-041-0/+1608
| |
| * MDEV-8079: Crash when running MariaDB Debug with InnoDB on WindowsJan Lindström2015-05-011-44/+16
| | | | | | | | | | | | Problem was that std::vector was allocated using calloc instead of new, this caused vector constructor not being called and vector metadata not initialized.
* | MDEV-8079: Crash when running MariaDB Debug with InnoDB on WindowsJan Lindström2015-05-011-44/+16
| | | | | | | | | | | | Problem was that std::vector was allocated using calloc instead of new, this caused vector constructor not being called and vector metadata not initialized.
* | Merge 10.0 -> 10.1Kristian Nielsen2015-04-201-63/+37
|\ \ | |/
| * MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob ↵Jan Lindström2015-03-311-0/+2
| | | | | | | | | | | | update Replace static array of thread sync levels with std::vector.
| * Better and more correct comment.Jan Lindström2015-03-181-2/+8
| |
| * Fix assertion failure seen on Buildbot win32-debugJan Lindström2015-03-181-0/+13
| | | | | | | | | | | | | | There is a bug in Visual Studio 2010 Visual Studio has a feature "Checked Iterators". In a debug build, every iterator operation is checked at runtime for errors, e g, out of range. Disable this "Checked Iterators" for Windows and Debug if defined.
| * Make sure that sync level vector is emptied.Jan Lindström2015-03-181-0/+1
| |
| * MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob ↵Jan Lindström2015-03-171-63/+15
| | | | | | | | | | | | | | | | | | | | update Problem was that static array was used for storing thread mutex sync levels. Fixed by using std::vector instead. Does not contain test case to avoid too big memory/disk space usage on buildbot VMs.
* | fix a crash of innodb.innodb_mutexes,innodb_pluginSergei Golubchik2015-03-071-0/+1
| | | | | | | | add forgotten initialization of the mutex name
* | MDEV-7109: Add support for INFORMATION_SCHEMA.INNODB_SEMAPHORE_WAITSJan Lindström2015-02-211-6/+20
| | | | | | | | | | | | | | | | | | | | MDEV-7399: Add support for INFORMATION_SCHEMA.INNODB_MUTEXES MDEV-7618: Improve semaphore instrumentation Introduced two new information schema tables to monitor mutex waits and semaphore waits. Added a new configuration variable innodb_intrument_semaphores to add thread_id, file name and line of current holder of mutex/rw_lock.
* | Merge branch '10.0' into bb-10.1-mergeSergei Golubchik2014-12-021-2/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .bzrignore VERSION cmake/plugin.cmake debian/dist/Debian/control debian/dist/Ubuntu/control mysql-test/r/join_outer.result mysql-test/r/join_outer_jcl6.result mysql-test/r/null.result mysql-test/r/old-mode.result mysql-test/r/union.result mysql-test/t/join_outer.test mysql-test/t/null.test mysql-test/t/old-mode.test mysql-test/t/union.test packaging/rpm-oel/mysql.spec.in scripts/mysql_config.sh sql/ha_ndbcluster.cc sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_cond.cc sql/item_cmpfunc.h sql/lock.cc sql/sql_select.cc sql/sql_show.cc sql/sql_update.cc sql/sql_yacc.yy storage/innobase/buf/buf0flu.cc storage/innobase/fil/fil0fil.cc storage/innobase/include/srv0srv.h storage/innobase/lock/lock0lock.cc storage/tokudb/CMakeLists.txt storage/xtradb/buf/buf0flu.cc storage/xtradb/fil/fil0fil.cc storage/xtradb/include/srv0srv.h storage/xtradb/lock/lock0lock.cc support-files/mysql.spec.sh
| * 5.5 mergemariadb-10.0.15Sergei Golubchik2014-11-211-0/+5
| |
| * 5.5 mergeSergei Golubchik2014-11-201-2/+0
| |
* | Merge 10.0.14 into 10.1Sergei Golubchik2014-10-151-15/+17
|\ \ | |/
| * InnoDB 5.6.20Sergei Golubchik2014-09-111-4/+4
| |
| * Automatic merge from 5.5Michael Widenius2014-08-191-1/+6
| | | | | | | | Fixed 2 failing tests by replacing result files
| * innodb-5.6.19Sergei Golubchik2014-08-061-6/+6
| |
| * MDEV-6483 - Deadlock around rw_lock_debug_mutex on PPC64Sergey Vojtovich2014-07-241-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This problem affects only debug builds on PPC64. There are at least two race conditions around rw_lock_debug_mutex_enter and rw_lock_debug_mutex_exit: - rw_lock_debug_waiters was loaded/stored without setting appropriate locks/memory barriers. - there is a gap between calls to os_event_reset() and os_event_wait() and in such case we're supposed to pass return value of the former to the latter. Fixed by replacing self-cooked spinlocks with system mutexes. These days system mutexes offer much better performance. OTOH performance is not that critical for debug builds.
* | MDEV-5834: Merge Kakao Defragmentation implementation to MariaDB 10.1Jan Lindström2014-08-061-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | Merge https://github.com/kakao/mariadb-10.0 that contains Facebook's implementation for defragmentation facebook/mysql-5.6@a2d3a74 facebook/mysql-5.6@def96c8 facebook/mysql-5.6@9c67c5d facebook/mysql-5.6@921a81b facebook/mysql-5.6@aa519bd facebook/mysql-5.6@fea7d13 facebook/mysql-5.6@09b29d3 facebook/mysql-5.6@9284abb facebook/mysql-5.6@dbd623d facebook/mysql-5.6@aed55dc facebook/mysql-5.6@aad5c82 This version does not add new SQL-syntax and new handler API function. Instead optimize table is mapped to defragment table if innodb_defragment=ON, by default the feature is off. Contains changes authored by Sunguck Lee (Kakao).
* MDEV-6184 10.0.11 mergeSergei Golubchik2014-05-061-0/+1
| | | | InnoDB 5.6.16
* InnoDB 5.6.15 merge.Sergei Golubchik2014-02-261-5/+4
| | | | update test results
* Temporary commit of 10.0-mergeMichael Widenius2013-03-261-99/+58
|
* fixes for test failuresSergei Golubchik2012-09-271-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and small collateral changes mysql-test/lib/My/Test.pm: somehow with "print" we get truncated writes sometimes mysql-test/suite/perfschema/r/digest_table_full.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/dml_handler.result: host table is not ported over yet mysql-test/suite/perfschema/r/information_schema.result: host table is not ported over yet mysql-test/suite/perfschema/r/nesting.result: this differs, because we don't rewrite general log queries, and multi-statement packets are logged as a one entry. this result file is identical to what mysql-5.6.5 produces with the --log-raw option. mysql-test/suite/perfschema/r/relaylog.result: MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB. mysql-test/suite/perfschema/r/server_init.result: MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup. mysql-test/suite/perfschema/r/stage_mdl_global.result: this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not do that, and this causes useless mutex locks and waits. mysql-test/suite/perfschema/r/statement_digest.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_consumers.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_long_query.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result: will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result: will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
* Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6Michael Widenius2012-08-011-0/+1651