Skip to content

Commit

Permalink
MDEV-14123: .rocksdb folder may break workflow which re-create data d…
Browse files Browse the repository at this point in the history
…irectory

Part #2: Adjust other parts of testsuite to take into account
that RocksDB files are in "#rocksdb" now.
  • Loading branch information
spetrunia committed Dec 11, 2017
1 parent ddc1d69 commit bdeb27a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ rocksdb_concurrent_prepare ON
rocksdb_create_checkpoint
rocksdb_create_if_missing ON
rocksdb_create_missing_column_families OFF
rocksdb_datadir ./.rocksdb
rocksdb_datadir ./#rocksdb
rocksdb_db_write_buffer_size 0
rocksdb_deadlock_detect OFF
rocksdb_deadlock_detect_depth 50
Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/mysql-test/rocksdb/t/bulk_load.inc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ select count(b) from t3;
# the server starts
--let $tmpext = .bulk_load.tmp
--let $MYSQLD_DATADIR= `SELECT @@datadir`
--let $datadir = $MYSQLD_DATADIR/.rocksdb
--let $datadir = $MYSQLD_DATADIR/#rocksdb
--write_file $datadir/test$tmpext
dummy data
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ perl;
print "wait_for_delete: $ENV{no_more_deletes}\n";
while ($retry++ < $num_retries) {
$total_d=$total_e=0;
for $f (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/.rocksdb/*.sst>) {
for $f (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/#rocksdb/*.sst>) {
# excluding system cf
$filename= "$ENV{MARIAROCKS_SST_DUMP} --command=scan --output_hex --file=$f";
open(D, '-|', $filename) || die("Can't open file $filename: $!");
Expand Down
4 changes: 2 additions & 2 deletions storage/rocksdb/mysql-test/rocksdb/t/drop_table2.test
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ set @@global.rocksdb_compact_cf = 'rev:cf2';
set @@global.rocksdb_compact_cf = 'default';

perl;
$size+=-s $_ for (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/.rocksdb/*.sst>);
$size+=-s $_ for (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/\#rocksdb/*.sst>);
$filename= "$ENV{MYSQLTEST_VARDIR}/tmp/size_output";
open(F, '>', $filename) || die("Can't open file $filename: $!");
print F $size;
Expand All @@ -121,7 +121,7 @@ let $wait_condition = select count(*) = 0

# Check that space is reclaimed
perl;
$size+=-s $_ for (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/.rocksdb/*.sst>);
$size+=-s $_ for (<$ENV{MYSQLTEST_VARDIR}/mysqld.1/data/\#rocksdb/*.sst>);
$filename= "$ENV{MYSQLTEST_VARDIR}/tmp/size_output";
open(F, '<', $filename) || die("Can't open file $filename: $!");
$old=<F>;
Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/mysql-test/rocksdb/t/optimize_table.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# run a check script to verify sst files reduced enough during each optimize table
perl;

$size += -s $_ for (<$ENV{datadir}/.rocksdb/*.sst>);
$size += -s $_ for (<$ENV{datadir}/#rocksdb/*.sst>);
$file= "$ENV{MYSQL_TMP_DIR}/sst_size.dat";
if (-f $file) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ MOVEBACK_LOG="${MYSQL_TMP_DIR}/myrocks_hotbackup_moveback_log"

echo "myrocks_hotbackup move-back phase"
$MYSQL_MYROCKS_HOTBACKUP --move_back --datadir=$dest_data_dir \
--rocksdb_datadir=$dest_data_dir/.rocksdb \
--rocksdb_waldir=$dest_data_dir/.rocksdb \
--rocksdb_datadir=$dest_data_dir/\#rocksdb \
--rocksdb_waldir=$dest_data_dir/\#rocksdb \
--backup_dir=$backup_dir > $MOVEBACK_LOG 2>&1

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ select * from mysql.slave_gtid_info;
--write_file $MYSQL_TMP_DIR/truncate_tail_wal.sh
#!/bin/bash

F=`ls -t $slave_data_dir/.rocksdb/*.log | head -n 1`
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
SIZE=`stat -c %s $F`
NEW_SIZE=`expr $SIZE - 10`
truncate -s $NEW_SIZE $F
Expand Down Expand Up @@ -116,7 +116,7 @@ connection slave;
#!/bin/bash
# expected to be around 950 bytes
F=`ls -t $slave_data_dir/.rocksdb/*.log | head -n 1`
F=`ls -t $slave_data_dir/\#rocksdb/*.log | head -n 1`
SIZE=`stat -c %s $F`
OFFSET=$(( $SIZE-500 ))
dd bs=1 if=/dev/zero of=$F count=100 seek=$OFFSET conv=notrunc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.ROCKSDB_DATADIR;
SELECT @start_global_value;
@start_global_value
./.rocksdb
./#rocksdb
"Trying to set variable @@global.ROCKSDB_DATADIR to 444. It should fail because it is readonly."
SET @@global.ROCKSDB_DATADIR = 444;
ERROR HY000: Variable 'rocksdb_datadir' is a read only variable
4 changes: 2 additions & 2 deletions storage/rocksdb/mysql-test/storage_engine/cleanup_engine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
--let $datadir= `SELECT @@datadir`

--error 0,1
--file_exists $datadir/.rocksdb/*
--file_exists $datadir/\#rocksdb/*
if (!$mysql_errno)
{
--enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--rmdir $datadir/.rocksdb
--rmdir $datadir/\#rocksdb
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
}

0 comments on commit bdeb27a

Please sign in to comment.