- 26 Jan, 2018 5 commits
-
-
Sergey Vojtovich authored
Form better trx_sys API.
-
Sergey Vojtovich authored
When cloning oldest view, don't copy ReadView::m_creator_trx_id. It means that the owner thread is now allowed to access this member without trx_sys.mutex protection. To achieve this we have to keep ReadView::m_creator_trx_id in ReadView::m_ids. This is required to not let purge thread process records owned by transaction associated with oldest view. It is only required if trsanction entered read-write mode before it's view was created. If transaction entered read-write mode after it's view was created (trx_set_rw_mode()), purge thread won't be allowed to touch it because m_low_limit_id >= m_creator_trx_id holds. Thus we don't have to add this transaction id to ReadView::m_ids. Cleanups: ReadView::ids_t: don't seem to make any sense, just complicate matters. ReadView::copy_trx_ids(): doesn't make sense anymore, integrated into caller. ReadView::copy_complete(): not needed anymore. ReadView copy constructores: don't seem to make any sense. trx_purge_truncate_history(): removed view argument, access purge_sys->view directly instead.
-
Sergey Vojtovich authored
Moved lock_rec_lock_slow() inside lock_rec_lock().
-
Sergey Vojtovich authored
Moved mutex locking inside lock_rec_lock(). Moved monitor increment out of mutex. Moved assertions that don't require protection out of mutex. Removed duplicate assertions. Moved duplicate debug injections into lock_rec_lock(). Let monitor updates use relaxed memory order. Return directly without maintaining variables in lock_rec_lock_slow(). Moved lock_rec_lock_fast() body into lock_rec_lock(): saves at least one trx_mutex_enter(), one switch() plus some code was moved out of mutex.
-
Sergey Vojtovich authored
InnoDB RNG maintains global state, causing otherwise unnecessary bus traffic. Even worse this is cross-mutex traffic. That is different mutexes suffer from contention. Fixed delay of 4 was verified to give best throughput by OLTP update index and read-write benchmarks on Intel Broadwell (2/20/40) and ARM (1/46/46).
-
- 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 10 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.
-