summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.2 to 10.3Marko Mäkelä2019-08-131-0/+7
|\
| * MDEV-20324: Galera threads are not registered to performance schemaJan Lindström2019-08-131-0/+7
| | | | | | | | | | | | | | | | | | Galera threads were not registered to performance schema and used pthread_create when mysql_thread_create should have been used. Added test case to verify current galera performance schema instrumentation does work.
* | Merge 10.2 into 10.3Eugene Kosov2019-07-161-0/+17
|\ \ | |/
| * MDEV-19746: Galera test failures because of wsrep_slave_threads identificationJan Lindström2019-07-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that tests select INFORMATION_SCHEMA.PROCESSLIST processes from user system user and empty state. Thus, there is not clear state for slave threads. Changes: - Added new status variables that store current amount of applier threads (wsrep_applier_thread_count) and rollbacker threads (wsrep_rollbacker_thread_count). This will make clear how many slave threads of certain type there is. - Added THD state "wsrep applier idle" when applier slave thread is waiting for work. This makes finding slave/applier threads easier. - Added force-restart option for mtr to always restart servers between tests to avoid race on start of the test - Added wait_condition_with_debug to wait until the passed statement returns true, or the operation times out. If operation times out, the additional error statement will be executed Changes to be committed: new file: mysql-test/include/force_restart.inc new file: mysql-test/include/wait_condition_with_debug.inc modified: mysql-test/mysql-test-run.pl modified: mysql-test/suite/galera/disabled.def modified: mysql-test/suite/galera/r/MW-336.result modified: mysql-test/suite/galera/r/galera_kill_applier.result modified: mysql-test/suite/galera/r/galera_var_slave_threads.result new file: mysql-test/suite/galera/t/MW-336.cnf modified: mysql-test/suite/galera/t/MW-336.test modified: mysql-test/suite/galera/t/galera_kill_applier.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test modified: mysql-test/suite/galera/t/galera_var_slave_threads.test modified: mysql-test/suite/wsrep/disabled.def modified: mysql-test/suite/wsrep/r/variables.result modified: mysql-test/suite/wsrep/t/variables.test modified: sql/mysqld.cc modified: sql/wsrep_mysqld.cc modified: sql/wsrep_mysqld.h modified: sql/wsrep_thd.cc modified: sql/wsrep_var.cc
* | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
|\ \ | |/
| * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| |\
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |
* | | dirty mergeOleksandr Byelkin2019-02-071-0/+1
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2019-02-021-0/+1
| |\ \ | | |/
| | * Merge branch '10.0-galera' into 10.1Oleksandr Byelkin2019-01-311-0/+1
| | |\
| | | * Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galeraJan Lindström2018-10-301-1/+1
| | | |\
| | | | * Add a new config variable wsrep_certification_rulesVasil Dimov2018-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used for controlling whether to use a new/optimized certification rules or the old/classic ones that could cause more certification failures - when foreign keys are used and two INSERTs are done concurrently to the child table from different nodes. (cherry picked from commit 815d73e6af8daace6262ab63ca6c043ffc4204b3)
| | * | | MDEV-17801: Galera test failure on galera_var_reject_queriesJan Lindström2018-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that controlling connection i.e. connection that executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL; was also killed but server would try to send result from that query to controlling connection resulting a assertion mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed. as socket was closed when controlling connection was closed. wsrep_close_client_connections() Do not close controlling connection and instead of wsrep_close_thread() we do now soft kill by THD::awake wsrep_reject_queries_update() Call wsrep_close_client_connections using current thd.
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-11-261-2/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | The test galera_sst_mariabackup_table_options was disabled, because the server refuses to start up due to wrong parameters.
| * | | | MDEV-17801: Galera test failure on galera_var_reject_queriesJan Lindström2018-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that controlling connection i.e. connection that executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL; was also killed but server would try to send result from that query to controlling connection resulting a assertion mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed. as socket was closed when controlling connection was closed. wsrep_close_client_connections() Do not close controlling connection and instead of wsrep_close_thread() we do now soft kill by THD::awake wsrep_reject_queries_update() Call wsrep_close_client_connections using current thd.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-2/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-2/+3
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0-galera' into 10.1Sergei Golubchik2018-09-071-1/+3
| | |\ \ \ | | | |/ /
| | | * | Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galeraJan Lindström2018-08-021-1/+3
| | | |\ \ | | | | |/
| | | | * Fix FK constraint violation in applier, after ALTER TABLE ADD FKDaniele Sciascia2018-08-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a FK constraint to an existing table (ALTER TABLE ADD FOREIGN KEY) causes the applier to fail, if a concurrent DML statement that violate the new constraint (i.e. a DELETE or UPDATE of record in the parent table). For exmaple, the following scenario causes a crash in the applier: 1. ALTER successfully adds FK constraint in node_1 2. On node_2 is UPDATE is in pre_commit() and has certified successfully 3. ALTER is delivered in node_2 and BF aborts DML 4. Applying UPDATE event causes FK violation in node_1 To avoid this situation it is necessary for UPDATE to fail during certification. And for the UPDATE to fail certfication it is necessary that ALTER appends certification keys for both the child and the parent table. Before this patch, ALTER TABLE ADD FK only appended keys for child table which is ALTERed.
| | | * | MDEV-16799: Test wsrep.variables crash at sql_class.cc:639 thd_get_ha_dataJan Lindström2018-07-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Problem was that binlog_hton was not initialized fully when needed i.e. when wsrep_on = true.
| | * | | fix failures of innodb_plugin tests in --embeddedSergei Golubchik2018-09-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-fix for 7e8ed15b95b Also, apply the same innodb fix to xtradb.
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-09-061-4/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-311-4/+1
| |\ \ \ \ | | |/ / /
| | * | | Revert MDEV-9519 due to regressionsMarko Mäkelä2018-08-311-4/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 75dfd4acb995789ca5f86ccbd361fff9d2797e79.
| | * | | Merge pull request #828 from tempesta-tech/sysprg/10.1-MDEV-10754Jan Lindström2018-08-211-0/+1
| | |\ \ \ | | | | | | | | | | | | MDEV-10754 wsrep_sst_rsync does not support innodb_data_home_dir
| | | * | | Fixes after review and correction of the problems caused by the fact that ↵Julius Goryavsky2018-08-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | during the SST innodb plugin is not yet initialized, as well as problems with running tests from the root user (not directly related to the MDEV-10754).
* | | | | | Merge 10.2 into 10.3Marko Mäkelä2018-08-281-0/+4
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-211-0/+4
| |\ \ \ \ \ | | |/ / / /
| | * | | | This is patch for the https://jira.mariadb.org/browse/MDEV-9519 issue:Julius Goryavsky2018-08-151-0/+4
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a 2+ node cluster which is replicating from an async master and the binlog_format is set to STATEMENT and multi-row inserts are executed on a table with an auto_increment column such that values are automatically generated by MySQL, then the server node generates wrong auto_increment values, which are different from what was generated on the async master. The causes and fixes: 1. We need to improve processing of changing the auto-increment values after changing the cluster size. 2. If wsrep auto_increment_control switched on during operation of the node, then we should immediately update the auto_increment_increment and auto_increment_offset global variables, without waiting of the next invocation of the wsrep_view_handler_cb() callback. In the current version these variables retain its initial values if wsrep_auto_increment_control is switched on during operation of the node, which leads to inconsistent results on the different nodes in some scenarios. 3. If wsrep auto_increment_control switched off during operation of the node, then we must return the original values of the auto_increment_increment and auto_increment_offset global variables, as the user has set. To make this possible, we need to add a "shadow copies" of these variables (which stores the latest values set by the user).
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-1/+13
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-1/+13
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0-galera' into 10.1Vicențiu Ciorbaru2018-06-121-1/+13
| | |\ \ \ | | | |/ /
| | | * | Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galeraJan Lindström2018-05-071-0/+13
| | | |\ \ | | | | |/
| | | | * MW-384 protect access to wsrep_ready variable with mutexAlexey Yurchenko2017-10-191-1/+2
| | | | |
| | | | * MW-86 Add separate wsrep_sync_wait bitmask value for SHOW commandsDaniele Sciascia2017-07-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, setting `wsrep_sync_wait = 1` would have an effect on both SELECT and SHOW statements. This patch changes wsrep_sync_wait so that bitmask value 1 is used for SELECT statements, while bitmask value 8 is reserved for SHOW statements. It is still possible to achieve sync wait on both SELECT and SHOW statements by setting `wsrep_sync_wait = 9`. Signed-off-by: Jan Lindström <jan.lindstrom@mariadb.com>
| | | | * MW-322 - CTAS fix merged to 5.5-v25 branchsjaakola2017-07-201-0/+11
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jan Lindström <jan.lindstrom@mariadb.com>
| | | | * MW-267Sachin Setiya2017-04-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Galera crash at startup when compiled with gcc 6 Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
| | | | * MDEV-11479 Improved wsrep_dirty_readsSachin Setiya2016-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tasks:- Changes in wsrep_dirty_reads variable 1.) Global + Session scope (Current: session-only) 2.) Can be set using command line. 3.) Allow all commands that do not change data (besides SELECT) 4.) Allow prepared Statements that do not change data 5.) Works with wsrep_sync_wait enabled
| | | | * refs codership/mysql-wsrep#226 Limit binlog recovery to found wsrep positionTeemu Ollakka2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit binlog recovery so that the wsrep position found from storage engines is not exceeded. This is required to have consistent position between wsrep position stored in innodb header and recoverd binlog.
| | | | * refs codership/mysql-wsrep#201Daniele Sciascia2016-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fixes query cache so that it is aware of wsrep_sync_wait. Query cache would return (possibly stale) results to the client, regardless of the value of wsrep_sync_wait. - Includes the test case that reproduced the issue.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-05-111-2/+0
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-101-2/+0
| |\ \ \ \ | | |/ / /
| | * | | MDEV-16005 sporadic failures with galera tests MW-328B and MW-328Csjaakola2018-04-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These test can sporadically show mutex deadlock warnings between LOCK_wsrep_thd and LOCK_thd_data mutexes. This means that these mutexes can be locked in opposite order by different threads, and thus result in deadlock situation. To fix such issue, the locking policy of these mutexes should be revised and enforced to be uniform. However, a quick code review shows that the number of lock/unlock operations for these mutexes combined is between 100-200, and all these mutex invocations should be checked/fixed. On the other hand, it turns out that LOCK_wsrep_thd is used for protecting access to wsrep variables of THD (wsrep_conflict_state, wsrep_query_state), whereas LOCK_thd_data protects query, db and mysys_var variables in THD. Extending LOCK_thd_data to protect also wsrep variables looks like a viable solution, as there should not be a use case where separate threads need simultaneous access to wsrep variables and THD data variables. In this commit LOCK_wsrep_thd mutex is refactored to be replaced by LOCK_thd_data. By bluntly replacing LOCK_wsrep_thd by LOCK_thd_data, will result in double locking of LOCK_thd_data, and some adjustements have been performed to fix such situations.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-03-281-0/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2018-03-211-0/+7
| |\ \ \ \ | | |/ / /
| | * | | refs MW-245 - merged wsrep_dirty_reads and wsrep_reject_queries from PXCsjaakola2018-03-201-0/+7
| | | | |
* | | | | MDEV-15505 Fixes to compilation without -DWITH_WSREP:BOOL=ONTeemu Ollakka2018-03-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed including wsrep_api.h from service_wsrep.h. This caused various kinds of collisions with definitions when wsrep is not supposed to be built in. Defined functions wsrep_xid_seqno() and wsrep_xid_uuid() in wsrep_dummy.cc. Replaced wsrep_seqno_t with long long where wsrep_api.h is not included. Removed wsrep_xid_seqno() macro from wsrep_mysqld.h and made wsrep code using wsrep_xid_seqno() in handler.cc to be compiled in only if WITH_WSREP is ON. Included wsrep_api.h for mariabackup if WITH_WSREP is ON.
* | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-181-0/+5
|\ \ \ \ \