Skip to content

Commit 3e64e7f

Browse files
author
mkaruza
committed
WSREP debug log levels support
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.
1 parent c2c637c commit 3e64e7f

16 files changed

+52
-34
lines changed

include/mysql/service_wsrep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extern struct wsrep_service_st {
122122
#else
123123

124124
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
125-
extern my_bool wsrep_debug;
125+
extern ulong wsrep_debug;
126126
extern my_bool wsrep_log_conflicts;
127127
extern my_bool wsrep_certify_nonPK;
128128
extern my_bool wsrep_load_data_splitting;

mysql-test/suite/galera/r/galera_defaults.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ WSREP_CLUSTER_ADDRESS gcomm://
2626
WSREP_CLUSTER_NAME my_wsrep_cluster
2727
WSREP_CONVERT_LOCK_TO_TRX OFF
2828
WSREP_DBUG_OPTION
29-
WSREP_DEBUG OFF
29+
WSREP_DEBUG NONE
3030
WSREP_DESYNC OFF
3131
WSREP_DIRTY_READS OFF
3232
WSREP_DRUPAL_282555_WORKAROUND OFF

mysql-test/suite/galera/t/galera_sst_mariabackup.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[mysqld]
44
wsrep_sst_method=mariabackup
55
wsrep_sst_auth="root:"
6-
wsrep_debug=ON
6+
wsrep_debug=1
77

88
[mysqld.1]
99
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'

mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[mysqld]
44
wsrep_sst_method=mariabackup
55
wsrep_sst_auth="root:"
6-
wsrep_debug=ON
6+
wsrep_debug=1
77

88
[mysqld.1]
99
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'

mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[mysqld]
44
wsrep_sst_method=mariabackup
55
wsrep_sst_auth="root:"
6-
wsrep_debug=ON
6+
wsrep_debug=1
77

88
[SST]
99
tkey=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem

mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[mysqld]
44
wsrep_sst_method=mariabackup
55
wsrep_sst_auth="root:"
6-
wsrep_debug=ON
6+
wsrep_debug=1
77

88
[mysqld.1]
99
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'

mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ wsrep_causal_reads=0
1414
wsrep_sync_wait=0
1515

1616
[mysqld]
17-
wsrep_debug=ON
17+
wsrep_debug=1
1818

1919
[client]
2020
ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem

mysql-test/suite/sys_vars/r/sysvars_wsrep.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,18 @@ READ_ONLY NO
115115
COMMAND_LINE_ARGUMENT REQUIRED
116116
VARIABLE_NAME WSREP_DEBUG
117117
SESSION_VALUE NULL
118-
GLOBAL_VALUE OFF
118+
GLOBAL_VALUE NONE
119119
GLOBAL_VALUE_ORIGIN COMPILE-TIME
120-
DEFAULT_VALUE OFF
120+
DEFAULT_VALUE NONE
121121
VARIABLE_SCOPE GLOBAL
122-
VARIABLE_TYPE BOOLEAN
123-
VARIABLE_COMMENT To enable debug level logging
122+
VARIABLE_TYPE ENUM
123+
VARIABLE_COMMENT WSREP debug level logging
124124
NUMERIC_MIN_VALUE NULL
125125
NUMERIC_MAX_VALUE NULL
126126
NUMERIC_BLOCK_SIZE NULL
127-
ENUM_VALUE_LIST OFF,ON
127+
ENUM_VALUE_LIST NONE,SERVER,TRANSACTION,STREAMING,CLIENT
128128
READ_ONLY NO
129-
COMMAND_LINE_ARGUMENT OPTIONAL
129+
COMMAND_LINE_ARGUMENT REQUIRED
130130
VARIABLE_NAME WSREP_DESYNC
131131
SESSION_VALUE NULL
132132
GLOBAL_VALUE OFF

mysql-test/suite/sys_vars/r/wsrep_debug_basic.result

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,41 @@ SET @wsrep_debug_global_saved = @@global.wsrep_debug;
66
# default
77
SELECT @@global.wsrep_debug;
88
@@global.wsrep_debug
9-
0
9+
NONE
1010

1111
# scope
1212
SELECT @@session.wsrep_debug;
1313
ERROR HY000: Variable 'wsrep_debug' is a GLOBAL variable
14-
SET @@global.wsrep_debug=OFF;
14+
SET @@global.wsrep_debug=0;
1515
SELECT @@global.wsrep_debug;
1616
@@global.wsrep_debug
17-
0
18-
SET @@global.wsrep_debug=ON;
17+
NONE
18+
SET @@global.wsrep_debug=1;
1919
SELECT @@global.wsrep_debug;
2020
@@global.wsrep_debug
21-
1
21+
SERVER
2222

2323
# valid values
24-
SET @@global.wsrep_debug='OFF';
24+
SET @@global.wsrep_debug=NONE;
2525
SELECT @@global.wsrep_debug;
2626
@@global.wsrep_debug
27-
0
28-
SET @@global.wsrep_debug=ON;
27+
NONE
28+
SET @@global.wsrep_debug=SERVER;
2929
SELECT @@global.wsrep_debug;
3030
@@global.wsrep_debug
31-
1
31+
SERVER
3232
SET @@global.wsrep_debug=default;
3333
SELECT @@global.wsrep_debug;
3434
@@global.wsrep_debug
35-
0
35+
NONE
3636

3737
# invalid values
3838
SET @@global.wsrep_debug=NULL;
3939
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'NULL'
4040
SET @@global.wsrep_debug='junk';
4141
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'junk'
42+
SET @@global.wsrep_debug=ON;
43+
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'ON'
4244

4345
# restore the initial value
4446
SET @@global.wsrep_debug = @wsrep_debug_global_saved;

mysql-test/suite/sys_vars/t/wsrep_debug_basic.test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ SELECT @@global.wsrep_debug;
1414
--echo # scope
1515
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
1616
SELECT @@session.wsrep_debug;
17-
SET @@global.wsrep_debug=OFF;
17+
SET @@global.wsrep_debug=0;
1818
SELECT @@global.wsrep_debug;
19-
SET @@global.wsrep_debug=ON;
19+
SET @@global.wsrep_debug=1;
2020
SELECT @@global.wsrep_debug;
2121

2222
--echo
2323
--echo # valid values
24-
SET @@global.wsrep_debug='OFF';
24+
SET @@global.wsrep_debug=NONE;
2525
SELECT @@global.wsrep_debug;
26-
SET @@global.wsrep_debug=ON;
26+
SET @@global.wsrep_debug=SERVER;
2727
SELECT @@global.wsrep_debug;
2828
SET @@global.wsrep_debug=default;
2929
SELECT @@global.wsrep_debug;
@@ -34,6 +34,8 @@ SELECT @@global.wsrep_debug;
3434
SET @@global.wsrep_debug=NULL;
3535
--error ER_WRONG_VALUE_FOR_VAR
3636
SET @@global.wsrep_debug='junk';
37+
--error ER_WRONG_VALUE_FOR_VAR
38+
SET @@global.wsrep_debug=ON;
3739

3840
--echo
3941
--echo # restore the initial value

0 commit comments

Comments
 (0)