- 24 Jan, 2018 5 commits
-
-
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 16 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().
-
Sergey Vojtovich authored
Reduce divergence between trx_sys_t::rw_trx_hash and trx_sys_t::rw_trx_list by not adding recovered COMMITTED transactions to trx_sys_t::rw_trx_list. Such transactions are discarded immediately without creating trx object. This also required to split rollback and cleanup phases of recovery. To reflect these updates the following renames happened: trx_rollback_or_clean_all_recovered() -> trx_rollback_all_recovered() trx_rollback_or_clean_is_active -> trx_rollback_is_active trx_rollback_or_clean_recovered() -> trx_rollback_recovered() trx_cleanup_at_db_startup() -> trx_cleanup_recovered() Also removed a hack from lock_trx_release_locks(). Instead let recovery rollback thread to skip committed XA transactions.
-
- 19 Jan, 2018 1 commit
-
-
Igor Babaev authored
when number of NULLs in IN list reaches in_predicate_conversion_threshold The bug was fixed by removing an assertion that had been set in order just to test whether the code could be ever executed.
-
- 18 Jan, 2018 2 commits
-
-
Igor Babaev authored
caused an error The function subselect_single_select_engine::print() did not print the WITH clause attached to a subselect with single select engine. As a result views using suqueries with attached WITH clauses lost these clauses when saved in frm files.
-
Daniel Bartholomew authored
-