Skip to content

Commit

Permalink
MDEV-22570 Implement wsrep_provider_options as plugin
Browse files Browse the repository at this point in the history
- Provider options are read from the provider during
  startup, before plugins are initialized.
- New wsrep_provider plugin for which sysvars are generated
  dynamically from options read from the provider.
- The plugin is enabled by option plugin-wsrep-provider=ON.
  If enabled, wsrep_provider_options can no longer be used,
  (an error is raised on attempts to do so).
- Each option is either string, integer, double or bool
- Options can be dynamic / readonly
- Options can be deprecated

Limitations:

- We do not check that the value of a provider option falls
  within a certain range. This type of validation is still
  done in Galera side.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
  • Loading branch information
sciascid authored and vuvova committed Feb 14, 2023
1 parent 061ea3f commit 79d0194
Show file tree
Hide file tree
Showing 15 changed files with 1,860 additions and 12 deletions.
20 changes: 20 additions & 0 deletions mysql-test/suite/wsrep/r/wsrep_provider_plugin.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_repl_max_ws_size=1;
SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
Variable_name Value
wsrep_provider_repl_max_ws_size 1
INSERT INTO t1 VALUES (1);
ERROR HY000: Got error 5 "Input/output error" during COMMIT
SET GLOBAL wsrep_provider_repl_max_ws_size=DEFAULT;
SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
Variable_name Value
wsrep_provider_repl_max_ws_size 2147483647
INSERT INTO t1 VALUES (1);
SET GLOBAL wsrep_provider_options='repl.max_ws_size=1';
ERROR HY000: Variable 'wsrep_provider_options' is a read only variable
INSERT INTO t1 VALUES (2);
SET GLOBAL wsrep_provider='none';
ERROR HY000: Variable 'wsrep_provider' is a read only variable
DROP TABLE t1;
CALL mtr.add_suppression("transaction size limit");
CALL mtr.add_suppression("rbr write fail");
65 changes: 65 additions & 0 deletions mysql-test/suite/wsrep/r/wsrep_provider_plugin_basic.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size';
variable_type global_value
VARCHAR auto
set global wsrep_provider_socket_recv_buf_size = 'foo';
ERROR 42000: Variable 'socket_recv_buf_size' can't be set to the value of 'foo'
set global wsrep_provider_socket_recv_buf_size = '1M';
show global variables like 'wsrep_provider_socket_recv_buf_size';
Variable_name Value
wsrep_provider_socket_recv_buf_size 1M
set global wsrep_provider_socket_recv_buf_size = default;
show global variables like 'wsrep_provider_socket_recv_buf_size';
Variable_name Value
wsrep_provider_socket_recv_buf_size auto
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_evs_send_window';
variable_type global_value
BIGINT 4
set global wsrep_provider_evs_send_window = -10;
ERROR 42000: Variable 'evs_send_window' can't be set to the value of '-10'
set global wsrep_provider_evs_send_window = 10;
show global variables like 'wsrep_provider_evs_send_window';
Variable_name Value
wsrep_provider_evs_send_window 10
set global wsrep_provider_evs_send_window = default;
show global variables like 'wsrep_provider_evs_send_window';
Variable_name Value
wsrep_provider_evs_send_window 4
select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_gcs_max_throttle';
variable_type
DOUBLE
set global wsrep_provider_gcs_max_throttle = 1.1;
ERROR 42000: Variable 'gcs_max_throttle' can't be set to the value of '1.100000'
set global wsrep_provider_gcs_max_throttle = 0.5;
show global variables like 'wsrep_provider_gcs_max_throttle';
Variable_name Value
wsrep_provider_gcs_max_throttle 0.500000
set global wsrep_provider_gcs_max_throttle = default;
show global variables like 'wsrep_provider_gcs_max_throttle';
Variable_name Value
wsrep_provider_gcs_max_throttle 0.250000
select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_cert_log_conflicts';
variable_type
BOOLEAN
set global wsrep_provider_cert_log_conflicts = on;
show global variables like 'wsrep_provider_cert_log_conflicts';
Variable_name Value
wsrep_provider_cert_log_conflicts ON
set global wsrep_provider_cert_log_conflicts = off;
show global variables like 'wsrep_provider_cert_log_conflicts';
Variable_name Value
wsrep_provider_cert_log_conflicts OFF
set global wsrep_provider_cert_log_conflicts = default;
show global variables like 'wsrep_provider_cert_log_conflicts';
Variable_name Value
wsrep_provider_cert_log_conflicts OFF
select read_only from information_schema.system_variables where variable_name = 'wsrep_provider_evs_auto_evict';
read_only
YES
set global wsrep_provider_evs_auto_evict = on;
ERROR HY000: Variable 'wsrep_provider_evs_auto_evict' is a read only variable
set global wsrep_provider_gcs_fc_master_slave = default;
Warnings:
Warning 1287 '@@wsrep_provider_gcs_fc_master_slave' is deprecated and will be removed in a future release
call mtr.add_suppression("error setting param");
call mtr.add_suppression("Unknown parameter");
call mtr.add_suppression("Setting parameter");
Loading

0 comments on commit 79d0194

Please sign in to comment.