fix a bug about sync mysqltest
This commit is contained in:
31
tools/deploy/mysql_test/include/check_all_idx_ok.inc
Normal file
31
tools/deploy/mysql_test/include/check_all_idx_ok.inc
Normal file
@ -0,0 +1,31 @@
|
||||
#--disable_query_log
|
||||
#--disable_result_log
|
||||
#
|
||||
#let $index_status_expect = 2;
|
||||
#let $result = 2;
|
||||
#
|
||||
#connect (obsys_caio,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
#connection obsys_caio;
|
||||
#let $i=210;
|
||||
#while($i>0)
|
||||
#{
|
||||
# sleep 1;
|
||||
# #--echo $index_name
|
||||
# ## let $result = query_get_value(select count(*) from oceanbase.__all_virtual_table where table_name like '__idx_%' and index_status!=2,count(*),1);
|
||||
# let $result = query_get_value(select count(*) from oceanbase.__all_virtual_table as t join oceanbase.__all_virtual_database as d where t.tenant_id = d.tenant_id and t.database_id = d.database_id and d.in_recyclebin = false and d.database_name != "__recyclebin" and t.table_name like '__idx_%' and t.index_status!=2,count(*),1);
|
||||
# if($result == 0)
|
||||
# {
|
||||
# let $i = -4;
|
||||
# }
|
||||
# dec $i;
|
||||
#}
|
||||
#sleep 2;
|
||||
#if($i != -5)
|
||||
#{
|
||||
# let $table_id = query_get_value(select table_id from oceanbase.__all_virtual_table as t join oceanbase.__all_virtual_database as d where t.tenant_id = d.tenant_id and t.database_id = d.database_id and d.in_recyclebin = false and d.database_name != "__recyclebin" and t.table_name like '__idx_%' and t.index_status!=2 limit 1,table_id,1);
|
||||
# --echo $result idx is build failed, first table id is $table_id
|
||||
#}
|
||||
#disconnect obsys_caio;
|
||||
#connection default;
|
||||
#--enable_query_log
|
||||
#--enable_result_log
|
||||
9
tools/deploy/mysql_test/include/check_ob_or_mysql.inc
Normal file
9
tools/deploy/mysql_test/include/check_ob_or_mysql.inc
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
let $cluster_is_ob = 1;
|
||||
let $cluster_is_mysql = 0;
|
||||
let $collation_count = query_get_value(select count(1) as cnt from information_schema.COLLATIONS, cnt, 1);
|
||||
if ($collation_count > 100) {
|
||||
let $cluster_is_ob = 0;
|
||||
let $cluster_is_mysql = 1;
|
||||
}
|
||||
|
||||
22
tools/deploy/mysql_test/include/check_schema_sync.inc
Normal file
22
tools/deploy/mysql_test/include/check_schema_sync.inc
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
connect (ob_sys_check_schema,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection ob_sys_check_schema;
|
||||
|
||||
let $i = 10;
|
||||
while($i > 0)
|
||||
{
|
||||
sleep 1;
|
||||
let $cnt = query_get_value(select count(*) as cnt from oceanbase.__all_virtual_server_schema_info as a join oceanbase.__all_virtual_server_schema_info as b on a.tenant_id = b.tenant_id where a.refreshed_schema_version != b.refreshed_schema_version, cnt, 1);
|
||||
dec $i;
|
||||
if ($cnt == 0)
|
||||
{
|
||||
let $i = -4;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i != -4)
|
||||
{
|
||||
--echo check schema sync timeout
|
||||
eval select * from oceanbase.__all_virtual_server_schema_info;
|
||||
}
|
||||
disconnect ob_sys_check_schema;
|
||||
25
tools/deploy/mysql_test/include/check_stat.inc
Normal file
25
tools/deploy/mysql_test/include/check_stat.inc
Normal file
@ -0,0 +1,25 @@
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
connection default;
|
||||
let $tenant_id = query_get_value(select effective_tenant_id() as ID from dual, ID, 1);
|
||||
connect (obsys_ydm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_ydm;
|
||||
let $__i__= 100;
|
||||
while($__i__ > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $__i__;
|
||||
|
||||
## 检查有没有分区的列级统计信息还没有汇报上来
|
||||
let $__num__ = query_get_value(select count(*) as num from oceanbase.__all_virtual_meta_table a where a.tenant_id = $tenant_id and not exists (select 1 from oceanbase.__all_virtual_column_statistic b where a.table_id = b.table_id and a.partition_id = b.partition_id and b.tenant_id = $tenant_id), num, 1);
|
||||
if($__num__ == 0)
|
||||
{
|
||||
let $__i__ = -5;
|
||||
}
|
||||
}
|
||||
|
||||
connection default;
|
||||
disconnect obsys_ydm;
|
||||
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
24
tools/deploy/mysql_test/include/check_tenant_sync.inc
Normal file
24
tools/deploy/mysql_test/include/check_tenant_sync.inc
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
let $server_cnt = query_get_value(select count(*) as cnt from oceanbase.__all_server, cnt, 1);
|
||||
|
||||
let $schema_version = query_get_value(select max(schema_version) as max_schema_version from oceanbase.__all_tenant_history, max_schema_version, 1);
|
||||
|
||||
let $sync_cnt = 0;
|
||||
|
||||
let $i = 10;
|
||||
while($i > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $i;
|
||||
let $sync_cnt = query_get_value(select count(*) as cnt from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version >= $schema_version and tenant_id = 1, cnt, 1);
|
||||
if ($sync_cnt == $server_cnt)
|
||||
{
|
||||
let $i = -4;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i != -4)
|
||||
{
|
||||
--echo check tenant sync timeout, sync_cnt:$sync_cnt, server_cnt:$server_cnt
|
||||
eval select * from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version >= $schema_version and tenant_id = 1;
|
||||
}
|
||||
32
tools/deploy/mysql_test/include/get_tenant_server.inc
Normal file
32
tools/deploy/mysql_test/include/get_tenant_server.inc
Normal file
@ -0,0 +1,32 @@
|
||||
## 功能: 获取指定租户的ip&port
|
||||
# 1.最好使用前sleep下,否则tenant_schema有可能还未刷到server上导致连接不上
|
||||
# 2.如果分布于多个server,取unit_id最小的
|
||||
## 用法:
|
||||
# 1.设置待连接的tenant_name
|
||||
# 2.source本文件
|
||||
# 3.connect
|
||||
## 模板:
|
||||
# sleep 3;
|
||||
# let $__tenant_name__ = 'tt1';
|
||||
# --source mysql_test/include/get_tenant_server.inc
|
||||
# connect (conn1,$TE_SERVER_IP,root@tt1,,*NO-ONE*,$TE_SERVER_PORT);
|
||||
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
connect (obsys,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys;
|
||||
let $__tenant_id__ = `select tenant_id from oceanbase.__all_tenant where tenant_name = $__tenant_name__ limit 1`;
|
||||
let $__resource_pool_id__ = `select resource_pool_id from oceanbase.__all_resource_pool where tenant_id = $__tenant_id__ limit 1`;
|
||||
|
||||
let $__svr_ip__ = `select svr_ip from oceanbase.__all_unit where resource_pool_id = $__resource_pool_id__ limit 1`;
|
||||
let $__svr_port__ = `select svr_port from oceanbase.__all_unit where resource_pool_id = $__resource_pool_id__ limit 1`;
|
||||
|
||||
let $__inner_port__ = `select inner_port from oceanbase.__all_server where svr_ip = '$__svr_ip__' and svr_port = $__svr_port__ limit 1`;
|
||||
|
||||
let $TE_SERVER_IP = $__svr_ip__;
|
||||
let $TE_SERVER_PORT = $__inner_port__;
|
||||
disconnect obsys;
|
||||
connection default;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
6
tools/deploy/mysql_test/include/index_quick_major.inc
Normal file
6
tools/deploy/mysql_test/include/index_quick_major.inc
Normal file
@ -0,0 +1,6 @@
|
||||
connect (obsys_idm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_idm;
|
||||
set ob_enable_index_direct_select=1;
|
||||
alter system set merger_check_interval = '10s';
|
||||
disconnect obsys_idm;
|
||||
connection default;
|
||||
5
tools/deploy/mysql_test/include/majorfreeze.inc
Normal file
5
tools/deploy/mysql_test/include/majorfreeze.inc
Normal file
@ -0,0 +1,5 @@
|
||||
connect (obsys,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys;
|
||||
alter system major freeze;
|
||||
disconnect obsys;
|
||||
connection default;
|
||||
5
tools/deploy/mysql_test/include/not_embedded.inc
Normal file
5
tools/deploy/mysql_test/include/not_embedded.inc
Normal file
@ -0,0 +1,5 @@
|
||||
-- require mysql_test/r/not_embedded.require
|
||||
disable_query_log;
|
||||
select version() like '%embedded%' as 'have_embedded';
|
||||
enable_query_log;
|
||||
|
||||
9
tools/deploy/mysql_test/include/proxy_route_to_c.inc
Normal file
9
tools/deploy/mysql_test/include/proxy_route_to_c.inc
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
connection default;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
select * from proxy_mock_table_for_pc;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
|
||||
@ -0,0 +1 @@
|
||||
--replace_regex /REPLICA_NUM = [0-9]*/REPLICA_NUM = 1/g /ROW_FORMAT = (DYNAMIC|COMPRESSED|COMPACT|REDUNDANT)[ ]*//g /(NOCOMPRESS|COMPRESS) (FOR)*[ ]*(BASIC|OLTP|QUERY|ARCHIVE)*[ ]*//g /zstd_1\.3\.8/lz4_1.0/g /OBFK_[0-9]*/OBFK_1234/g /OBPK_[0-9]*/OBPK_1234/g /OBUNIQUE_[0-9]*/OBUNIQUE_1234/g /RECYCLE_\$_[0-9]*_[0-9]*_OBCHECK_[0-9]*/RECYCLE_$_1_2_OBCHECK_3/g /PCTFREE = [0-9]*/PCTFREE = 10/g
|
||||
@ -0,0 +1 @@
|
||||
--replace_regex /REPLICA_NUM = [0-9]*/REPLICA_NUM = NUM/g /ROW_FORMAT = (DYNAMIC|COMPRESSED|COMPACT|REDUNDANT|CONDENSED)[ ]*//g /(NOCOMPRESS|COMPRESS) (FOR)*[ ]*(BASIC|OLTP|QUERY|ARCHIVE)*[ ]*//g /zstd_1\.3\.8/lz4_1.0/g /OBFK_[0-9]*/OBFK_1234/g /OBIDX_[0-9]*/OBIDX_1234/g /OBCHECK_[0-9]*/OBCHECK_1234/g /OBPK_[0-9]*/OBPK_1234/g /OBUNIQUE_[0-9]*/OBUNIQUE_1234/g /zone1;zone2/zone1/g /BLOCK_SIZE = [0-9]*/BLOCK_SIZE = SIZE/g /TABLET_SIZE = [0-9]*/TABLET_SIZE = SIZE/g /ZONE_LIST = \(.*\)/ZONE_LIST = (test)/g /PRIMARY_ZONE = .*/PRIMARY_ZONE = /g /PCTFREE = [0-9]*/PCTFREE = 10/g
|
||||
45
tools/deploy/mysql_test/include/wait_daily_merge.inc
Normal file
45
tools/deploy/mysql_test/include/wait_daily_merge.inc
Normal file
@ -0,0 +1,45 @@
|
||||
#--disable_query_log
|
||||
#--disable_result_log
|
||||
connect (obsys_ydm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_ydm;
|
||||
let $__i__= 600;
|
||||
while($__i__ > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $__i__;
|
||||
let $__forzen_version__ = query_get_value(select value from oceanbase.__all_zone where name = 'frozen_version', value, 1);
|
||||
let $__merged_version__ = query_get_value(select value from oceanbase.__all_zone where name = 'last_merged_version' and zone = '', value, 1);
|
||||
if($__forzen_version__ == $__merged_version__)
|
||||
{
|
||||
let $__i__ = -5;
|
||||
}
|
||||
}
|
||||
|
||||
###判断集群状态,先注释掉
|
||||
#let $__j__= 180;
|
||||
#while($__j__ > 0)
|
||||
#{
|
||||
# sleep 1;
|
||||
# dec $__j__;
|
||||
# let $__global_stat__ = query_get_value(select comment from oceanbase.__all_cluster_stat where name='global_stat',comment, 1);
|
||||
# if($__global_stat__ == NORMAL)
|
||||
# {
|
||||
# let $__j__ = -5;
|
||||
# }
|
||||
#}
|
||||
|
||||
#if($__j__ != -5)
|
||||
#{
|
||||
# --echo major freeze failed
|
||||
#}
|
||||
|
||||
if($__i__ != -5)
|
||||
{
|
||||
--echo major freeze failed
|
||||
}
|
||||
sleep 2;
|
||||
|
||||
disconnect obsys_ydm;
|
||||
connection default;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
Reference in New Issue
Block a user