Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB8-87, FB8-119: Supporting dynamic scheduling in MTS #999

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mysql-test/r/all_persisted_variables.result
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ include/assert.inc ['Expect 500+ variables in the table. Due to open Bugs, we ar

# Test SET PERSIST

include/assert.inc ['Expect 398 persisted variables in the table. Due to open Bugs, we are checking for 392']
include/assert.inc ['Expect 399 persisted variables in the table. Due to open Bugs, we are checking for 393']

************************************************************
* 3. Restart server, it must preserve the persisted variable
* settings. Verify persisted configuration.
************************************************************
# restart

include/assert.inc ['Expect 392 persisted variables in persisted_variables table.']
include/assert.inc ['Expect 392 persisted variables shown as PERSISTED in variables_info table.']
include/assert.inc ['Expect 392 persisted variables with matching peristed and global values.']
include/assert.inc ['Expect 393 persisted variables in persisted_variables table.']
include/assert.inc ['Expect 393 persisted variables shown as PERSISTED in variables_info table.']
include/assert.inc ['Expect 393 persisted variables with matching peristed and global values.']

************************************************************
* 4. Test RESET PERSIST IF EXISTS. Verify persisted variable
Expand Down
1 change: 1 addition & 0 deletions mysql-test/r/dd_is_compatibility_cs.result
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ RESOURCE_GROUPS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SLAVE_DB_LOAD
STATISTICS
ST_GEOMETRY_COLUMNS
ST_SPATIAL_REFERENCE_SYSTEMS
Expand Down
6 changes: 5 additions & 1 deletion mysql-test/r/information_schema_cs.result
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ RESOURCE_GROUPS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SLAVE_DB_LOAD
STATISTICS
ST_GEOMETRY_COLUMNS
ST_SPATIAL_REFERENCE_SYSTEMS
Expand Down Expand Up @@ -847,7 +848,7 @@ table_schema IN ('mysql', 'information_schema', 'test', 'mysqltest')
AND table_name not like 'ndb%' AND table_name COLLATE utf8_general_ci not like 'innodb_%'
GROUP BY TABLE_SCHEMA;
TABLE_SCHEMA count(*)
information_schema 36
information_schema 37
mysql 31
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
Expand Down Expand Up @@ -1312,6 +1313,7 @@ RESOURCE_GROUPS information_schema.RESOURCE_GROUPS 1
ROUTINES information_schema.ROUTINES 1
SCHEMATA information_schema.SCHEMATA 1
SCHEMA_PRIVILEGES information_schema.SCHEMA_PRIVILEGES 1
SLAVE_DB_LOAD information_schema.SLAVE_DB_LOAD 1
STATISTICS information_schema.STATISTICS 1
ST_GEOMETRY_COLUMNS information_schema.ST_GEOMETRY_COLUMNS 1
ST_SPATIAL_REFERENCE_SYSTEMS information_schema.ST_SPATIAL_REFERENCE_SYSTEMS 1
Expand Down Expand Up @@ -2444,6 +2446,7 @@ RESOURCE_GROUPS RESOURCE_GROUP_NAME
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SLAVE_DB_LOAD DB
STATISTICS TABLE_SCHEMA
ST_GEOMETRY_COLUMNS TABLE_SCHEMA
ST_SPATIAL_REFERENCE_SYSTEMS SRS_NAME
Expand Down Expand Up @@ -2499,6 +2502,7 @@ RESOURCE_GROUPS RESOURCE_GROUP_NAME
ROUTINES ROUTINE_SCHEMA
SCHEMATA SCHEMA_NAME
SCHEMA_PRIVILEGES TABLE_SCHEMA
SLAVE_DB_LOAD DB
STATISTICS TABLE_SCHEMA
ST_GEOMETRY_COLUMNS TABLE_SCHEMA
ST_SPATIAL_REFERENCE_SYSTEMS SRS_NAME
Expand Down
1 change: 1 addition & 0 deletions mysql-test/r/information_schema_db.result
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RESOURCE_GROUPS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SLAVE_DB_LOAD
STATISTICS
ST_GEOMETRY_COLUMNS
ST_SPATIAL_REFERENCE_SYSTEMS
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/mysqld--help-notwin.result
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,13 @@ The following options may be given as the first argument:
--min-examined-row-limit=#
Don't write queries to slow log that examine fewer rows
than that
--mts-dynamic-rebalance
Shuffle DB's within workers periodically for load
balancing
--mts-imbalance-threshold[=#]
Threshold to trigger worker thread rebalancing. This
parameter denotes the percent load on the most loaded
worker.
--myisam-block-size=#
Block size to be used for MyISAM index pages
--myisam-data-pointer-size=#
Expand Down Expand Up @@ -1601,6 +1608,8 @@ max-user-connections 0
max-write-lock-count 18446744073709551615
memlock FALSE
min-examined-row-limit 0
mts-dynamic-rebalance FALSE
mts-imbalance-threshold 90
myisam-block-size 1024
myisam-data-pointer-size 6
myisam-max-sort-file-size 9223372036853727232
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/r/mysqlshow_cs.result
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Database: information_schema
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SLAVE_DB_LOAD |
| STATISTICS |
| ST_GEOMETRY_COLUMNS |
| ST_SPATIAL_REFERENCE_SYSTEMS |
Expand Down Expand Up @@ -206,6 +207,7 @@ Database: INFORMATION_SCHEMA
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SLAVE_DB_LOAD |
| STATISTICS |
| ST_GEOMETRY_COLUMNS |
| ST_SPATIAL_REFERENCE_SYSTEMS |
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/funcs_1/r/is_columns_is_cs.result
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 170 512 NUL
def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NULL
def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NULL
def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(3) select NULL
def information_schema SLAVE_DB_LOAD DB 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(192) select NULL
def information_schema SLAVE_DB_LOAD WORKER 2 NO bigint NULL NULL NULL NULL NULL NULL NULL bigint(21) unsigned select NULL
def information_schema SLAVE_DB_LOAD DB_LOAD 3 NO bigint NULL NULL NULL NULL NULL NULL NULL bigint(21) unsigned select NULL
def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) select NULL
def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) select NULL
def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) select NULL
Expand Down Expand Up @@ -720,6 +723,9 @@ NULL information_schema SCHEMATA SQL_PATH binary 0 0 NULL NULL binary(0)
3.0476 information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA varchar 21 64 utf8 utf8_general_ci varchar(64)
3.0476 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 21 64 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 1 3 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SLAVE_DB_LOAD DB varchar 64 192 utf8 utf8_general_ci varchar(192)
NULL information_schema SLAVE_DB_LOAD WORKER bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema SLAVE_DB_LOAD DB_LOAD bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 64 192 utf8 utf8_bin varchar(64)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_bin varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_bin varchar(64)
Expand Down
46 changes: 46 additions & 0 deletions mysql-test/suite/funcs_1/r/is_tables_is.result
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SLAVE_DB_LOAD
TABLE_TYPE SYSTEM VIEW
ENGINE NULL
VERSION 10
ROW_FORMAT NULL
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT #AI#
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE NULL
Expand Down Expand Up @@ -1370,6 +1393,29 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME SLAVE_DB_LOAD
TABLE_TYPE SYSTEM VIEW
ENGINE NULL
VERSION 10
ROW_FORMAT NULL
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT #AI#
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE NULL
Expand Down
28 changes: 28 additions & 0 deletions mysql-test/suite/rpl/r/rpl_slave_db_load_table.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
include/rpl_restart_server.inc [server_number=2]
set global mts_dynamic_rebalance=TRUE;
set global slave_parallel_workers=2;
set global debug="+d,skip_checkpoint_load_reset";
start slave;
select * from information_schema.slave_db_load;
DB WORKER DB_LOAD
create table t1 (a int);
insert into t1 values(1);
insert into t1 values(1);
insert into t1 values(1);
insert into t1 values(1);
insert into t1 values(1);
select * from information_schema.slave_db_load;
DB WORKER DB_LOAD
test 1 6
stop slave;
set global mts_dynamic_rebalance=0;
set global slave_parallel_workers=0;
set global debug="-d,skip_checkpoint_load_reset";
start slave;
drop table t1;
include/rpl_end.inc
45 changes: 45 additions & 0 deletions mysql-test/suite/rpl/t/rpl_slave_db_load_table.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This test verifies the functionality of slave_db_load table.

