-
Notifications
You must be signed in to change notification settings - Fork 713
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
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
21
mysql-test/suite/sys_vars/r/mts_dynamic_rebalance_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
mysql-test/suite/sys_vars/r/mts_imbalance_threshold_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
37
mysql-test/suite/sys_vars/t/mts_dynamic_rebalance_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
38
mysql-test/suite/sys_vars/t/mts_imbalance_threshold_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swap these 2 includes