forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making rocksdb_max_background_compactions dynamic (percona#507) (perc…
…ona#507) Summary: `max_background_compactions` is a mutable option in RocksDB. Making it dynamic in MyRocks as well. Closes facebook/mysql-5.6#507 Differential Revision: D4405189 (facebook/mysql-5.6@d33b268) Pulled By: tianx fbshipit-source-id: 818b7cf1ff4
- Loading branch information
1 parent
518bb9d
commit 4adbde5
Showing
3 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
45 changes: 42 additions & 3 deletions
45
mysql-test/suite/rocksdb_sys_vars/r/rocksdb_max_background_compactions_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 |
---|---|---|
@@ -1,7 +1,46 @@ | ||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO valid_values VALUES(1); | ||
INSERT INTO valid_values VALUES(64); | ||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO invalid_values VALUES('\'abc\''); | ||
SET @start_global_value = @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
SELECT @start_global_value; | ||
@start_global_value | ||
1 | ||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 444. It should fail because it is readonly." | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 444; | ||
ERROR HY000: Variable 'rocksdb_max_background_compactions' is a read only variable | ||
'# Setting to valid values in global scope#' | ||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 1" | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 1; | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
1 | ||
"Setting the global scope variable back to default" | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = DEFAULT; | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
1 | ||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 64" | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 64; | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
64 | ||
"Setting the global scope variable back to default" | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = DEFAULT; | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
1 | ||
"Trying to set variable @@session.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 444. It should fail because it is not session." | ||
SET @@session.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 444; | ||
ERROR HY000: Variable 'rocksdb_max_background_compactions' is a GLOBAL variable and should be set with SET GLOBAL | ||
'# Testing with invalid values in global scope #' | ||
"Trying to set variable @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS to 'abc'" | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = 'abc'; | ||
Got one of the listed errors | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
1 | ||
SET @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS = @start_global_value; | ||
SELECT @@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS; | ||
@@global.ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
1 | ||
DROP TABLE valid_values; | ||
DROP TABLE invalid_values; |
11 changes: 10 additions & 1 deletion
11
mysql-test/suite/rocksdb_sys_vars/t/rocksdb_max_background_compactions_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 |
---|---|---|
@@ -1,7 +1,16 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO valid_values VALUES(1); | ||
INSERT INTO valid_values VALUES(64); | ||
|
||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO invalid_values VALUES('\'abc\''); | ||
|
||
--let $sys_var=ROCKSDB_MAX_BACKGROUND_COMPACTIONS | ||
--let $read_only=1 | ||
--let $read_only=0 | ||
--let $session=0 | ||
--source suite/sys_vars/inc/rocksdb_sys_var.inc | ||
|
||
DROP TABLE valid_values; | ||
DROP TABLE invalid_values; |
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