source include/have_debug.inc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swap these 2 includes

source include/master-slave.inc;

let rpl_server_number=2;
source include/rpl_stop_server.inc;

source include/rpl_connection_slave.inc;
let $old_mts_dynamic_rebalance= `select @@global.mts_dynamic_rebalance`;
let $old_slave_parallel_workers= `select @@global.slave_parallel_workers`;
set global mts_dynamic_rebalance=TRUE;
set global slave_parallel_workers=2;
set global debug="+d,skip_checkpoint_load_reset";
source include/start_slave.inc;

# Load should be empty
select * from information_schema.slave_db_load;

source include/rpl_connection_master.inc;
create table t1 (a int);
let $num_inserts=5;
while ($num_inserts)
{
insert into t1 values(1);
dec $num_inserts;
}

source include/sync_slave_sql_with_master.inc;

source include/rpl_connection_slave.inc;
# Load of test should be 6 (1 create and 5 inserts)
select * from information_schema.slave_db_load;

# restore varaibles
source include/stop_slave.inc;
eval set global mts_dynamic_rebalance=$old_mts_dynamic_rebalance;
eval set global slave_parallel_workers=$old_slave_parallel_workers;
set global debug="-d,skip_checkpoint_load_reset";
source include/start_slave.inc;

source include/rpl_connection_master.inc;
drop table t1;

