Commit c354cb66 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-13515: rocksdb.use_direct_reads_writes fails in buildbot with not found pattern

The test mis-used MTR's "restart the server if it crashed or exited"
feature to try starting MyRocks plugin with invalid arguments.

Changed the test to use the --default-storage-engine=myisam which
allows the server to start when MyRocks fails to start.

This removes the need to "start the server with the arguments which
will caused it to fail to start", and so removes the race conditions
with MTR server restart code and  mysqld.*.expect file.
parent 5d1c0d00
call mtr.add_suppression("rocksdb");
call mtr.add_suppression("Aborting");
# This shows that RocksDB plugin is loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
plugin_name plugin_type
ROCKSDB STORAGE ENGINE
# Check that ROCKSDB plugin is not loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
plugin_name plugin_type
# Check that MyRocks has printed an error message into server error log:
FOUND 1 /enable both use_direct_reads/ in mysqld.1.err
# Now, restart the server back with regular settings
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
plugin_name plugin_type
ROCKSDB STORAGE ENGINE
#
# Now, repeat the same with another set of invalid arguments
#
# Check that ROCKSDB plugin is not loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
plugin_name plugin_type
FOUND 1 /enable both use_direct_io_for_flush_and_compaction/ in mysqld.1.err
# Now, restart the server back with regular settings
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
plugin_name plugin_type
ROCKSDB STORAGE ENGINE
......@@ -3,46 +3,46 @@
call mtr.add_suppression("rocksdb");
call mtr.add_suppression("Aborting");
--echo # This shows that RocksDB plugin is loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
# Issue221
# Turning on both --rocksdb-allow-mmap-reads and --rocksdb-use-direct-reads
# caused an assertion in RocksDB. Now it should not be allowed and the
# server will not start with that configuration
# Write file to make mysql-test-run.pl expect the "crash", but don't restart
# the server until it is told to
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" >$_expect_file_name
shutdown_server 10;
# Attempt to restart the server with invalid options
--exec echo "restart:--rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1" >$_expect_file_name
--sleep 0.1 # Wait 100ms - that is how long the sleep is in check_expected_crash_and_restart
--exec echo "restart:" >$_expect_file_name
# Cleanup
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
# We should now have an error message
# caused an assertion in RocksDB. Now it should not be allowed and ROCKSDB
# plugin will not load in such configuration.
#
# We want the server to still start, so we specify default-storage-engine=myisam
--let $_mysqld_option=--rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1 --default-storage-engine=myisam
--source include/restart_mysqld_with_option.inc
--echo # Check that ROCKSDB plugin is not loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
--echo # Check that MyRocks has printed an error message into server error log:
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=enable both use_direct_reads;
source include/search_pattern_in_file.inc;
# Repeat with --rocksdb-use-direct-writes
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" >$_expect_file_name
shutdown_server 10;
--echo # Now, restart the server back with regular settings
--source include/restart_mysqld.inc
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
--exec echo "restart:--rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1" >$_expect_file_name
--sleep 0.1
--exec echo "restart:" >$_expect_file_name
--echo #
--echo # Now, repeat the same with another set of invalid arguments
--echo #
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $_mysqld_option=--rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1 --default-storage-engine=myisam
--source include/restart_mysqld_with_option.inc
--echo # Check that ROCKSDB plugin is not loaded:
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=enable both use_direct_io_for_flush_and_compaction;
source include/search_pattern_in_file.inc;
--echo # Now, restart the server back with regular settings
--source include/restart_mysqld.inc
select plugin_name, plugin_type from information_schema.plugins where plugin_name='RocksDB';
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment