[MDEV-30140] Some wsrep provider options only validate the first character of the value when setting it dynamically. Created: 2022-12-01  Updated: 2023-03-28  Resolved: 2023-03-28

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.4, 11.0.0, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Julius Goryavsky
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-22570 Split wsrep_provider_options in sever... Closed

 Description   

Some wsrep provider options only validate the first character of the value when setting it dynamically. This causes the wsrep options to be set to an invalid value and those options in wsrep_provider_options to have a truncated value.

node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD=Panyvalue;
Query OK, 0 rows affected (0.000 sec)
 
node2:root@localhost>
node2:root@localhost> SELECT @@WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD;
+----------------------------------------------+
| @@WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD |
+----------------------------------------------+
| Panyvalue                                    |
+----------------------------------------------+
1 row in set (0.013 sec)
 
node2:root@localhost>
 
node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD=anyvalue;
ERROR 1231 (42000): Variable 'evs_causal_keepalive_period' can't be set to the value of 'anyvalue'
node2:root@localhost> 

WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD will have a truncated value in wsrep_provider_options.

node2:root@localhost> select @@wsrep_provider_options\G
*************************** 1. row ***************************
@@wsrep_provider_options: base_dir = /test/mtest/GAL_MD281122-mariadb-10.11.2-linux-x86_64-dbg/node2/; base_host = 127.0.0.1; base_port = 11842; cert.log_conflicts = no; cert.optimistic_pa = yes; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = P; [..]

node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD=Pdummy;
Query OK, 0 rows affected (0.001 sec)
 
node2:root@localhost> select @@WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD;
+------------------------------------------+
| @@WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD |
+------------------------------------------+
| Pdummy                                   |
+------------------------------------------+
1 row in set (0.000 sec)
 
node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD=dummy;
ERROR 1231 (42000): Variable 'evs_delayed_keep_period' can't be set to the value of 'dummy'
node2:root@localhost> 
 
node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_DEBUG_LOG_MASK='1dummy';
Query OK, 0 rows affected (0.000 sec)
 
node2:root@localhost> select @@WSREP_PROVIDER_EVS_DEBUG_LOG_MASK;
+-------------------------------------+
| @@WSREP_PROVIDER_EVS_DEBUG_LOG_MASK |
+-------------------------------------+
| 1dummy                              |
+-------------------------------------+
1 row in set (0.031 sec)
 
node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_DEBUG_LOG_MASK='dummy';
Query OK, 0 rows affected (0.000 sec)
 
node2:root@localhost> select @@WSREP_PROVIDER_EVS_DEBUG_LOG_MASK;
+-------------------------------------+
| @@WSREP_PROVIDER_EVS_DEBUG_LOG_MASK |
+-------------------------------------+
| dummy                               |
+-------------------------------------+
1 row in set (0.000 sec)
 
node2:root@localhost>
node2:root@localhost> SET GLOBAL WSREP_PROVIDER_EVS_DEBUG_LOG_MASK='ummy';
ERROR 1231 (42000): Variable 'evs_debug_log_mask' can't be set to the value of 'ummy'
node2:root@localhost> 

These are the variables that have this issue.

WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD
WSREP_PROVIDER_EVS_DEBUG_LOG_MASK
WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD
WSREP_PROVIDER_EVS_DELAY_MARGIN
WSREP_PROVIDER_EVS_INACTIVE_CHECK_PERIOD
WSREP_PROVIDER_EVS_INACTIVE_TIMEOUT
WSREP_PROVIDER_EVS_INFO_LOG_MASK
WSREP_PROVIDER_EVS_INSTALL_TIMEOUT
WSREP_PROVIDER_EVS_JOIN_RETRANS_PERIOD
WSREP_PROVIDER_EVS_KEEPALIVE_PERIOD
WSREP_PROVIDER_EVS_STATS_REPORT_PERIOD
WSREP_PROVIDER_EVS_SUSPECT_TIMEOUT
WSREP_PROVIDER_REPL_CAUSAL_READ_TIMEOUT



 Comments   
Comment by Ramesh Sivaraman [ 2022-12-02 ]

Similarly WSREP_PROVIDER GCS_FC_LIMIT does not allow setting value in kilobyte format.

node1:root@localhost> set global WSREP_PROVIDER_GCS_FC_LIMIT=1K;
ERROR 1232 (42000): Incorrect argument type to variable 'wsrep_provider_gcs_fc_limit'
node1:root@localhost> 

It was permissible to set the value through wsrep_provider_options

10.9.5-opt>SET GLOBAL wsrep_provider_options="gcs.fc_limit=1K";
Query OK, 0 rows affected (0.000 sec)
 
10.9.5-opt>select @@wsrep_provider_options\G
*************************** 1. row ***************************
@@wsrep_provider_options: [..]gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 1K; gcs.fc_master_slave = no;[..]
1 row in set (0.000 sec)
 
10.9.5-opt>

Comment by Daniele Sciascia [ 2022-12-07 ]

This bug is not caused by MDEV-22570. It is already present in current version and can be reproduced using wsrep_provider_options variable:

SET GLOBAL wsrep_provider_options="evs.causal_keepalive_period=Panyvalue";
SHOW VARIABLES LIKE 'wsrep_provider_options';                             

results in:

WSREP_PROVIDER_OPTIONS [...] evs.causal_keepalive_period = P; [...]

The source of the issue has been tracked down in galera library: https://github.com/codership/galera/issues/630

Comment by Ramesh Sivaraman [ 2023-02-09 ]

This issue is fixed in the latest Galera revision

10.6.12-dbg>SET GLOBAL wsrep_provider_options="evs.causal_keepalive_period=Panyvalue";
ERROR 1210 (HY000): Incorrect arguments to SET
10.6.12-dbg>
 
Commit info
-------------------
commit 06a0c28592fb5c7b21413d922b1671cc070ab4c6 (grafted, HEAD -> mariadb-4.x, origin/mariadb-4.x)
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date:   Fri Jan 27 07:46:18 2023 +0200
 
    Merge branch wsrep/4.ee into mariadb-4.x

Comment by Jan Lindström [ 2023-03-23 ]

ralf.gebhardt This fix is released on Galera library 26.4.14. In my understanding it is not fixed on 25.3.x.

Comment by Julius Goryavsky [ 2023-03-28 ]

Already fixed with Galera 26.4.14 and current wsrep-lib

Generated at Thu Feb 08 10:13:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.