source include/rpl_end.inc;
21 changes: 21 additions & 0 deletions mysql-test/suite/sys_vars/r/mts_dynamic_rebalance_basic.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set @save.mts_dynamic_rebalance= @@global.mts_dynamic_rebalance;
select @@session.mts_dynamic_rebalance;
ERROR HY000: Variable 'mts_dynamic_rebalance' is a GLOBAL variable
select variable_name from performance_schema.global_variables where variable_name='$var';
variable_name
select variable_name from performance_schema.session_variables where variable_name='$var';
variable_name
set @@global.mts_dynamic_rebalance= false;
select @@global.mts_dynamic_rebalance;
@@global.mts_dynamic_rebalance
0
set @@global.mts_dynamic_rebalance= 1.1;
ERROR 42000: Incorrect argument type to variable 'mts_dynamic_rebalance'
set @@global.mts_dynamic_rebalance= "foo";
ERROR 42000: Variable 'mts_dynamic_rebalance' can't be set to the value of 'foo'
set @@global.mts_dynamic_rebalance= false;
set @@global.mts_dynamic_rebalance= true;
select @@global.mts_dynamic_rebalance as "truncated to the maximum";
truncated to the maximum
1
set @@global.mts_dynamic_rebalance= @save.mts_dynamic_rebalance;
23 changes: 23 additions & 0 deletions mysql-test/suite/sys_vars/r/mts_imbalance_threshold_basic.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set @save.mts_imbalance_threshold= @@global.mts_imbalance_threshold;
select @@session.mts_imbalance_threshold;
ERROR HY000: Variable 'mts_imbalance_threshold' is a GLOBAL variable
select variable_name from performance_schema.global_variables where variable_name='$var';
variable_name
select variable_name from performance_schema.session_variables where variable_name='$var';
variable_name
set @@global.mts_imbalance_threshold= 0.0;
select @@global.mts_imbalance_threshold;
@@global.mts_imbalance_threshold
0.000000
set @@global.mts_imbalance_threshold= test;
ERROR 42000: Incorrect argument type to variable 'mts_imbalance_threshold'
set @@global.mts_imbalance_threshold= "foo";
ERROR 42000: Incorrect argument type to variable 'mts_imbalance_threshold'
set @@global.mts_imbalance_threshold= 0;
set @@global.mts_imbalance_threshold= cast(-1 as unsigned int);
Warnings:
Warning 1292 Truncated incorrect mts_imbalance_threshold value: '1.8446744073709552e19'
select @@global.mts_imbalance_threshold as "truncated to the maximum";
truncated to the maximum
100.000000
set @@global.mts_imbalance_threshold= @save.mts_imbalance_threshold;
37 changes: 37 additions & 0 deletions mysql-test/suite/sys_vars/t/mts_dynamic_rebalance_basic.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
let $var= mts_dynamic_rebalance;
eval set @save.$var= @@global.$var;

#
# exists as global only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval select @@session.$var;

select variable_name from performance_schema.global_variables where variable_name='$var';
select variable_name from performance_schema.session_variables where variable_name='$var';

#
# show that it's writable
#
let $value= false;
eval set @@global.$var= $value;
eval select @@global.$var;

#
# incorrect value
#
--error ER_WRONG_TYPE_FOR_VAR
eval set @@global.$var= 1.1;
--error ER_WRONG_VALUE_FOR_VAR
eval set @@global.$var= "foo";

#
# min/max values
#
eval set @@global.$var= false;
eval set @@global.$var= true;
eval select @@global.$var as "truncated to the maximum";

# cleanup

eval set @@global.$var= @save.$var;
38 changes: 38 additions & 0 deletions mysql-test/suite/sys_vars/t/mts_imbalance_threshold_basic.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

let $var= mts_imbalance_threshold;
eval set @save.$var= @@global.$var;

#
# exists as global only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval select @@session.$var;

select variable_name from performance_schema.global_variables where variable_name='$var';
select variable_name from performance_schema.session_variables where variable_name='$var';

#
# show that it's writable
#
let $value= 0.0;
eval set @@global.$var= $value;
eval select @@global.$var;

#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
eval set @@global.$var= test;
--error ER_WRONG_TYPE_FOR_VAR
eval set @@global.$var= "foo";

#
# min/max values
#
eval set @@global.$var= 0;
eval set @@global.$var= cast(-1 as unsigned int);
eval select @@global.$var as "truncated to the maximum";

# cleanup

eval set @@global.$var= @save.$var;
Loading