mysql自动化测试第一个例子
################################################################################
# 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.inc set 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.inc drop table t1; --source ../inc/group_replication_end.inc
mysql自动化测试第一个例子的更多相关文章
- 04springMVC结构,mvc模式,spring-mvc流程,spring-mvc的第一个例子,三种handlerMapping,几种控制器,springmvc基于注解的开发,文件上传,拦截器,s
1. Spring-mvc介绍 1.1市面上流行的框架 Struts2(比较多) Springmvc(比较多而且属于上升的趋势) Struts1(即将被淘汰) 其他 1.2 spring-mv ...
- Activity工作流(2)-入门安装运行第一个例子
转: Activity工作流(2)-入门安装运行第一个例子 置顶 2017年05月24日 15:58:50 li_ch_ch 阅读数:24432 版权声明:本文为博主原创文章,未经博主允许不得转载 ...
- ElasticSearch 5学习(5)——第一个例子(很实用)
想要知道ElasticSearch是如何使用的,最快的方式就是通过一个简单的例子,第一个例子将会包括基本概念如索引.搜索.和聚合等,需求是关于公司管理员工的一些业务. 员工文档索引 业务首先需要存储员 ...
- MySQL配置文件my.cnf 例子最详细翻译
转的 MySQL配置文件my.cnf 例子最详细翻译,可以保存做笔记用. #BEGIN CONFIG INFO#DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载 ...
- MXNet学习~第一个例子~跑MNIST
反正基本上是给自己看的,直接贴写过注释后的代码,可能有的地方理解不对,你多担待,看到了也提出来(基本上对未来的自己说的),三层跑到了97%,毕竟是第一个例子,主要就是用来理解MXNet怎么使用. #导 ...
- emberjs学习一(环境和第一个例子)
code { margin: 0; padding: 0; white-space: pre; border: none; background: transparent; } code, pre t ...
- Qt之QCustomPlot绘图(一)配置和第一个例子
最近一个用Qt开发的项目需要绘制坐标曲线,我在老师的指点下使用了QCustomPlot这个插件,使用方法简单,功能还算不错. 可是在网上找了很多资料和博文都只是将官方提供的例子演示一遍,没有系统全面的 ...
- 键盘过滤第一个例子ctrl2cap(4.1~4.4)汇总,测试
键盘过滤第一个例子ctrl2cap(4.1~4.4)汇总,测试 完整源代码 /// /// @file ctrl2cap.c /// @author wowocock /// @date 2009-1 ...
- springmvc的介绍和第一个例子
SpringMVC是Spring 框架自带的一部分. SpringMVC底层基于:Servlet Struts2底层基于:filter struts1底层基于:Servlet spring 各模块 我 ...
随机推荐
- Linux 文件的读写执行权限的说明
文件的读写执行权限的说明 X 进入目录的权限: cd 1.文件本身是可执行的 2.普通用户还具备r的权限 3.root用户只需要有r的权限即可 r 查看目录/文件的内容 :ls dir 没有读的权 限 ...
- 关于layui(layer)子页面获取不到父页面jQuery对象的问题。
如果在使用layui-layer模块过程中,在子页面执行代码: window.parent.$("#id").val() 报错:window.parent.$ is not a f ...
- RAID廉价磁盘冗余阵列介绍
RAID(廉价磁盘冗余阵列)技术主要是为了改善磁盘的访问延迟,增强磁盘的可用性和容错能力.目前服务器级别的计算机都支持插入多块磁盘(8块或者更多),通过使用RAID技术,实现数据在多块磁盘上的并发读写 ...
- REDIS线上问题
这周终于解决了Redis访问经常超时的问题,终于可以踏实睡觉了.从上周就开始纠结在这个问题上,可以用寝食难安来形容,感觉这个问题就像个定时炸弹一样,虽然根据手搜的访问量,极少的Timeout Erro ...
- 智能家居中的物联网网关的可信计算平台模块(TPM)设计
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/BlueCloudMatrix/article/details/24184461 摘要: 随着智能家居 ...
- Vue2+Webpack创建vue项目
相比较AngularJS和ReactJS,VueJS一直以轻量级,易上手称道.MVVM的开发模式也使前端从原先的DOM中解放出来,我们在不需要在维护视图和数据的统一上花大量时间,只需要关注于data的 ...
- Hive学习之路 (四)Hive的连接3种连接方式
一.CLI连接 进入到 bin 目录下,直接输入命令: [hadoop@hadoop3 ~]$ hive SLF4J: Class path contains multiple SLF4J bindi ...
- 图片保持比例,padding的妙用
要保持图片的比例不变 这一张图片在不同分辨率(1980px, 1364px,移动端400px)下均保持了一定的比例不变. 方法: padding以及margin的上下(margin-top | mar ...
- 集合之Vector
在java提高篇(二一)—–ArrayList.java提高篇(二二)—LinkedList,详细讲解了ArrayList.linkedList的原理和实现过程,对于List接口这里还介绍一个它的实现 ...
- smtp ssl模式邮件发送与附件添加
#!/usr/bin/python3 import os import smtplib from email.mime.text import MIMEText from email.mime.mul ...