Commit 337ea589 authored by Sachin's avatar Sachin

new commit

parent 6da5b791
...@@ -10,7 +10,7 @@ start slave; ...@@ -10,7 +10,7 @@ start slave;
--connection master --connection master
set global binlog_split_alter=true; #set global binlog_split_alter=true;
create table t1( a int primary key, b int) engine=innodb; create table t1( a int primary key, b int) engine=innodb;
insert into t1 values(1,1),(2,2); insert into t1 values(1,1),(2,2);
create table t2( a int primary key, b int) engine=innodb; create table t2( a int primary key, b int) engine=innodb;
......
...@@ -16,20 +16,23 @@ connect (con1,localhost,root,,); ...@@ -16,20 +16,23 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
--connection con1 --connection con1
--send alter table t1 add column c int, force, algorithm=inplace; --send alter table t1 add column c int, force, algorithm=inplace;
--connection con2 #--connection con2
--send alter table t2 add column c int, force, algorithm=inplace; #--send alter table t2 add column c int, force, algorithm=inplace;
--connection con1 #--connection con1
--reap #--reap
--connection con2 #--connection con2
--reap #--reap
create table t3( a int primary key, b int) engine=innodb; #create table t3( a int primary key, b int) engine=innodb;
show binlog events; #show binlog events;
--sleep 5
--connection slave --connection slave
--sleep 30 stop slave;
show binlog events; show create table t1;
#--sleep 30
#show binlog events;
--sleep 60000 --sleep 60000
--connection master --connection master
......
...@@ -5767,6 +5767,13 @@ mysql_execute_command(THD *thd) ...@@ -5767,6 +5767,13 @@ mysql_execute_command(THD *thd)
} }
//thd->rgi_slave->mark_start_commit(); //thd->rgi_slave->mark_start_commit();
//thd->wakeup_subsequent_commits(0); //thd->wakeup_subsequent_commits(0);
/*
Wait for other thread to commit/rollback the alter
*/
mysql_mutex_lock(&mi->start_alter_lock);
while(info->state <= start_alter_state:: ROLLBACK_ALTER )
mysql_cond_wait(&mi->start_alter_cond, &mi->start_alter_lock);
mysql_mutex_unlock(&mi->start_alter_lock);
thd->rpt->__finish_event_group(thd->rgi_slave); thd->rpt->__finish_event_group(thd->rgi_slave);
// ha_commit_trans(thd, true); // ha_commit_trans(thd, true);
// trans_commit_implicit(thd); // trans_commit_implicit(thd);
......
...@@ -7677,7 +7677,8 @@ static bool mysql_inplace_alter_table(THD *thd, ...@@ -7677,7 +7677,8 @@ static bool mysql_inplace_alter_table(THD *thd,
goto cleanup; goto cleanup;
if (write_start_alter(thd, partial_alter, send_query)) if (write_start_alter(thd, partial_alter, send_query))
DBUG_RETURN(true); DBUG_RETURN(true);
my_sleep(10000000); if (thd->slave_thread && !strcmp("t1", table->alias.c_ptr()))
my_sleep(1000000000);
DEBUG_SYNC(thd, "alter_table_inplace_after_lock_upgrade"); DEBUG_SYNC(thd, "alter_table_inplace_after_lock_upgrade");
THD_STAGE_INFO(thd, stage_alter_inplace_prepare); THD_STAGE_INFO(thd, stage_alter_inplace_prepare);
...@@ -10276,7 +10277,8 @@ do_continue:; ...@@ -10276,7 +10277,8 @@ do_continue:;
//If issues by binlog/master complete the prepare phase of alter and then commit //If issues by binlog/master complete the prepare phase of alter and then commit
if (write_start_alter(thd, &partial_alter ,send_query)) if (write_start_alter(thd, &partial_alter ,send_query))
DBUG_RETURN(true); DBUG_RETURN(true);
my_sleep(10000000); if (thd->slave_thread && !strcmp("t1", table->alias.c_ptr()))
my_sleep(1000000000);
if (ha_create_table(thd, alter_ctx.get_tmp_path(), if (ha_create_table(thd, alter_ctx.get_tmp_path(),
alter_ctx.new_db.str, alter_ctx.new_name.str, alter_ctx.new_db.str, alter_ctx.new_name.str,
create_info, &frm)) create_info, &frm))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment