首页 技术 正文
技术 2022年11月16日
0 收藏 993 点赞 3,068 浏览 3625 个字
################################################################################
# This test verifies whether the group_replication works fine when the server
# in a group goes down while there are dml operations running on it.
#
# Test:
# 0. The test requires three servers: M1,M2 and M3.
# 1. Start GR on all the servers.
# 2. CREATE TABLE ON M1 and CREATE a procedure to insert data
# into the table
# 3. Call the procedure using send operation and sleep for some time.
# 4. Kill and restart the server M1.
# 5. Wait until there are two members in a group
# 6. Start GR on server M1.
# 7. Verify that table t1 has same data across all the members.
# 8. Clean up
################################################################################# This test does crashes servers, thence we skip it on asan and valgrind.
--source include/not_asan.inc
--source include/not_valgrind.inc
--source include/big_test.inc
--source include/force_restart.inc
--source ../inc/have_group_replication_plugin.inc
--let $rpl_server_count= 3
--source ../inc/group_replication.inc--let $rpl_connection_name= server1
--source include/rpl_connection.incset sql_log_bin=0;
call mtr.add_suppression("Error in Log_event::read_log_event()");
set sql_log_bin=1;--let $group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`CREATE TABLE t1(a int auto_increment, primary key(a));# Create the procedure to perform the dml operations.
# delimiter $$;
# CREATE PROCEDURE dml_operations()
# BEGIN
# declare x INT;
# set x=1;
# while x<300 do
# insert into t1 values (x);
# update t1 set a=x+300 where a=x;
# delete from t1 where a<310;
# set x=x+1;
# end while;
# end$$
# delimiter ;$$
# --echo
#
# --echo ----call procedure----
# --send call dml_operations()
# --echo
--disable_query_log
--let $i=30
while($i)
{
--EVAL INSERT INTO t1(a) VALUES(NULL);
--dec $i
}
--enable_query_log--let $rpl_connection_name= server1
--source include/rpl_connection.inc# Wait until some data is entered into table t1 to ensure that the server1
# will get killed while there are dml operations running on it
--let $wait_condition= SELECT COUNT(*) >20 FROM t1
--source include/wait_condition.inc# Kill server1
--echo # killing
--let $restart_parameters=restart:--group_replication_local_address=$group_replication_local_address --group_replication_group_seeds=$group_replication_group_seeds --group_replication_group_name=$group_replication_group_name
--replace_result $group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME--source ../inc/kill_and_restart_mysqld.inc
--echo # restarting--exec date# Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Wait until group has only 2 members, that is, server1 death is detected by
# the group.
--echo # check that there are 2 members in the group
--let $group_replication_number_of_members= 2
--source ../inc/gr_wait_for_number_of_members.inc# --let $rpl_server_number= 1
# --source include/rpl_reconnect.inc
--let $rpl_connection_name= server2
--source include/rpl_connection.inc--let $_rpl_server_number = 2
while ($_rpl_server_number <= $rpl_server_count){
--let $rpl_connection_name= server$_rpl_server_number
--source include/rpl_connection.inc
--let $saved_read_only=`SELECT @@GLOBAL.super_read_only;`
if (!$saved_read_only){
--EVAL INSERT INTO t1(a) VALUES(NULL);
--exec date;
}
--inc $_rpl_server_number
}--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
# START GR on server1
--source include/start_group_replication.inc# Sync all the servers.
--source include/rpl_sync.inc# Verify that all the tables have same data.
--let $diff_tables=server_1:t1, server2:t1, server3:t1
--source include/diff_tables.incdrop table t1;--source ../inc/group_replication_end.inc

  

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,493
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,133
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,297