Skip to content

Commit

Permalink
Report per column family metadata in SHOW ENGINE ROCKSDB STATUS
Browse files Browse the repository at this point in the history
Summary:
Report the currently available per column family statistics from rocksdb.
Each column family is reported on a separate row. DB stats is on a
separate row. The output is similar to the output from rocksdb's LOG
file.

Since column families aren't currently being cleaned up after a table is
dropped, the show_engine test needs to force the mysql server to
restart. Otherwise, SHOW ENGINE rocksdb STATUS can produce results for
column families whose tables/indicies have been removed.

@update-submodule: rocksdb

Test Plan: mysqltest.sh

Reviewers: maykov, yoshinorim, spetrunia, jonahcohen

Reviewed By: jonahcohen

Differential Revision: https://reviews.facebook.net/D32217
  • Loading branch information
Herman Lee authored and jtolmer committed Jan 5, 2016
1 parent cc6c665 commit 6cb22af
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 15 deletions.
22 changes: 22 additions & 0 deletions mysql-test/suite/rocksdb/r/show_engine.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
CREATE TABLE t1 (i INT, PRIMARY KEY (i) COMMENT 'cf_t1') ENGINE = ROCKSDB;
CREATE TABLE t2 (j INT, PRIMARY KEY (j) COMMENT 'cf_t2') ENGINE = ROCKSDB;
CREATE TABLE t3 (k INT, PRIMARY KEY (k) COMMENT 'cf_t1') ENGINE = ROCKSDB;
CREATE TABLE t4 (l INT, PRIMARY KEY (l) COMMENT 'cf_t4') ENGINE = ROCKSDB;
SHOW ENGINE rocksdb STATUS;
Type Name Status
DB db #
COMPACTION cf_t1 #
COMPACTION cf_t2 #
COMPACTION cf_t4 #
COMPACTION default #
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
SHOW ENGINE rocksdb MUTEX;
Type Name Status
SHOW ENGINE ALL MUTEX;
3 changes: 2 additions & 1 deletion mysql-test/suite/rocksdb/show_engine.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SHOW ENGINE rocksdb STATUS;
Type Name Status
ROCKSDB live_files #
DB db #
COMPACTION default #
SHOW ENGINE rocksdb MUTEX;
Type Name Status
SHOW ENGINE ALL MUTEX;
14 changes: 0 additions & 14 deletions mysql-test/suite/rocksdb/show_engine.test

This file was deleted.

1 change: 1 addition & 0 deletions mysql-test/suite/rocksdb/t/show_engine-master.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--force-restart
30 changes: 30 additions & 0 deletions mysql-test/suite/rocksdb/t/show_engine.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# SHOW ENGINE STATUS command
# Checking that the command doesn't produce an error.
# If it starts producing an actual result, the result file
# will need to be updated, and possibly masked.

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
--enable_warnings

CREATE TABLE t1 (i INT, PRIMARY KEY (i) COMMENT 'cf_t1') ENGINE = ROCKSDB;
CREATE TABLE t2 (j INT, PRIMARY KEY (j) COMMENT 'cf_t2') ENGINE = ROCKSDB;
CREATE TABLE t3 (k INT, PRIMARY KEY (k) COMMENT 'cf_t1') ENGINE = ROCKSDB;
CREATE TABLE t4 (l INT, PRIMARY KEY (l) COMMENT 'cf_t4') ENGINE = ROCKSDB;
--replace_column 3 #
SHOW ENGINE rocksdb STATUS;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;

SHOW ENGINE rocksdb MUTEX;
# For SHOW ALL MUTEX even the number of lines is volatile, so the result logging is disabled
--disable_result_log
SHOW ENGINE ALL MUTEX;
--enable_result_log

0 comments on commit 6cb22af

Please sign in to comment.