Commit bdeb27a0 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-14123: .rocksdb folder may break workflow which re-create data directory

Part #2: Adjust other parts of testsuite to take into account
that RocksDB files are in "#rocksdb" now.
parent ddc1d690
......@@ -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
......
......@@ -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
......
......@@ -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: $!");
......
......@@ -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;
......@@ -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>;
......
# 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) {
......
......@@ -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
......@@ -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
......@@ -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
......
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
......@@ -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
}
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