From 4a5d8abb9b6332e8752b3efea6580a39f1503f65 Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Thu, 15 Feb 2018 12:00:27 -0800 Subject: [PATCH] Remove truncate error log from rocksdb.rocksdb_checksums test Summary: Restart the test using a new error log instead of truncating the old error log. Also reduce the number of rows from 10000 to 4000 to speed up the test. Reviewed By: asandryh Differential Revision: D7003203 fbshipit-source-id: ac6af1309e1 --- .../suite/rocksdb/r/rocksdb_checksums.result | 6 ++--- .../suite/rocksdb/t/rocksdb_checksums.test | 24 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/rocksdb_checksums.result b/mysql-test/suite/rocksdb/r/rocksdb_checksums.result index 87243c05e2ab..cf9825fbbb9d 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb_checksums.result +++ b/mysql-test/suite/rocksdb/r/rocksdb_checksums.result @@ -52,9 +52,9 @@ create table t4 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksd check table t4; Table Op Msg_type Msg_text test.t4 check status OK -10000 index entries had around 500 checksums -10000 index entries had around 500 checksums -Around 500 table records had checksums +4000 index entries had around 200 checksums +4000 index entries had around 200 checksums +Around 200 table records had checksums set session rocksdb_checksums_pct=100; # # Ok, table t2 has all rows with checksums. Simulate a few checksum mismatches. diff --git a/mysql-test/suite/rocksdb/t/rocksdb_checksums.test b/mysql-test/suite/rocksdb/t/rocksdb_checksums.test index 7e5c61386f2c..8648aa229178 100644 --- a/mysql-test/suite/rocksdb/t/rocksdb_checksums.test +++ b/mysql-test/suite/rocksdb/t/rocksdb_checksums.test @@ -5,24 +5,25 @@ # --source include/have_debug.inc +--let LOG=$MYSQLTEST_VARDIR/tmp/rocksdb_checksum.err +--let $_mysqld_option=--log-error=$LOG +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--source include/restart_mysqld_with_option.inc + set @save_rocksdb_store_row_debug_checksums=@@global.rocksdb_store_row_debug_checksums; set @save_rocksdb_verify_row_debug_checksums=@@global.rocksdb_verify_row_debug_checksums; set @save_rocksdb_checksums_pct=@@global.rocksdb_checksums_pct; -# wiping mysql log for repeatable tests ---exec echo "" > $MYSQLTEST_VARDIR/log/mysqld.1.err - --disable_warnings drop table if exists t1,t2,t3; --enable_warnings --- exec echo "" > $MYSQLTEST_VARDIR/log/mysqld.1.err show variables like 'rocksdb_%checksum%'; create table t1 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb; insert into t1 values (1,1,1),(2,2,2),(3,3,3); check table t1; ---exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t1" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 +--exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t1" $LOG | cut -d] -f2 drop table t1; @@ -30,7 +31,7 @@ set session rocksdb_store_row_debug_checksums=on; create table t2 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb; insert into t2 values (1,1,1),(2,2,2),(3,3,3); check table t2; ---exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t2" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 +--exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t2" $LOG | cut -d] -f2 --echo # Now, make a table that has both rows with checksums and without create table t3 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb; @@ -39,7 +40,7 @@ set session rocksdb_store_row_debug_checksums=off; update t3 set b=3 where a=2; set session rocksdb_store_row_debug_checksums=on; check table t3; ---exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t3" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 +--exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t3" $LOG | cut -d] -f2 set session rocksdb_store_row_debug_checksums=on; set session rocksdb_checksums_pct=5; @@ -47,7 +48,7 @@ create table t4 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksd --disable_query_log let $i=0; let $x= 100000; -while ($i<10000) +while ($i<4000) { inc $i; eval insert t4(pk,a,b) values($i, $i, $i div 10); @@ -56,8 +57,8 @@ while ($i<10000) } --enable_query_log check table t4; ---exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t4" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 > $MYSQL_TMP_DIR/rocksdb_checksums.log ---exec perl suite/rocksdb/t/rocksdb_checksums.pl $MYSQL_TMP_DIR/rocksdb_checksums.log 10000 5 +--exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t4" $LOG | cut -d] -f2 > $MYSQL_TMP_DIR/rocksdb_checksums.log +--exec perl suite/rocksdb/t/rocksdb_checksums.pl $MYSQL_TMP_DIR/rocksdb_checksums.log 4000 5 --remove_file $MYSQL_TMP_DIR/rocksdb_checksums.log set session rocksdb_checksums_pct=100; @@ -124,4 +125,7 @@ set @@global.rocksdb_store_row_debug_checksums=@save_rocksdb_store_row_debug_che set @@global.rocksdb_verify_row_debug_checksums=@save_rocksdb_verify_row_debug_checksums; set @@global.rocksdb_checksums_pct=@save_rocksdb_checksums_pct; +--source include/restart_mysqld.inc +--remove_file $LOG + drop table t2,t3,t4;