Skip to content

Commit 2da1917

Browse files
committed
Attempt to eliminate race conditions in rocksdb.information_schema
1 parent c481fc9 commit 2da1917

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

storage/rocksdb/mysql-test/rocksdb/r/information_schema.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DROP TABLE IF EXISTS t1;
22
DROP TABLE IF EXISTS t2;
33
DROP TABLE IF EXISTS t3;
4+
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK=1;
45
create table t1 (a int) engine=rocksdb;
56
drop table t1;
67
select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO;
@@ -12,6 +13,7 @@ DDL_DROP_INDEX_ONGOING cf_id:0,index_id:max_index_id
1213
select count(*) from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO;
1314
count(*)
1415
4
16+
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK=0;
1517
select VALUE into @keysIn from INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS where CF_NAME = 'default' and LEVEL = 'Sum' and TYPE = 'KeyIn';
1618
CREATE TABLE t1 (i1 INT, i2 INT, PRIMARY KEY (i1)) ENGINE = ROCKSDB;
1719
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);

storage/rocksdb/mysql-test/rocksdb/t/information_schema.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ DROP TABLE IF EXISTS t3;
1313
# is started on a totally empty datadir, where no MyRocks table has
1414
# ever been created). In that case, there is no MAX_INDEX_ID.
1515
# Create/drop a table so that we do have MAX_INDEX_ID.
16+
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK=1;
1617
create table t1 (a int) engine=rocksdb;
1718
drop table t1;
1819

1920
--let $max_index_id = query_get_value(SELECT * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO where type = 'MAX_INDEX_ID', VALUE, 1)
2021
--replace_result $max_index_id max_index_id
2122
select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO;
2223
select count(*) from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO;
24+
SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK=0;
2325

2426
select VALUE into @keysIn from INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS where CF_NAME = 'default' and LEVEL = 'Sum' and TYPE = 'KeyIn';
2527

0 commit comments

Comments
 (0)