diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2019-07-11 07:13:58 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2019-07-15 10:17:07 +0300 |
commit | ec49976e383ae42650fb99e7477c072550d89876 (patch) | |
tree | 2169aaffae1594462b4184bec250378d2cec2bae /sql/wsrep_mysqld.h | |
parent | b3bd51c9929509d23648c11fbe87b5a4760e13e4 (diff) | |
download | mariadb-git-ec49976e383ae42650fb99e7477c072550d89876.tar.gz |
MDEV-19746: Galera test failures because of wsrep_slave_threads identification
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
Diffstat (limited to 'sql/wsrep_mysqld.h')
-rw-r--r-- | sql/wsrep_mysqld.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 4640766404b..718e188cdc4 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -31,6 +31,7 @@ typedef struct st_mysql_show_var SHOW_VAR; #include "mysqld.h" #include "sql_table.h" #include "wsrep_mysqld_c.h" +#include <vector> #define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX @@ -89,6 +90,8 @@ extern my_bool wsrep_restart_slave_activated; extern my_bool wsrep_slave_FK_checks; extern my_bool wsrep_slave_UK_checks; extern ulong wsrep_running_threads; +extern ulong wsrep_running_applier_threads; +extern ulong wsrep_running_rollbacker_threads; extern bool wsrep_new_cluster; extern bool wsrep_gtid_mode; extern uint32 wsrep_gtid_domain_id; @@ -310,7 +313,21 @@ void thd_binlog_flush_pending_rows_event(THD *thd, bool stmt_end); void thd_binlog_rollback_stmt(THD * thd); void thd_binlog_trx_reset(THD * thd); +enum wsrep_thread_type { + WSREP_APPLIER_THREAD=1, + WSREP_ROLLBACKER_THREAD=2 +}; + typedef void (*wsrep_thd_processor_fun)(THD *); + +typedef struct { + pthread_t thread_id; + wsrep_thd_processor_fun processor; + enum wsrep_thread_type thread_type; +} wsrep_thread_args; + +extern std::vector<wsrep_thread_args*> wsrep_thread_arg; + pthread_handler_t start_wsrep_THD(void *arg); int wsrep_wait_committing_connections_close(int wait_time); extern void wsrep_close_client_connections(my_bool wait_to_end, |