Skip to content

Commit

Permalink
Make rocksdb.use_direct_reads_writes more robust
Browse files Browse the repository at this point in the history
Upstream commit ID : None
PS-7921 : Merge percona-202105

Summary:

Use an exclusive name for the log error file so concurrent executions of
the test don't try to use the same file.
  • Loading branch information
Luis Donoso committed Oct 28, 2021
1 parent 03a46d9 commit 0eae182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mysql-test/suite/rocksdb/r/use_direct_reads_writes.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# restart:--log-error=MYSQLTEST_VARDIR/tmp/rocksdb.use_direct_reads_writes.err --rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1
# restart:--log-error=/home/ldonoso/src/percona-server-bld/mysql-test/var/1/tmp/rocksdb.use_direct_reads_writes_SERVER_UUID.err --rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1
Pattern "enable both use_direct_reads" found
# restart:--log-error=MYSQLTEST_VARDIR/tmp/rocksdb.use_direct_reads_writes.err --rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1
# restart:--log-error=/home/ldonoso/src/percona-server-bld/mysql-test/var/1/tmp/rocksdb.use_direct_reads_writes_SERVER_UUID.err --rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1
Pattern "enable both use_direct_io_for_flush_and_compaction" found
# restart
5 changes: 4 additions & 1 deletion mysql-test/suite/rocksdb/t/use_direct_reads_writes.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
# caused an assertion in RocksDB. Now it should not be allowed and the
# plugin will not initialize with that configuration

--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/rocksdb.use_direct_reads_writes.err
--let $SERVER_UUID = `SELECT @@global.server_uuid`
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/rocksdb.use_direct_reads_writes_$SERVER_UUID.err

# Expect MyRocks to fail to initialize with invalid combination of arguments
--let $restart_parameters=restart:--log-error=$SEARCH_FILE --rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $SERVER_UUID SERVER_UUID
--source include/restart_mysqld.inc

# We should now have an error message
Expand All @@ -20,6 +22,7 @@
# Repeat with --rocksdb-use-direct-writes
--let $restart_parameters=restart:--log-error=$SEARCH_FILE --rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_result $SERVER_UUID SERVER_UUID
--source include/restart_mysqld.inc

# We should now have an error message
Expand Down

0 comments on commit 0eae182

Please sign in to comment.