File: use_direct_reads_writes.test

package info (click to toggle)
mariadb-10.3 1%3A10.3.34-0%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 531,600 kB
  • sloc: cpp: 1,415,326; ansic: 917,243; perl: 58,570; sh: 43,538; pascal: 39,206; java: 33,919; yacc: 32,096; javascript: 15,655; python: 10,576; ruby: 8,684; xml: 5,957; makefile: 4,893; sql: 3,750; asm: 841; lex: 670; php: 22; awk: 20; sed: 16
file content (62 lines) | stat: -rw-r--r-- 2,384 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--source include/have_rocksdb.inc
--source include/have_direct_io.inc

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 ROCKSDB
# plugin will not load in such configuration.
#
--let LOG=$MYSQLTEST_VARDIR/tmp/use_direct_reads_writes.err
--let SEARCH_FILE=$LOG

--echo Checking direct reads
--let $_mysqld_option=--log-error=$LOG --rocksdb_use_direct_reads=1 --rocksdb_allow_mmap_reads=1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--source include/restart_mysqld_with_invalid_option.inc

--let SEARCH_PATTERN=enable both use_direct_reads
--source include/search_pattern_in_file.inc
--remove_file $LOG


# Repeat with direct-writes
--echo Checking direct writes
--let $_mysqld_option=--log-error=$LOG --rocksdb_use_direct_io_for_flush_and_compaction=1 --rocksdb_allow_mmap_writes=1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--source include/restart_mysqld_with_invalid_option.inc

--let SEARCH_PATTERN=enable both use_direct_io_for_flush_and_compaction
--source include/search_pattern_in_file.inc
--remove_file $LOG


# Verify invalid direct-writes and --rocksdb_flush_log_at_trx_commit combination at startup fails
--echo Checking rocksdb_flush_log_at_trx_commit
--let $_mysqld_option=--log-error=$LOG --rocksdb_flush_log_at_trx_commit=1 --rocksdb_allow_mmap_writes=1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--source include/restart_mysqld_with_invalid_option.inc

--let SEARCH_PATTERN=rocksdb_flush_log_at_trx_commit needs to be
--source include/search_pattern_in_file.inc
--remove_file $LOG


# Verify rocksdb_flush_log_at_trx_commit cannot be changed if direct writes are used
--echo Validate flush_log settings when direct writes is enabled
--let $_mysqld_option=--rocksdb_flush_log_at_trx_commit=0 --rocksdb_allow_mmap_writes=1
--source include/restart_mysqld_with_option.inc

set global rocksdb_flush_log_at_trx_commit=0;
--error ER_WRONG_VALUE_FOR_VAR
set global rocksdb_flush_log_at_trx_commit=1;
--error ER_WRONG_VALUE_FOR_VAR
set global rocksdb_flush_log_at_trx_commit=2;

# Cleanup
--source include/restart_mysqld.inc