Skip to content

Commit

Permalink
Fix rocksdb.non_blocking_manual_compaction
Browse files Browse the repository at this point in the history
Upstream commit ID : None
PS-7921 : Merge percona-202105

Summary:

- The column families are configured properly.
- Test finishes orderly.
  • Loading branch information
Luis Donoso committed Oct 29, 2021
1 parent 4d70bad commit 8594759
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
CREATE TABLE t1 (
a int not null,
b int not null,
primary key (a,b) comment 'cf1',
key (b) comment 'rev:cf2'
primary key (a,b) comment 'cfname=cf1',
key (b) comment 'cfname=rev:cf2'
) ENGINE=ROCKSDB;
DELETE FROM t1;
SET GLOBAL rocksdb_max_manual_compactions = 2;
SET GLOBAL rocksdb_debug_manual_compaction_delay = 3600;
SET GLOBAL rocksdb_debug_manual_compaction_delay = 10;
SET GLOBAL rocksdb_compact_cf='cf1';
SET GLOBAL rocksdb_compact_cf='rev:cf2';
Timeout in wait_condition.inc for select variable_value > 1 from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running'
SET GLOBAL rocksdb_compact_cf='cf1';
ERROR HY000: Internal error: Can't schedule more manual compactions. Increase rocksdb_max_manual_compactions or stop issuing more manual compactions.
SET GLOBAL rocksdb_compact_cf='rev:cf2';
Expand Down
18 changes: 13 additions & 5 deletions mysql-test/suite/rocksdb/t/non_blocking_manual_compaction.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
CREATE TABLE t1 (
a int not null,
b int not null,
primary key (a,b) comment 'cf1',
key (b) comment 'rev:cf2'
primary key (a,b) comment 'cfname=cf1',
key (b) comment 'cfname=rev:cf2'
) ENGINE=ROCKSDB;

# Populate tables
Expand All @@ -16,7 +16,7 @@ let $table = t1;
# Run manual compaction, then restarting mysqld
# and confirming it is not blocked.
SET GLOBAL rocksdb_max_manual_compactions = 2;
SET GLOBAL rocksdb_debug_manual_compaction_delay = 3600;
SET GLOBAL rocksdb_debug_manual_compaction_delay = 10;
connect (con1, localhost, root,,);
connect (con2, localhost, root,,);
connect (con3, localhost, root,,);
Expand All @@ -28,7 +28,7 @@ connection default;
let $wait_condition = select count(*) = 2 from information_schema.processlist where info like 'SET GLOBAL rocksdb_compact_cf%';
--source include/wait_condition.inc

let $wait_condition = select variable_value > 1 from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running';
let $wait_condition = select variable_value >= 1 from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running';
--source include/wait_condition.inc

connection con3;
Expand All @@ -37,12 +37,20 @@ SET GLOBAL rocksdb_compact_cf='cf1';
--error ER_INTERNAL_ERROR
SET GLOBAL rocksdb_compact_cf='rev:cf2';

connection con1;
# the manual compaction is done
reap;

connection con2;
# the manual compaction is done
reap;

connection default;
disconnect con1;
disconnect con2;
disconnect con3;

DROP TABLE t1;

--source include/restart_mysqld.inc
--source include/wait_until_count_sessions.inc
--source include/restart_mysqld.inc

0 comments on commit 8594759

Please sign in to comment.