mirror of
https://github.com/MariaDB/server.git
synced 2025-02-22 13:23:07 +01:00

Remove alter_algorithm but keep the variable as no-op (with a warning). The reasons for removing alter_algorithm are: - alter_algorithm was introduced as a replacement for the old_alter_table that was used to force the usage of the original alter table algorithm (copy) in the cases where the new alter algorithm did not work. The new option was added as a way to force the usage of a specific algorithm when it should instead have made it possible to disable algorithms that would not work for some reason. - alter_algorithm introduced some cases where ALTER TABLE would not work without specifying the ALGORITHM=XXX option together with ALTER TABLE. - Having different values of alter_algorithm on master and slave could cause slave to stop unexpectedly. - ALTER TABLE FORCE, as used by mariadb-upgrade, would not always work if alter_algorithm was set for the server. - As part of the MDEV-33449 "improving repair of tables" it become clear that alter- algorithm made it harder to provide a better and more consistent ALTER TABLE FORCE and REPAIR TABLE and it would be better to remove it.
90 lines
2.5 KiB
Text
90 lines
2.5 KiB
Text
#
|
|
# MDEV-11675 Two phase ALTER binlogging
|
|
#
|
|
# Prove that FTWRL in the middle of START and "COMPLETE" parts of ALTER
|
|
# is safe.
|
|
|
|
--source include/have_debug.inc
|
|
--source include/have_innodb.inc
|
|
--source include/master-slave.inc
|
|
|
|
--connection slave
|
|
--let $slave_parallel_threads= `select @@slave_parallel_threads`
|
|
--let $slave_parallel_mode= `select @@slave_parallel_mode`
|
|
--let $debug = `SELECT @@global.debug_dbug`
|
|
|
|
--source include/stop_slave.inc
|
|
|
|
SET @@global.slave_parallel_threads=4;
|
|
SET @@global.slave_parallel_mode=optimistic;
|
|
CHANGE MASTER TO master_use_gtid=slave_pos;
|
|
|
|
SET @@global.debug_dbug="+d,at_write_start_alter";
|
|
--source include/start_slave.inc
|
|
|
|
--connection master
|
|
SET @@session.binlog_alter_two_phase=true;
|
|
|
|
CREATE TABLE t1 (a INT) ENGINE=innodb;
|
|
--source include/save_master_gtid.inc
|
|
|
|
# Make sure the table exists on slave now.
|
|
--connection slave
|
|
--source include/sync_with_master_gtid.inc
|
|
|
|
--connection master
|
|
SET @@session.gtid_domain_id=11;
|
|
ALTER TABLE t1 ADD COLUMN b int, algorithm=instant;
|
|
|
|
|
|
--echo # START Alter having exclusive lock is waiting for the signal
|
|
--connection slave
|
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now'
|
|
--source include/wait_condition.inc
|
|
|
|
--echo # FTWRL is sent first to wait for SA
|
|
--connection slave1
|
|
--send FLUSH TABLES WITH READ LOCK
|
|
|
|
--echo # SA completes
|
|
# First wait for the FTWRL arrival.
|
|
--connection slave
|
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'FLUSH TABLES WITH READ LOCK' and STATE = 'Waiting for worker threads to pause for global read lock'
|
|
--source include/wait_condition.inc
|
|
|
|
set DEBUG_SYNC= "now signal alter_cont";
|
|
|
|
--connection slave1
|
|
--reap
|
|
|
|
# Commit ALTER is hanging now
|
|
--connection slave
|
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Slave_worker' AND STATE = 'Waiting for backup lock'
|
|
--source include/wait_condition.inc
|
|
|
|
--echo # Release CA
|
|
--connection slave1
|
|
UNLOCK TABLES;
|
|
|
|
--connection master
|
|
--sync_slave_with_master
|
|
|
|
SHOW CREATE TABLE t1;
|
|
--source include/show_binlog_events.inc
|
|
|
|
--connection master
|
|
DROP TABLE t1;
|
|
|
|
--sync_slave_with_master
|
|
|
|
--echo # cleanup
|
|
--connection slave
|
|
set DEBUG_SYNC = RESET;
|
|
--source include/stop_slave.inc
|
|
--eval set global slave_parallel_threads = $slave_parallel_threads
|
|
--eval set global slave_parallel_mode = $slave_parallel_mode
|
|
--eval set @@global.debug_dbug = "$debug"
|
|
--source include/start_slave.inc
|
|
|
|
|
|
--source include/rpl_end.inc
|