- 25 Jan, 2018 2 commits
-
-
Marko Mäkelä authored
Traditionally, DROP TABLE and TRUNCATE TABLE discarded any locks that may have been held on the table. This feels like an ACID violation. Probably most occurrences of it were prevented by meta-data locks (MDL) which were introduced in MySQL 5.5. dict_table_t::n_foreign_key_checks_running: Reduce the number of non-debug checks. lock_remove_all_on_table(), lock_remove_all_on_table_for_trx(): Remove. ha_innobase::truncate(): Acquire an exclusive InnoDB table lock before proceeding. DROP TABLE and DISCARD/IMPORT were already doing this. row_truncate_table_for_mysql(): Convert the already started transaction into a dictionary operation, and do not invoke lock_remove_all_on_table(). row_mysql_table_id_reassign(): Do not call lock_remove_all_on_table(). This function is only used in ALTER TABLE...DISCARD/IMPORT TABLESPACE, which is already holding an exclusive InnoDB table lock. TODO: Make n_foreign_key_checks running a debug-only variable. This would require two fixes: (1) DROP TABLE: Exclusively lock the table beforehand, to prevent the possibility of concurrently running foreign key checks (which would acquire a table IS lock and then record S locks). (2) RENAME TABLE: Find out if n_foreign_key_checks_running>0 actually constitutes a potential problem.
-
Galina Shalygina authored
Wrong conversion
-
- 24 Jan, 2018 7 commits
-
-
Marko Mäkelä authored
ReadView::ReadView(): Define inline, and remove the memset(). ReadView::~ReadView(): Use the default destructor.
-
Sergey Vojtovich authored
-
Marko Mäkelä authored
-
Howard Su authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
While the bug was reported as a regression of MDEV-11025 Make number of page cleaner threads variable dynamic in MariaDB Server 10.3, the code that MariaDB Server 10.2 inherited from MySQL 5.7.4 (WL#6642) looks prone to similar errors. pc_flush_slot(): If there is no work to do, reset the is_requested signal, to avoid potential busy-waiting in buf_flush_page_cleaner_worker(). If the coordinator thread has shut down, avoid resetting the is_requested event, to avoid a potential hang at shutdown if there are multiple worker threads.
-
- 23 Jan, 2018 4 commits
-
-
Daniel Black authored
Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Vladislav Vaintroub authored
FULLTEXT auxiliary tables Change the logic to take mdl lock on all tables before tablespaces are copied, rather than lock every single tablespace just before it is copied.
-
- 22 Jan, 2018 9 commits
-
-
Marko Mäkelä authored
ibuf_merge_or_delete_for_page(): Invoke fil_space_acquire_silent() instead of fil_space_acquire() in order to avoid displaying a useless message. We know perfectly well that a tablespace can be dropped while a change buffer merge is pending, because change buffer merges skip any transactional locks.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
innobase_commit_by_xid(), innobase_rollback_by_xid(): Decrement the reference count before freeing the transaction object to the pool. Failure to do so might corrupt the transaction bookkeeping if trx_create_low() returns the same object to another thread before we are done with it. trx_sys_close(): Detach the recovered XA PREPARE transactions from trx_sys->rw_trx_list before freeing them.
-
Sergey Vojtovich authored
It was supposed to be called out of mutex, but nevertheless was called under trx_sys.mutex for normal threads adding one extra condtion in critical section.
-
Sergey Vojtovich authored
This will allow us to reduce critical section protected by trx_sys.mutex: - no need to maintain global m_free list - eliminate if (trx->read_view == NULL) condition. On x86_64 sizeof(Readview) is 144 mostly due to padding, sizeof(trx_t) with ReadView is 1200. Also don't close ReadView for read-write transactions, just mark it closed similarly to read-only. Clean-up: removed n_prepared_recovered_trx and n_prepared_trx, which accidentally re-appeared after some rebase.
-
Sergei Petrunia authored
join_tab->distinct=true means "Before doing record read with this join_tab, call join_tab->remove_duplicates() to eliminate duplicates". remove_duplicates() assumes that - there is a temporary table $T with rows that are to be de-duplicated - there is a previous join_tab (e.g. with join_tab->fields) which was used to populate the temp.table $T. When the query has "Impossible WHERE" and window function, then the above conditions are not met (but we still might need a window function computation step when the query has implicit grouping). The fix is to not add remove_duplicates step if the select execution is degenerate (and we'll have at most one row in the output anyway).
-
Marko Mäkelä authored
-
Marko Mäkelä authored
MDEV-14511 tried to avoid some consistency problems related to InnoDB persistent statistics. The persistent statistics are being written by an InnoDB internal SQL interpreter that requires the InnoDB data dictionary cache to be locked. Before MDEV-14511, the statistics were written during DDL in separate transactions, which could unnecessarily reduce performance (each commit would require a redo log flush) and break atomicity, because the statistics would be updated separately from the dictionary transaction. However, because it is unacceptable to hold the InnoDB data dictionary cache locked while suspending the execution for waiting for a transactional lock (in the mysql.innodb_index_stats or mysql.innodb_table_stats tables) to be released, any lock conflict was immediately be reported as "lock wait timeout". To fix MDEV-14941, an attempt to reduce these lock conflicts by acquiring transactional locks on the user tables in both the statistics and DDL operations was made, but it would still not entirely prevent lock conflicts on the mysql.innodb_index_stats and mysql.innodb_table_stats tables. Fixing the remaining problems would require a change that is too intrusive for a GA release series, such as MariaDB 10.2. Thefefore, we revert the change MDEV-14511. To silence the MDEV-13201 assertion, we use the pre-existing flag trx_t::internal.
-
- 21 Jan, 2018 3 commits
-
-
Monty authored
Conflicts: sql/sp_rcontext.cc
-
Monty authored
current_select may point to data from old parser states when calling a stored procedure with CALL The failure happens in Item::Item when testing if we are in having. Fixed by explicitely reseting current_select in do_execute_sp() and in sp_rcontext::create(). The later is also needed for stored functions().
-
Monty authored
-
- 20 Jan, 2018 15 commits
-
-
Sergey Vojtovich authored
trx->read_view|= 1 was done in a silly attempt to fix race condition where trx->read_view was closed without trx_sys.mutex lock by read-only trasnactions. This just made the problem less likely to happen. In fact there was race condition in const version of trx_get_read_view(): pointer may change to garbage any moment after MVCC::is_view_active(trx->read_view) check and before this function returns. This patch doesn't fix this race condition, but rather makes it's consequences less destructive.
-
Sergey Vojtovich authored
Simplified away MVCC::get_oldest_view() Simplified away MVCC::get_view() Removed unused MVCC::view_release()
-
Sergey Vojtovich authored
trx_erase_lists(): trx->read_view is owned by current thread and thus doesn't need trx_sys.mutex protection for reading it's value. Move trx->read_view check out of mutex trx_start_low(): moved assertion out of mutex. Call ReadView::creator_trx_id() directly: allows to inline this one-line method.
-
Sergey Vojtovich authored
These were unused status variables available in debug builds only. Also removed trx_sys.rw_max_trx_id: not used anymore.
-
Sergey Vojtovich authored
trx_sys.mvcc was allocated dynamically for no good reason.
-
Marko Mäkelä authored
There is only one transaction system object in InnoDB. Allocate the storage for it at link time, not at runtime. lock_rec_fetch_page(): Use the correct fetch mode BUF_GET. Pages may never be deallocated from a tablespace while record locks are pointing to them.
-
Sergey Vojtovich authored
Use atomic operations when accessing trx_sys_t::max_trx_id. We can't yet move trx_sys_t::get_new_trx_id() out of mutex because it must be updated atomically along with trx_sys_t::rw_trx_ids.
-
Sergey Vojtovich authored
Remove rw_trx_list.
-
Sergey Vojtovich authored
Let lock_print_info_all_transactions() iterate rw_trx_hash instead of rw_trx_list. When printing info of locks for transactions, InnoDB monitor doesn't attempt to read relevant page from disk anymore. The code was prone to race conditions. Note that TrxListIterator didn't work as advertised: it iterated rw_trx_list only.
-
Sergey Vojtovich authored
Let trx_rollback_recovered() iterate rw_trx_hash instead of rw_trx_list.
-
Sergey Vojtovich authored
Let lock_validate_table_locks(), lock_rec_other_trx_holds_expl(), lock_table_locks_lookup(), trx_recover_for_mysql(), trx_get_trx_by_xid(), trx_roll_must_shutdown(), fetch_data_into_cache() iterate rw_trx_hash instead of rw_trx_list.
-
Sergey Vojtovich authored
Removed trx_sys_validate_trx_list(): with rw_trx_hash elements are not required to be ordered by transaction id. Transaction state is now guarded by asserts in rw_trx_hash_t.
-
Sergey Vojtovich authored
Removed trx_sys_t::n_prepared_recovered_trx: never used. Removed trx_sys_t::n_prepared_trx: used only at shutdown, we can perfectly get this value from rw_trx_hash.
-
Sergey Vojtovich authored
Determine minimum transaction id by iterating rw_trx_hash, not rw_trx_list. It is more expensive than previous implementation since it does linear search, especially if there're many concurrent transactions running. But in such case mutex is much bigger evil. And since it doesn't require trx_sys->mutex protection it scales better. For low concurrency performance difference is neglible.
-
Sergey Vojtovich authored
Replaced UT_LIST_GET_LEN(trx_sys->rw_trx_list) with trx_sys->rw_trx_hash.size(). Moved freeing of trx objects at shutdown to rw_trx_hash destructor. Small clean-up in trx_rollback_recovered().
-