mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
- Made slaves temporary table multi-thread slave safe by adding mutex around save_temporary_table usage. - rli->save_temporary_tables is the active list of all used temporary tables - This is copied to THD->temporary_tables when temporary tables are opened and updated when temporary tables are closed - Added THD->lock_temporary_tables() and THD->unlock_temporary_tables() to simplify this. - Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code. - Added is_part_of_group() to mark functions that are part of the next function. This replaces setting IN_STMT when events are executed. - Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code. - If slave_skip_counter is set run things in single threaded mode. This simplifies code for skipping events. - Updating state of relay log (IN_STMT and IN_TRANSACTION) is moved to one single function: update_state_of_relay_log() We can't use OPTION_BEGIN to check for the state anymore as the sql_driver and sql execution threads may be different. Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts is_in_group() is now independent of state of executed transaction. - Reset thd->transaction.all.modified_non_trans_table() if we did set it for single table row events. This was mainly for keeping the flag as documented. - Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it. - Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock - Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond - Changed some functions to take rpl_group_info instead of Relay_log_info to make them multi-slave safe and to simplify usage - do_shall_skip() - continue_group() - sql_slave_killed() - next_event() - Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure. - set_thd_in_use_temporary_tables() removed as in_use is set on usage - Added information to thd_proc_info() which thread is waiting for slave mutex to exit. - In open_table() reuse code from find_temporary_table() Other things: - More DBUG statements - Fixed the rpl_incident.test can be run with --debug - More comments - Disabled not used function rpl_connect_master() mysql-test/suite/perfschema/r/all_instances.result: Moved sleep_lock and sleep_cond to rpl_group_info mysql-test/suite/rpl/r/rpl_incident.result: Updated result mysql-test/suite/rpl/t/rpl_incident-master.opt: Not needed anymore mysql-test/suite/rpl/t/rpl_incident.test: Fixed that test can be run with --debug sql/handler.cc: More DBUG_PRINT sql/log.cc: More comments sql/log_event.cc: Added DBUG statements do_shall_skip(), continue_group() now takes rpl_group_info param Use is_begin(), is_commit() and is_rollback() functions instead of inspecting query string We don't have set slaves temporary tables 'in_use' as this is now done when tables are opened. Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() Use IN_TRANSACTION flag to test state of relay log. In rows_event_stmt_cleanup() reset thd->transaction.all.modified_non_trans_table if we had set this before. sql/log_event.h: do_shall_skip(), continue_group() now takes rpl_group_info param Added is_part_of_group() to mark events that are part of the next event. This replaces setting IN_STMT when events are executed. Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code. sql/log_event_old.cc: Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() do_shall_skip(), continue_group() now takes rpl_group_info param sql/log_event_old.h: Added is_part_of_group() to mark events that are part of the next event. do_shall_skip(), continue_group() now takes rpl_group_info param sql/mysqld.cc: Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it. Relay_log_info::sleep_lock -> Rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> Rpl_group_info::sleep_cond sql/mysqld.h: Updated types and names sql/rpl_gtid.cc: More DBUG sql/rpl_parallel.cc: Updated TODO section Set thd for event that is execution Use new is_begin(), is_commit() and is_rollback() functions. More comments sql/rpl_rli.cc: sql_thd -> sql_driver_thd Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts. Reset table->in_use for temporary tables as the table may have been used by another THD. Use IN_TRANSACTION instead of OPTION_BEGIN to check state of relay log. Removed IN_STMT flag setting. This is now done in update_state_of_relay_log() sql/rpl_rli.h: Changed relay log state flags to bit masks instead of bit positions (most other code we have uses bit masks) Added IN_TRANSACTION to mark if we are in a BEGIN ... COMMIT section. save_temporary_tables is now thread safe Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code is_in_group() is now independent of state of executed transaction. sql/slave.cc: Simplifed arguments to io_salve_killed(), sql_slave_killed() and check_io_slave_killed(); No reason to supply THD as this is part of the given structure. set_thd_in_use_temporary_tables() removed as in_use is set on usage in sql_base.cc sql_thd -> sql_driver_thd More DBUG Added update_state_of_relay_log() which will calculate the IN_STMT and IN_TRANSACTION state of the relay log after the current element is executed. If slave_skip_counter is set run things in single threaded mode. Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure. Added information to thd_proc_info() which thread is waiting for slave mutex to exit. Disabled not used function rpl_connect_master() Updated argument to next_event() sql/sql_base.cc: Added mutex around usage of slave's temporary tables. The active list is always kept up to date in sql->rgi_slave->save_temporary_tables. Clear thd->temporary_tables after query (safety) More DBUG When using temporary table, set table->in_use to current thd as the THD may be different for slave threads. Some code is ifdef:ed with REMOVE_AFTER_MERGE_WITH_10 as the given code in 10.0 is not yet in this tree. In open_table() reuse code from find_temporary_table() sql/sql_binlog.cc: rli->sql_thd -> rli->sql_driver_thd Remove duplicate setting of rgi->rli sql/sql_class.cc: Added helper functions rgi_lock_temporary_tables() and rgi_unlock_temporary_tables() Would have been nicer to have these inline, but there was no easy way to do that sql/sql_class.h: Added functions to protect slaves temporary tables sql/sql_parse.cc: Added DBUG_PRINT sql/transaction.cc: Added comment
171 lines
6.8 KiB
Plaintext
171 lines
6.8 KiB
Plaintext
use performance_schema;
|
|
select name from mutex_instances
|
|
where name not rlike '/(DEBUG_SYNC::mutex)$'
|
|
and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
|
|
group by name;
|
|
name
|
|
wait/synch/mutex/archive/archive_mutex
|
|
wait/synch/mutex/aria/LOCK_trn_list
|
|
wait/synch/mutex/aria/PAGECACHE::cache_lock
|
|
wait/synch/mutex/aria/SERVICE_THREAD_CONTROL::LOCK_control
|
|
wait/synch/mutex/aria/THR_LOCK_maria
|
|
wait/synch/mutex/aria/TRANSLOG_BUFFER::mutex
|
|
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::dirty_buffer_mask_lock
|
|
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::file_header_lock
|
|
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::log_flush_lock
|
|
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::purger_lock
|
|
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::unfinished_files_lock
|
|
wait/synch/mutex/blackhole/blackhole
|
|
wait/synch/mutex/csv/tina
|
|
wait/synch/mutex/memory/HP_SHARE::intern_lock
|
|
wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock
|
|
wait/synch/mutex/mysys/KEY_CACHE::cache_lock
|
|
wait/synch/mutex/mysys/LOCK_alarm
|
|
wait/synch/mutex/mysys/LOCK_uuid_generator
|
|
wait/synch/mutex/mysys/my_thread_var::mutex
|
|
wait/synch/mutex/mysys/THR_LOCK::mutex
|
|
wait/synch/mutex/mysys/THR_LOCK_charset
|
|
wait/synch/mutex/mysys/THR_LOCK_heap
|
|
wait/synch/mutex/mysys/THR_LOCK_isam
|
|
wait/synch/mutex/mysys/THR_LOCK_lock
|
|
wait/synch/mutex/mysys/THR_LOCK_malloc
|
|
wait/synch/mutex/mysys/THR_LOCK_myisam
|
|
wait/synch/mutex/mysys/THR_LOCK_myisam_mmap
|
|
wait/synch/mutex/mysys/THR_LOCK_net
|
|
wait/synch/mutex/mysys/THR_LOCK_open
|
|
wait/synch/mutex/mysys/THR_LOCK_threads
|
|
wait/synch/mutex/mysys/TMPDIR_mutex
|
|
wait/synch/mutex/sql/Cversion_lock
|
|
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state
|
|
wait/synch/mutex/sql/hash_filo::lock
|
|
wait/synch/mutex/sql/LOCK_active_mi
|
|
wait/synch/mutex/sql/LOCK_audit_mask
|
|
wait/synch/mutex/sql/LOCK_commit_ordered
|
|
wait/synch/mutex/sql/LOCK_connection_count
|
|
wait/synch/mutex/sql/LOCK_crypt
|
|
wait/synch/mutex/sql/LOCK_delayed_create
|
|
wait/synch/mutex/sql/LOCK_delayed_insert
|
|
wait/synch/mutex/sql/LOCK_delayed_status
|
|
wait/synch/mutex/sql/LOCK_des_key_file
|
|
wait/synch/mutex/sql/LOCK_error_log
|
|
wait/synch/mutex/sql/LOCK_error_messages
|
|
wait/synch/mutex/sql/LOCK_event_queue
|
|
wait/synch/mutex/sql/LOCK_gdl
|
|
wait/synch/mutex/sql/LOCK_global_index_stats
|
|
wait/synch/mutex/sql/LOCK_global_system_variables
|
|
wait/synch/mutex/sql/LOCK_global_table_stats
|
|
wait/synch/mutex/sql/LOCK_global_user_client_stats
|
|
wait/synch/mutex/sql/LOCK_open
|
|
wait/synch/mutex/sql/LOCK_plugin
|
|
wait/synch/mutex/sql/LOCK_prepared_stmt_count
|
|
wait/synch/mutex/sql/LOCK_prepare_ordered
|
|
wait/synch/mutex/sql/LOCK_rpl_gtid_state
|
|
wait/synch/mutex/sql/LOCK_rpl_status
|
|
wait/synch/mutex/sql/LOCK_rpl_thread_pool
|
|
wait/synch/mutex/sql/LOCK_server_started
|
|
wait/synch/mutex/sql/LOCK_slave_list
|
|
wait/synch/mutex/sql/LOCK_slave_state
|
|
wait/synch/mutex/sql/LOCK_stats
|
|
wait/synch/mutex/sql/LOCK_status
|
|
wait/synch/mutex/sql/LOCK_thread_cache
|
|
wait/synch/mutex/sql/LOCK_thread_count
|
|
wait/synch/mutex/sql/LOCK_user_conn
|
|
wait/synch/mutex/sql/LOCK_user_locks
|
|
wait/synch/mutex/sql/LOCK_uuid_short_generator
|
|
wait/synch/mutex/sql/LOCK_xid_cache
|
|
wait/synch/mutex/sql/LOG::LOCK_log
|
|
wait/synch/mutex/sql/LOG_INFO::lock
|
|
wait/synch/mutex/sql/Master_info::data_lock
|
|
wait/synch/mutex/sql/Master_info::run_lock
|
|
wait/synch/mutex/sql/Master_info::sleep_lock
|
|
wait/synch/mutex/sql/MDL_map::mutex
|
|
wait/synch/mutex/sql/MDL_wait::LOCK_wait_status
|
|
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_binlog_background_thread
|
|
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index
|
|
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xid_list
|
|
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index
|
|
wait/synch/mutex/sql/Query_cache::structure_guard_mutex
|
|
wait/synch/mutex/sql/Relay_log_info::data_lock
|
|
wait/synch/mutex/sql/Relay_log_info::log_space_lock
|
|
wait/synch/mutex/sql/Relay_log_info::run_lock
|
|
wait/synch/mutex/sql/Slave_reporting_capability::err_lock
|
|
wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data
|
|
wait/synch/mutex/sql/THD::LOCK_thd_data
|
|
wait/synch/mutex/sql/THD::LOCK_wakeup_ready
|
|
wait/synch/mutex/sql/tz_LOCK
|
|
select name from rwlock_instances
|
|
where name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
|
|
group by name;
|
|
name
|
|
wait/synch/rwlock/aria/TRANSLOG_DESCRIPTOR::open_files_lock
|
|
wait/synch/rwlock/myisam/MYISAM_SHARE::key_root_lock
|
|
wait/synch/rwlock/myisam/MYISAM_SHARE::mmap_lock
|
|
wait/synch/rwlock/mysys/SAFE_HASH::mutex
|
|
wait/synch/rwlock/sql/LOCK_dboptions
|
|
wait/synch/rwlock/sql/LOCK_grant
|
|
wait/synch/rwlock/sql/LOCK_system_variables_hash
|
|
wait/synch/rwlock/sql/LOCK_sys_init_connect
|
|
wait/synch/rwlock/sql/LOCK_sys_init_slave
|
|
wait/synch/rwlock/sql/LOGGER::LOCK_logger
|
|
wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
|
|
wait/synch/rwlock/sql/MDL_lock::rwlock
|
|
wait/synch/rwlock/sql/THR_LOCK_servers
|
|
wait/synch/rwlock/sql/THR_LOCK_udf
|
|
select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
|
|
name
|
|
wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control
|
|
wait/synch/cond/aria/TRANSLOG_BUFFER::prev_sent_to_disk_cond
|
|
wait/synch/cond/aria/TRANSLOG_BUFFER::waiting_filling_buffer
|
|
wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::log_flush_cond
|
|
wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::new_goal_cond
|
|
wait/synch/cond/mysys/COND_alarm
|
|
wait/synch/cond/mysys/my_thread_var::suspend
|
|
wait/synch/cond/mysys/THR_COND_threads
|
|
wait/synch/cond/sql/COND_flush_thread_cache
|
|
wait/synch/cond/sql/COND_prepare_ordered
|
|
wait/synch/cond/sql/COND_queue_state
|
|
wait/synch/cond/sql/COND_rpl_status
|
|
wait/synch/cond/sql/COND_rpl_thread_pool
|
|
wait/synch/cond/sql/COND_server_started
|
|
wait/synch/cond/sql/COND_thread_cache
|
|
wait/synch/cond/sql/COND_thread_count
|
|
wait/synch/cond/sql/Event_scheduler::COND_state
|
|
wait/synch/cond/sql/Master_info::data_cond
|
|
wait/synch/cond/sql/Master_info::sleep_cond
|
|
wait/synch/cond/sql/Master_info::start_cond
|
|
wait/synch/cond/sql/Master_info::stop_cond
|
|
wait/synch/cond/sql/MDL_context::COND_wait_status
|
|
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_binlog_background_thread
|
|
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_binlog_background_thread_end
|
|
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy
|
|
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_xid_list
|
|
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond
|
|
wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy
|
|
wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond
|
|
wait/synch/cond/sql/Query_cache::COND_cache_status_changed
|
|
wait/synch/cond/sql/Relay_log_info::data_cond
|
|
wait/synch/cond/sql/Relay_log_info::log_space_cond
|
|
wait/synch/cond/sql/Relay_log_info::start_cond
|
|
wait/synch/cond/sql/Relay_log_info::stop_cond
|
|
wait/synch/cond/sql/THD::COND_wakeup_ready
|
|
select event_name from file_instances group by event_name;
|
|
event_name
|
|
wait/io/file/aria/control
|
|
wait/io/file/aria/translog
|
|
wait/io/file/myisam/dfile
|
|
wait/io/file/myisam/kfile
|
|
wait/io/file/mysys/charset
|
|
wait/io/file/sql/casetest
|
|
wait/io/file/sql/dbopt
|
|
wait/io/file/sql/ERRMSG
|
|
wait/io/file/sql/FRM
|
|
wait/io/file/sql/pid
|
|
wait/io/file/sql/query_log
|
|
wait/io/file/sql/slow_log
|
|
select name from threads group by name;
|
|
name
|
|
thread/aria/checkpoint_background
|
|
thread/sql/main
|
|
thread/sql/one_connection
|
|
thread/sql/signal_handler
|