- 10 Oct, 2022 1 commit
-
-
Vladislav Vaintroub authored
Avoid relatively expensive THD::store_globals() for every query in the threadpool. Use a lighter version instead, that only resets some thread local storage variables(THD, mysys, PSI), avoids some calculationms and caches syscall gettid (Linux only) in a thread_local variable. Also simplify Worker_context use, with RAII.
-
- 07 Oct, 2022 1 commit
-
-
Sergei Golubchik authored
after 6b685ea7 one can no longer violate the locking protocol by invoking thd_get_ha_data() on some other thread without protecting that with a mutex
-
- 06 Oct, 2022 16 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
row_purge_step(): Process all available purge_node_t::undo_recs. row_purge_end(): Replaced with purge_node_t::end(). TODO: Do we need a "query graph node" at all for purge?
-
Marko Mäkelä authored
purge_sys_t::low_limit_no(): Adjust a comment. Actually, this is protected after all. TrxUndoRsegsIterator::set_next(): Reduce the critical section of purge_sys.rseg->latch. Some purge_sys fields are accessed only by the purge coordinator task.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
ReadViewBase::snapshot(): In case m_low_limit_no==m_low_limit_id and m_ids would include everything between that and m_up_limit_id, set all fields to m_up_limit_id and clear m_ids, to speed up changes_visible() and append(). rw_trx_hash_t::debug_iterator(): Add an assertion.
-
Marko Mäkelä authored
btr_page_reorganize_low(): Do not invoke lock_move_reorganize_page() on a dummy index during change buffer merge. The ibuf.index page latch that we are holding may block a DDL operation that is waiting in ibuf_delete_for_discarded_space() while holding exclusive lock_sys.latch. ibuf_insert_low() would refuse to buffer a change if any locks exist for the index page.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
This test is not slow, but it reliably produces an EXPLAIN difference (number of rows) on the Valgrind builder. A possible explanation could be that the purge threads are not being scheduled. Valgrind runs all threads in a single thread.
-
- 05 Oct, 2022 12 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Sergei Golubchik authored
-
Marko Mäkelä authored
This fixes up commit 900d7bf3
-
Vlad Lesin authored
MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page, violating read view isolation btr_search_guess_on_hash() would only acquire an index page latch if it is invoked with ahi_latch=NULL. If it's invoked from row_sel_try_search_shortcut_for_mysql() with ahi_latch!=NULL, a page will not be latched, and row_search_mvcc() will get a pointer to the record, which can be changed by some other transaction before the record was stored in result buffer with row_sel_store_mysql_rec() call. ahi_latch argument of btr_cur_search_to_nth_level_func() and btr_pcur_open_with_no_init_func() is used only for row_sel_try_search_shortcut_for_mysql(). btr_cur_search_to_nth_level_func(..., ahi_latch !=0, ...) is invoked only from btr_pcur_open_with_no_init_func(..., ahi_latch !=0, ...), which, in turns, is invoked only from row_sel_try_search_shortcut_for_mysql(). I suppose that separate case with ahi_latch!=0 was intentionally implemented to protect row_sel_store_mysql_rec() call in row_search_mvcc() just after row_sel_try_search_shortcut_for_mysql() call. After the ahi_latch was moved from row_seach_mvcc() to row_sel_try_search_shortcut_for_mysql(), there is no need in it at all if btr_search_guess_on_hash() latches a page unconditionally. And if btr_search_guess_on_hash() latched the page, any access to the record in row_sel_try_search_shortcut_for_mysql() after btr_pcur_open_with_no_init() call will be protected with the page latch. The fix is to remove ahi_latch argument from btr_pcur_open_with_no_init_func(), btr_cur_search_to_nth_level_func() and btr_search_guess_on_hash(). There will not be test, as to test it we need to freeze some SELECT execution in the point between row_sel_try_search_shortcut_for_mysql() and row_sel_store_mysql_rec() calls in row_search_mvcc(), and to change the record in some other transaction to let row_sel_store_mysql_rec() to store changed record in result buffer. Buf we can't do this with the fix, as the page will be latched in btr_search_guess_on_hash() call.
-
Marko Mäkelä authored
Let us disable Valgrind on tests that would fail because a server shutdown or a STOP SLAVE command would take longer, causing the test harness to forcibly and silently kill the server due to an exceeded timeout.
-
Marko Mäkelä authored
Under Valgrind, this test may occasionally fail because the sleep-based timeouts of less than 1 second could be exceeded.
-
Marko Mäkelä authored
The test could emit some I/O error when run under Valgrind.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
dict_load_foreigns(): Remove the constant parameter uncommitted=false. The parameter only had to be added to dict_load_foreign(). Spotted by Alexey Midenkov
-
Marko Mäkelä authored
This fixes up commit 77c184df which explicitly specifies that we use ISO/IEC 9899:1999 (C99), which includes the snprintf() function.
-
Marko Mäkelä authored
row_purge_get_partial(): Replaces trx_undo_rec_get_partial_row(). Also copy the purge_node_t::ref to the purge_node_t::row. In this way, the clustered index key fields will always be available, even if thanks to commit d384ead0 (MDEV-14799) they would no longer be repeated in the remaining part of the undo log record.
-
- 04 Oct, 2022 3 commits
-
-
Nayuta Yanagisawa authored
MDEV-29484 Assertion `!trx_free || !trx->locked_connections' failed in spider_free_trx_conn on LOCK TABLES In MDEV-28352, we've modified spider_free_trx_conn() so that it frees a connection only when the connection is locking no remote table. However, when a user connection to a Spider node is disconnected, the corresponding connections to remote data nodes from the Spider node must be freed immediately. Thus, the modification above leads an assertion error on the debug build and a hang on the non-debug build. We partly revert MDEV-28352 to fix the problem.
-
Julius Goryavsky authored
This commit adds automation that will reduce the possibility of user errors when customizing wsrep_notify.sh (in particular caused by user-specified parameters). Now all leading and trailing spaces are removed from the user-specified parameters and automatic port and host address substitution has been added to scripts, as well as automatic password substitution to the client command line, only if it is specified in the wsrep_notify.sh and not as empty strings. Also added support for automatic substitution of the all SSL-related parameters and improved parsing for ipv6 addresses (to allow "[...]" notation for ipv6 addresses). Also added a test to check if the wsrep notify script will works with SSL.
-
Monty authored
One can run these with --valgrind --big
-
- 03 Oct, 2022 3 commits
-
-
Oleksandr Byelkin authored
-
Rucha Deodhar authored
Underlying causes of all bugs mentioned below are same. This patch fixes all of them: 1) MDEV-25028: ASAN use-after-poison in base_list_iterator::next or Assertion `sl->join == 0' upon INSERT .. RETURNING via PS 2) MDEV-25187: Assertion `inited == NONE || table->open_by_handler' failed or Direct leak in init_dynamic_array2 upon INSERT .. RETURNING and memory leak in init_dynamic_array2 3) MDEV-28740: crash in INSERT RETURNING subquery in prepared statements 4) MDEV-27165: crash in base_list_iterator::next 5) MDEV-29686: Assertion `slave == 0' failed in st_select_lex_node::attach_single Analysis: consider this statement: INSERT(1)...SELECT(2)...(SELECT(3)...) RETURNING (SELECT(4)...) When RETURNING is encountered, add_slave() changes how selects are linked. It makes the builtin_select(1) slave of SELECT(2). This causes losing of already existing slave(3) (which is nested select of SELECT of INSERT...SELECT). When really, builtin_select (1) shouldn't be slave to SELECT(2) because it is not nested within it. Also, push_select() to use correct context also changed how select are linked. During reinit_stmt_before_use(), we expect the selects to be cleaned-up and have join=0. Since these selects are not linked correctly, clean-up doesn't happen correctly so join is not NULL. Hence the crash. Fix: IF we are parsing RETURNING, make is_parsing_returning= true for current select. get rid of add_slave(). In place of push_select(), used push_context() to have correct context (the context of builtin_select) to resolve items in item_list. And add these items to item_list of builtin_select.
-
Vlad Lesin authored
MDEV-29575 Access to innodb_trx, innodb_locks and innodb_lock_waits along with detached XA's can cause SIGSEGV trx->mysql_thd can be zeroed-out between thd_get_thread_id() and thd_query_safe() calls in fill_trx_row(). trx_disconnect_prepared() zeroes out trx->mysql_thd. And this can cause null pointer dereferencing in fill_trx_row(). fill_trx_row() is invoked from fetch_data_into_cache() under trx_sys.mutex. Bug fix is in reseting trx_t::mysql_thd in trx_disconnect_prepared() under trx_sys.mutex lock too. MTR test case can't be created for the fix, as we need to wait for trx_t::mysql_thd reseting in fill_trx_row() after trx_t::mysql_thd was checked for null while trx_sys.mutex is held. But trx_t::mysql_thd must be reset in trx_disconnect_prepared() under trx_sys.mutex. There will be deadlock.
-
- 02 Oct, 2022 2 commits
-
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
- 01 Oct, 2022 2 commits
-
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-