-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort rocksdb startup if O_DIRECT is requested but not supported (#793)…
… (#793) Summary: This change adds a check to see whether the filesystem backing rocksdb_datadir allows O_DIRECT when use_direct_reads is true and prevents rocksdb from coming up. This fixes #778 Closes #793 Differential Revision: D6995213 (a62014f) Pulled By: rralcala fbshipit-source-id: c61900b39ab
- Loading branch information
1 parent
6b35b68
commit 8bcf1f9
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Checking direct reads | ||
CREATE TABLE t1 (pk INT PRIMARY KEY DEFAULT '0', a INT(11), b CHAR(8)) ENGINE=rocksdb; | ||
SHOW CREATE TABLE t1; | ||
Table Create Table | ||
t1 CREATE TABLE `t1` ( | ||
`pk` int(11) NOT NULL DEFAULT '0', | ||
`a` int(11) DEFAULT NULL, | ||
`b` char(8) DEFAULT NULL, | ||
PRIMARY KEY (`pk`) | ||
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 | ||
INSERT INTO t1 VALUES (1, 1,'a'); | ||
INSERT INTO t1 (a,b) VALUES (2,'b'); | ||
set global rocksdb_force_flush_memtable_now=1; | ||
SELECT a,b FROM t1; | ||
a b | ||
1 a | ||
2 b | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
--perl | ||
use Cwd 'abs_path'; | ||
|
||
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/data_in_shm.inc") or die; | ||
my $real_path= abs_path($ENV{'MYSQLTEST_VARDIR'}); | ||
my $in_shm= index($real_path, "/dev/shm") != -1; | ||
print FILE "let \$DATA_IN_SHM= $in_shm;\n"; | ||
close FILE; | ||
EOF | ||
|
||
--source $MYSQL_TMP_DIR/data_in_shm.inc | ||
--remove_file $MYSQL_TMP_DIR/data_in_shm.inc | ||
|
||
if ($DATA_IN_SHM) | ||
{ | ||
--skip DATADIR is in /dev/shm, possibly due to --mem | ||
} | ||
|
||
--echo Checking direct reads | ||
--let $_mysqld_option=--rocksdb_use_direct_reads=1 | ||
--source include/restart_mysqld_with_option.inc | ||
|
||
CREATE TABLE t1 (pk INT PRIMARY KEY DEFAULT '0', a INT(11), b CHAR(8)) ENGINE=rocksdb; | ||
SHOW CREATE TABLE t1; | ||
INSERT INTO t1 VALUES (1, 1,'a'); | ||
INSERT INTO t1 (a,b) VALUES (2,'b'); | ||
set global rocksdb_force_flush_memtable_now=1; | ||
--sorted_result | ||
SELECT a,b FROM t1; | ||
DROP TABLE t1; | ||
|
||
# cleanup | ||
--let _$mysqld_option= | ||
--source include/restart_mysqld.inc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters