summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2019-09-061-8/+7
|\
| * MDEV-20378: Galera uses uninitialized memoryJan Lindström2019-08-201-8/+7
| | | | | | | | | | | | | | | | Problem was that wsrep thread argument was deleted on wrong place. Furthermore, scan method incorrectly used unsafe c_ptr(). Finally, fixed wsrep thread initialization to correctly set up thread_id and pass correct argument to functions and fix signess problem causing compiler errors.
* | Decrease stack space usage of mysql_execute_command()Sergei Golubchik2019-08-231-8/+8
|/ | | | | | - WSREP_DEBUG called WSREP_LOG which allocated a 1K variable on stack for each macro usage (at least gcc can't reuse the stack space). Move this concatenation to happen compile-time, not run-time.
* Merge 10.3 into 10.4Marko Mäkelä2019-08-141-0/+7
|\
| * 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.3 into 10.4Marko Mäkelä2019-07-251-3/+15
|\ \ \ | |/ /
| * | 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 branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\ \ \ | |/ /
| * | 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
| | | |
* | | | Fix cmake -DWITH_WSREP=OFFMarko Mäkelä2019-04-031-0/+1
| | | | | | | | | | | | | | | | | | | | Provide a dummy definition of WSREP_NNULL. This was broken in commit b896f60a73aea32843a0a86a35def669d82503af.
* | | | 10.4 wsrep group commit fixes (#1224)Teemu Ollakka2019-03-151-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MDEV-16509 Improve wsrep commit performance with binlog disabled Release commit order critical section early after trx_commit_low() if binlog is not transaction coordinator. In order to avoid two phase commit, binlog_hton is not registered for THD during IO_CACHE population. Implemented a test which verifies that the transactions release commit order early. This optimization will change behavior during recovery as the commit is not two phase when binlog is off. Fixed and recorded wsrep-recover-v25 and wsrep-recover to match the behavior. * MDEV-18730 Ordering for wsrep binlog group commit Previously out of order execution was allowed for wsrep commits. Established proper ordering by populating wait_for_commit for every wsrep THD and making group commit leader to wait for prior commits before proceeding to trx_group_commit_leader(). * MDEV-18730 Added a test case to verify correct commit ordering * MDEV-16509, MDEV-18730 Review fixes Use WSREP_EMULATE_BINLOG() macro to decide if the binlog_hton should be registered. Whitespace/syntax fixes and cleanups. * MDEV-16509 Require binlog for galera_var_innodb_disallow_writes test If the commit to InnoDB is done in one phase, the native InnoDB behavior is that the transaction is committed in memory before it is persisted to disk. This means that the innodb_disallow_writes=ON may not prevent transaction to become visible to other readers before commit is completely over. On the other hand, if the commit is two phase (as it is with binlog), the transaction will be blocked in prepare phase. Fixed the test to use binlog, which enforces two phase commit, which in turn makes commit to block before the changes become visible to other connections. This guarantees that the test produces expected result.
* | | | Less abort_loop referencesSergey Vojtovich2019-03-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed redundant initialisation in unireg_init(): already done by mysql_init_variables(). Slave threads already check THD::killed, which eliminates the need to check abort_loop. Removed unused wsrep_kill_mysql().
* | | | LOCK_thread_count and COND_thread_count removed from wsrep modules (#1197)seppo2019-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored wsrep patch to not use LOCK_thread_count and COND_thread_count anymore. This has partially been replaced by using old LOCK_wsrep_slave_threads mutex. For slave thread count change waiting, new COND_wsrep_slave_threads signal has been added Added LOCK_wsrep_cluster_config mutex to control that cluster address change cannot happen in parallel Protected wsrep_slave_threads variable changes with LOCK_cluster_config mutex This is for avoiding concurrent slave thread count and cluster joining operations to happen Fixes according to Teemu's review
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-02-211-0/+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 pull request #1185 from codership/10.4-wsrep_schema_cleanupJan Lindström2019-02-141-2/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | Cleanup wsrep_schema and remove all references to wsrep_thd_pool
| * | | | | | Cleanup wsrep_schema and remove all references to wsrep_thd_poolDaniele Sciascia2019-02-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed all references related to wsrep_thd_pool (which was removed) * Removed unused declarations in wsrep_schema.h * The following would result invalid reads in Wsrep_schema::replay_transaction(): ``` frag_table->field[4]->val_str(&buf); Wsrep_schema_impl::end_index_scan(frag_table); Wsrep_schema_impl::finish_stmt(thd); ret= wsrep_apply_events(thd, rli, buf.c_ptr_safe(), buf.length()); ``` because `buf` was accessed after closing the table. The fix is to perform storage reads using a different THD. * In Wsrep_schema::recover_sr_transactions(), cluster_table was opened for write, however it is only read here. And frag_table was opened for read, wereas write is potentially needed. Also, avoid copy caused by String::c_ptr() to zero terminate the c string, use c_ptr_quick instead.
* | | | | | | WSREP debug log levels supportmkaruza2019-02-131-2/+2
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Global variable wsrep_debug now can be used to filter wsrep-lib messages based on debug level provided. Type of wsrep_debug is now set to be unsigned int, so tests and configuration files changed accordingly.
* | | | | | Implement wsrep_load_data_splitting with streaming replicationTeemu Ollakka2019-02-121-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If wsrep_load_data_splitting is configured, change streaming replication parameters internally to match the original behavior, i.e. replicate on every 10000 rows. After load data is over, restore original streaming replication settings. Removed redundant wsrep_tc_log_commit().
* | | | | | Galera4Brave Galera Crew2019-01-231-131/+263
|/ / / / /
* | | | | 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
| | | |\ \ | | | | |/