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 各模块 我 ...
随机推荐
- (matlab)plot画图的颜色线型(转)
http://wenku.baidu.com/link?url=SVVMVH8QlDIu2hVKDtoBYs6l0CnQvFnFHJJ9yexmYVKQqhz47qIr7aK7LOf8nN0qNdy8 ...
- Alpha 冲刺报告(10/10)
Alpha 冲刺报告(10/10) 队名:洛基小队 峻雄(组长) 已完成:阿尔法版的ppt 明日计划:总结阿尔法版的问题 剩余任务:角色属性脚本的完整版本 困难:缺乏编码经验,编码进度比较慢 ---- ...
- C# 页面调用控制台应用程序
var rootPath = System.Configuration.ConfigurationManager.AppSettings["rootPath"]; Process. ...
- Scala学习——Brief Scala Tutorial
因为Spark项目需要,学习Scala编程. 从官网文档入手:http://www.scala-lang.org/documentation/ 首先从他的Older Documentation入手. ...
- 【AT987】高橋君
题目 成爷爷一眼秒,\(tql!!!\) 多组询问,求 \[\sum_{i=0}^kC_{n}^i \] 发现\(k<=n\)啊,于是我们可以把一组询问抽象成一个区间\([k,n]\) 左指针的 ...
- 【洛谷】【线段树】P1471 方差
[题目背景:] 滚粗了的HansBug在收拾旧数学书,然而他发现了什么奇妙的东西. [题目描述:] 蒟蒻HansBug在一本数学书里面发现了一个神奇的数列,包含N个实数.他想算算这个数列的平均数和方差 ...
- ddt 数据处理调用excel数据建模
1.数据模型: 2.数据处理 最终返回数据:[(),()] 格式 ddt调用: import ddtimport unittest @ddt.ddtclass Test(unittest.TestCa ...
- 通过ReentrantLock简单了解下并发包中的锁
ReentrantLock在进行实例化时,可以通过构造函数的参数选择是否使用公平锁FairSync或者非公平锁NonfairSync,两者的区别比较简单,如果是公平锁则新来的线程会先检测同步队列中是否 ...
- BZOJ 3168 Heoi2013 钙铁锌硒维生素 矩阵求逆+匈牙利算法
题目大意:给定一个n∗n的满秩矩阵A和一个n∗n的矩阵B.求一个字典序最小的1...n的排列a满足将随意一个Ai换成Bai后矩阵A仍然满秩 我们考虑建立一个二分图.假设Ai能换成Bj.就在i−> ...
- Hbase-0.96.2全然分布式安装部署
Hbase-0.96.2全然分布式安装部署 环境: Hadoop-2.2.0 Zookeeper-3.4.6 hbase-0.96.2 1.下载hbase-0.96.2-hadoop2-bin.tar ...