-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4401 from ldonoso/PS-7798-5.7
PS 7798 [5.7] - Merge fb-prod202102, fb-prod202103, fb-prod202104
- Loading branch information
Showing
21 changed files
with
775 additions
and
98 deletions.
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
36 changes: 36 additions & 0 deletions
36
mysql-test/suite/rocksdb/r/manual_compaction_bottommost_level.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,36 @@ | ||
CREATE PROCEDURE compact_start() | ||
BEGIN | ||
select variable_value into @c from performance_schema.global_status where variable_name='rocksdb_compact_write_bytes'; | ||
END// | ||
CREATE PROCEDURE compact_end() | ||
BEGIN | ||
select case when variable_value-@c > 0 then 'true' else 'false' end as checked from performance_schema.global_status where variable_name='rocksdb_compact_write_bytes'; | ||
END// | ||
CREATE TABLE t1 ( | ||
a int not null, | ||
b int not null, | ||
primary key (a,b), | ||
key (b) | ||
) ENGINE=RocksDB; | ||
DELETE FROM t1; | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); | ||
checked | ||
true | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); | ||
checked | ||
false | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kForceOptimized'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); | ||
checked | ||
true | ||
DROP PROCEDURE compact_start; | ||
DROP PROCEDURE compact_end; | ||
drop table t1; |
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
3 changes: 3 additions & 0 deletions
3
mysql-test/suite/rocksdb/t/manual_compaction_bottommost_level-master.opt
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,3 @@ | ||
--loose_rocksdb_max_subcompactions=1 | ||
--loose_rocksdb_default_cf_options=target_file_size_base=100k;max_bytes_for_level_multiplier=1;max_bytes_for_level_base=1m;target_file_size_multiplier=1 | ||
|
48 changes: 48 additions & 0 deletions
48
mysql-test/suite/rocksdb/t/manual_compaction_bottommost_level.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,48 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
DELIMITER //; | ||
CREATE PROCEDURE compact_start() | ||
BEGIN | ||
select variable_value into @c from performance_schema.global_status where variable_name='rocksdb_compact_write_bytes'; | ||
END// | ||
CREATE PROCEDURE compact_end() | ||
BEGIN | ||
select case when variable_value-@c > 0 then 'true' else 'false' end as checked from performance_schema.global_status where variable_name='rocksdb_compact_write_bytes'; | ||
END// | ||
DELIMITER ;// | ||
|
||
CREATE TABLE t1 ( | ||
a int not null, | ||
b int not null, | ||
primary key (a,b), | ||
key (b) | ||
) ENGINE=RocksDB; | ||
|
||
# Populate tables | ||
let $max = 1000; | ||
let $table = t1; | ||
--source suite/rocksdb/include/drop_table_repopulate_table.inc | ||
|
||
# compact to move all data in files in Lmax level | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); # should return true as compaction of lower levels is performed | ||
|
||
# skip compaction of files in bottommost level i.e. Lmax->Lmax compaction and ensure rocksdb_compact_write_byte | ||
# does not increase after compaction | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kSkip'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); # should return false as files only in bottommost layer | ||
|
||
# restore 'kForceOptimized' default setting and check that value of rocksdb_compact_write_byte increses after compaction | ||
set @@session.rocksdb_manual_compaction_bottommost_level='kForceOptimized'; | ||
call compact_start(); | ||
set @@global.rocksdb_compact_cf = 'default'; | ||
call compact_end(); # should return true | ||
|
||
# cleanup | ||
DROP PROCEDURE compact_start; | ||
DROP PROCEDURE compact_end; | ||
drop table t1; |
Oops, something went wrong.