summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.6 into 10.7Marko Mäkelä2022-12-071-1/+8
|\
| * Merge 10.5 into 10.6Marko Mäkelä2022-12-051-1/+8
| |\
| | * Merge 10.4 into 10.5Jan Lindström2022-11-301-1/+8
| | |
* | | Merge 10.6 into 10.7Marko Mäkelä2022-10-131-5/+15
|\ \ \ | |/ /
| * | Merge 10.5 into 10.6Marko Mäkelä2022-10-121-5/+15
| |\ \ | | |/
| | * Merge 10.4 into 10.5Marko Mäkelä2022-10-121-5/+15
| | |\
| | | * MDEV-29707 : Incorrect/bad errno on enabling wsrep_on after setting dummy ↵Jan Lindström2022-10-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wsrep_provider on non-Galera build Fix error message to contain correct errno. This commit was tested interactively because mtr will notice if you provide wrong wsrep_provider in config and you may not change wsrep_provider dynamically.
| | | * MDEV-25389 : Assertion `!is_thread_specific || (mysqld_server_initialized && ↵Jan Lindström2022-10-091-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | thd)' failed in void my_malloc_size_cb_func(long long int, my_bool) If wsrep slave thread creation fails for some reason we need to handle this error correctly and set actual running slave threads accordingly.
* | | | Merge 10.6 into 10.7Jan Lindström2022-09-051-0/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.5 into 10.6Jan Lindström2022-09-051-0/+1
| |\ \ \ | | |/ /
| | * | Merge 10.4 into 10.5Jan Lindström2022-09-051-0/+1
| | |\ \ | | | |/
| | | * Reduce compilation dependencies on wsrep_mysqld.hDaniele Sciascia2022-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making changes to wsrep_mysqld.h causes large parts of server code to be recompiled. The reason is that wsrep_mysqld.h is included by sql_class.h, even tough very little of wsrep_mysqld.h is needed in sql_class.h. This commit introduces a new header file, wsrep_on.h, which is meant to be included from sql_class.h, and contains only macros and variable declarations used to determine whether wsrep is enabled. Also, header wsrep.h should only contain definitions that are also used outside of sql/. Therefore, move WSREP_TO_ISOLATION* and WSREP_SYNC_WAIT macros to wsrep_mysqld.h. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | MDEV-26352 : Add new thread states for certain WSREP scenariosJan Lindström2021-09-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds following new thread states: * waiting to execute in isolation - DDL is waiting to execute in TOI mode. * waiting for TOI DDL - some other statement is waiting for DDL to complete. * waiting for flow control - some statement is paused while flow control is in effect. * waiting for certification - the transaction is being certified.
* | | | Merge 10.6 into 10.7Marko Mäkelä2021-08-261-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.5 into 10.6Marko Mäkelä2021-08-261-2/+2
| |\ \ \ | | |/ /
| | * | Merge 10.4 into 10.5Marko Mäkelä2021-08-261-2/+2
| | |\ \ | | | |/
| | | * After-merge fix f84e28c119b495da77e197f7cd18af4048fc3126Marko Mäkelä2021-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a rebase of the merge, two preceding commits were accidentally reverted: commit 112b23969a30ba6441efa5e22a3017435febfa17 (MDEV-26308) commit ac2857a5fbf851d90171ac55f23385869ee6ba83 (MDEV-25717) Thanks to Daniele Sciascia for noticing this.
| | | * Merge 10.3 into 10.4Marko Mäkelä2021-08-181-2/+2
| | | |\
| | | * | MDEV-26308 : Galera test failure on galera.galera_split_brainLeandro Pacheco2021-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains following fixes: * allow TOI commands to timeout while trying to acquire TOI with override lock_wait_timeout with a LONG_TIMEOUT only after succesfully entering TOI * only ignore lock_wait_timeout on TOI * fix galera_split_brain test as TOI operation now returns ER_LOCK_WAIT_TIMEOUT after lock_wait_timeout * explicitly test for TOI Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | | MDEV-24947 : Remove parameter wsrep_replicate_myisamJan Lindström2021-08-071-10/+0
| | | | |
* | | | | MDEV-24843 : Remove parameter wsrep_strict_ddlJan Lindström2021-08-071-12/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to be committed: modified: mysql-test/include/galera_variables_ok.inc modified: mysql-test/include/galera_variables_ok_debug.inc modified: mysql-test/suite/galera/r/galera_defaults.result deleted: mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result modified: mysql-test/suite/galera/t/galera_defaults.test deleted: mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test modified: mysql-test/suite/sys_vars/r/sysvars_wsrep.result modified: mysql-test/suite/wsrep/r/variables.result modified: mysql-test/suite/wsrep/r/variables_debug.result modified: sql/sys_vars.cc modified: sql/wsrep_mysqld.cc modified: sql/wsrep_mysqld.h modified: sql/wsrep_var.cc modified: sql/wsrep_var.h
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-211-4/+55
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2021-04-211-9/+59
| |\ \ \ | | |/ /
| | * | More fixes to variable wsrep_onDaniele Sciascia2021-04-201-9/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disallow setting wsrep_on = 1 if wsrep_provider is unset. Also, move wsrep_on_basic from sys_vars to wsrep suite: this test now requires to run with wsrep_provider set * Disallow setting @@session.wsrep_on = 1 when @@global.wsrep_on = 0 * Handle the case where a new connection turns @@global.wsrep_on from off to on. In this case we would miss a call to wsrep_open, causing unexpected states in wsrep::client_state (causing assertions). * Disable wsrep.MDEV-22443 because it is no longer possible to enable wsrep_on, if server is started with wsrep_provider='none' Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-081-4/+14
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2021-04-081-3/+11
| |\ \ \ | | |/ /
| | * | MDEV-25226 Assertion when wsrep_on set OFF with SR transactionDaniele Sciascia2021-04-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the following changes around variable wsrep_on: 1) Variable wsrep_on can no longer be updated from a session that has an active transaction running. The original behavior allowed cases like this: BEGIN; INSERT INTO t1 VALUES (1); SET SESSION wsrep_on = OFF; INSERT INTO t1 VALUES (2); COMMIT; With regular transactions this would result in no replication events (not even value 1). With streaming replication it would be unnecessarily complex to achieve the same behavior. In the above example, it would be possible for value 1 to be already replicated if it happened to fill a separate fragment, while value 2 wouldn't. 2) Global variable wsrep_on no longer affects current sessions, only subsequent ones. This is to avoid a similar case to the above, just using just by using global wsrep_on instead session wsrep_on: --connection conn_1 BEGIN; INSERT INTO t1 VALUES(1); --connection conn_2 SET GLOBAL wsrep_on = OFF; --connection conn_1 INSERT INTO t1 VALUES(2); COMMIT; The above example results in the transaction to be replicated, as global wsrep_on will only affect the session wsrep_on of new connections. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | MDEV-20715 : Implement system variable to disallow local GTIDs in Galerabb-10.6-MDEV-20715Jan Lindström2021-03-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new wsrep_mode feature DISALLOW_LOCAL_GTID for this. Nodes can have GTIDs for local transactions in the following scenarios: A DDL statement is executed with wsrep_OSU_method=RSU set. A DML statement writes to a non-InnoDB table. A DML statement writes to an InnoDB table with wsrep_on=OFF set. If user has set wsrep_mode=DISALLOW_LOCAL_GTID these operations produce a error ERROR HY000: Galera replication not supported
* | | | MENT-411 : Implement wsrep_replicate_ariaJan Lindström2021-02-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced two new wsrep_mode options * REPLICATE_MYISAM * REPLICATE_ARIA Depracated wsrep_replicate_myisam parameter and we use wsrep_mode = REPLICATE_MYISAM instead. This required small refactoring of wsrep_check_mode_after_open_table so that both MyISAM and Aria are handled on required DML cases. Similarly, added Aria to wsrep_should_replicate_ddl to handle DDL for Aria tables using TOI. Added test cases and improved MyISAM testing. Changed use of wsrep_replicate_myisam to wsrep_mode = REPLICATE_MYISAM
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-02-241-7/+13
|\ \ \ \ | |/ / /
| * | | Merge branch '10.4' into 10.5Sergei Golubchik2021-02-231-7/+13
| |\ \ \ | | |/ /
| | * | Merge branch 'bb-10.4-release' into 10.4Sergei Golubchik2021-02-231-11/+17
| | |\ \
| | * | | MDEV-24856 : Server crashes when wsrep_provider_options set to NULLJan Lindström2021-02-131-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Null pointer reference to wsrep_provider_options variable. Fixed by adding condition and error handling.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-02-171-11/+17
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch 'bb-10.4-release' into bb-10.5-releaseSergei Golubchik2021-02-151-11/+17
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | updating @@wsrep_cluster_address deadlocksSergei Golubchik2021-02-141-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wsrep_cluster_address_update() causes LOCK_wsrep_slave_threads to be locked under LOCK_wsrep_cluster_config, while normally the order should be the opposite. Fix: don't protect @@wsrep_cluster_address value with the LOCK_wsrep_cluster_config, LOCK_global_system_variables is enough. Only protect wsrep reinitialization with the LOCK_wsrep_cluster_config. And make it use a local copy of the global @@wsrep_cluster_address. Also, introduce a helper function that checks whether wsrep_cluster_address is set and also asserts that it can be safely read by the caller.
| | * | | fix a 3-way deadlock in galera_sr.galera-features#56Sergei Golubchik2021-02-121-0/+4
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rarely (try --repeat 1000), the following happens: * from wsrep_bf_abort (when a thread is being killed), wsrep-lib starts streaming_rollback that wants to convert_streaming_client_to_applier. wsrep_create_streaming_applier creates a new THD(). All while the other THD is being killed, so under LOCK_thd_kill and LOCK_thd_data. In particular, THD::init() takes LOCK_global_system_variables under LOCK_thd_kill. * updating @@wsrep_slave_threads takes LOCK_global_system_variables and LOCK_wsrep_cluster_config (in that order) and invokes wsrep_slave_threads_update() that takes LOCK_wsrep_slave_threads * wsrep_replication_process() takes LOCK_wsrep_slave_threads and invokes wsrep_close_applier(), that does thd->set_killed() which takes LOCK_thd_kill. et voilà. As a fix I copied a workaround from wsrep_cluster_address_update() to wsrep_slave_threads_update(). It seems to be safe: without mutexes a race condition is possible and a concurrent SET might change wsrep_slave_threads, but wsrep_slave_threads_update() always verifies if there's a need to do something, so it will not run twice in this case, it'll be a no-op.
* | | | MDEV-20008: Galera strict modebb-10.6-MDEV-20008mkaruza2021-01-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new enum variable `wsrep_mode` which can be used to turn on WSREP features which are not part of default behaviour. Added enum `BINLOG_ROW_FORMAT_ONLY`, `REQUIRED_PRIMARY_KEY` and `STRICT_REPLICATION`. `wsrep-mode=STRICT_REPLICATION` behaves like variable `wsrep_strict_ddl`. Variable wsrep_strict_ddl is deprecated and if set we use new wsrep_mode setting instead. Reviewed and improved by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-01-251-20/+87
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2021-01-251-20/+87
| |\ \ \ | | |/ /
| | * | MDEV-24463 : galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT ↵bb-10.4-MDEV-24463Jan Lindström2021-01-221-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed: 1213: Deadlock found when trying to get lock We need to complete SST if both new and old start positions are not same as initial positions. If they are initial positions just set local uuid and seqno.
| | * | MDEV-24596 : Assertion `state_ == s_exec || state_ == s_quitting' failed in ↵Jan Lindström2021-01-211-14/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wsrep::client_state::disable_streaming There were multiple problems here * wsrep_trx_fragment_size should not be set when wsrep is disabled or provider is not loaded * wsrep_trx_fragment_unit should not be set when wsrep is disabled or provider is not loaded * wsrep_debug has no effect if wsrep is disabled or provider is not loaded * wsrep_start_position should not be set when wsrep is disabled or provider is not loaded any other value than default * wsrep_start_position should be changed only when we are joiner or initialized * wsrep_start_position should be allowed to set only a value that exits, thus we need to add error handling to wsrep_sst_complete
| | * | MDEV-22285 : Assertion `xid_seqno > wsrep_seqno' failed in ↵Jan Lindström2021-01-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trx_rseg_update_wsrep_checkpoint on SET @@global.wsrep_start_position Actual assertion mentioned on MDEV seems to be already fixed but setting seqno to -2 will trigger a different assertion mysqld: /home/jan/mysql/10.4-bugs/wsrep-lib/src/server_state.cpp:702: void wsrep::server_state::sst_received(wsrep::client_service&, int): Assertion `state_ == s_joiner || state_ == s_initialized' failed. Fixed this by not allowing user to set seqno < -1 (-1 is special seqno meaning undefined and seqno is initialized to it). MariaDB releases 10.2 and 10.3 already do not allow to set seqno < -1.
* | | | Merge 10.5 into 10.6Marko Mäkelä2021-01-111-0/+8
|\ \ \ \ | |/ / /
| * | | MDEV-24546 : AddressSanitizer: initialization-order-fiasco on address ... in ↵Jan Lindström2021-01-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sys_var_integer from __static_initialization_and_destruction_0, possibly inside global var wsrep_gtid_server Galera parameter wsrep_gtid_domain_id was defined using a class where actual parameter was not a first member. Fixed this by using normal variable and assigning this value to class member value.
* | | | Merge 10.5 into 10.6Marko Mäkelä2020-11-021-1/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.4 to 10.5Marko Mäkelä2020-10-221-1/+2
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2020-10-221-1/+2
| | |\ \ | | | |/
| | | * Merge 10.2 into 10.3Marko Mäkelä2020-10-221-2/+2
| | | |\
| | | | * MDEV-23894 UBSAN: several call to function show_binlog_vars(THD*, ↵Eugene Kosov2020-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | st_mysql_show_var*, char*) through pointer to incorrect function type 'int (*)(THD *, st_mysql_show_var *, void *, system_status_var *, enum_var_type) errors