[MDEV-27537] SET ALTER_ALGORITHM is not replicated to lead to slave error Created: 2022-01-18  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Andrei Elkin Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Settings like SET SESSION ALTER_ALGORITHM = COPY on master server that
are different/incompatible with the slave global variable value can lead to
an unilateral error of ALTER query execution on slave server.

The variable should be replicated as a part of Query context.



 Comments   
Comment by Sergei Golubchik [ 2022-02-21 ]

can you show an example of such a unilateral error?

Comment by Andrei Elkin [ 2022-02-21 ]

serg, sorry for such short report indeed. Details must have been left out by a crash my box had. Now I've recollected the scenario:

--source include/master-slave.inc
 
--connection master
 SET ALTER_ALGORITHM= COPY ;
 
CREATE /* QNO 17 CON_ID 6 */ TABLE AA (
                pk INTEGER AUTO_INCREMENT,
                col_int_nokey INTEGER /*! NULL */,
                col_int_key INTEGER,
                col_date_key DATE,
                col_date_nokey DATE /*! NULL */,
                col_time_key TIME,
                col_time_nokey TIME /*! NULL */,
                col_datetime_key DATETIME,
                col_datetime_nokey DATETIME /*! NULL */,
 
                col_varchar_key VARCHAR(1),
                col_varchar_nokey VARCHAR(1) /*! NULL */,
 
                PRIMARY KEY (pk),
                KEY (col_int_key ASC),
                KEY (col_date_key DESC),
                KEY (col_time_key DESC),
                KEY (col_datetime_key ASC),
                KEY (col_varchar_key, col_int_key DESC)
            )  AUTO_INCREMENT=10 ENGINE=MyISAM;
 
--sync_slave_with_master
 
--connection master
ALTER  TABLE `AA`  NOWAIT  ADD COLUMN IF NOT EXISTS ( icol9 TINYINT UNSIGNED NOT NULL DEFAULT 9 ), ALGORITHM=COPY, LOCK=EXCLUSIVE, DROP COLUMN IF EXISTS icol9 , ALGORITHM=NOCOPY;
 
--connection slave
 
--let $show_slave_sql_error=1
--let $slave_sql_errno=1845
--source include/wait_for_slave_sql_error.inc
 
# --connection master
#  DROP TABLE AA;
# --sync_slave_with_master
# --source include/rpl_end.inc

Comment by Andrei Elkin [ 2022-02-21 ]

An mtr test is composed.

Generated at Thu Feb 08 09:53:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.