forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Upstream commit ID : fb-mysql-5.6.35/bcd7519d0149a9dd946263b80f3a114625897420 PS-4476 : Merge prod201801 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 facebook/mysql-5.6#778 Closes facebook/mysql-5.6#793 Differential Revision: D6995213 Pulled By: rralcala fbshipit-source-id: f0da21c
- Loading branch information
Roberto Rodriguez Alcala
authored and
George O. Lorch III
committed
Jun 22, 2018
1 parent
1c4f0db
commit b035789
Showing
3 changed files
with
86 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,20 @@ | ||
Checking direct reads | ||
# restart:--rocksdb_use_direct_reads=1 | ||
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; | ||
# restart |
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,36 @@ | ||
--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 $restart_parameters=restart:--rocksdb_use_direct_reads=1 | ||
--source include/restart_mysqld.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 $restart_parameters= | ||
--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