403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.71.82.92
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/mysql-test/suite/group_replication/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/mysql-test/suite/group_replication/t/gr_full_group_shutdown.test
################################################################################
# Multi Master full group shutdown
#
# This test aims to validate that if all members in the group go down and up
# again, Distributed Recovery will work and all member will contain the same
# data in the end, regardless of operations that happened in between.
#
# Test:
# 0. The test requires three servers: M1, M2 and M3.
# 1. Bootstrap group with M1. Add some data for recovery.
# 2. Add two more members M2 and M3.
# 3. After recovery all members must see 3 members.
# 4. After recovery all members must have the data present in the donor.
# 5. Shut down all members until 0. Stop M3.
# 6. Add some data in M2. Stop M2.
# 7. Add some data to future recoveries in M1. Stop M1.
# 8. Bring up the group back to life. At the end, all data must be in all three
#    members.
# 9. Bootstrap group with M1. Start M2. Start M3.
# 10. After recovery all members must see 3 members.
# 11. After recovery all members must have the data present in the donor.
# 12. Clean up.
################################################################################

--source include/big_test.inc
--let $group_replication_group_name= 48530170-7407-11e4-82f8-0800200c9a66
--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3
--source ../inc/group_replication.inc

--echo #
--echo # Setup a new group
--echo #

--connection server1
--echo server1
--source ../inc/start_and_bootstrap_group_replication.inc

--echo # Add some data for recovery

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
COMMIT;
INSERT INTO t1 VALUES (3);

--echo #
--echo # 1) Create a 3 member group and verify that it is functional
--echo #

--echo #Add 2 more members
--connection server2
--echo server2
--source include/start_group_replication.inc

--connection server3
--echo server3
--source include/start_group_replication.inc

--echo #After recovery all members must see 3 other members
--let $server_count=3
while ($server_count)
{
  --connection server$server_count
  --let $group_replication_number_of_members= 3
  --source ../inc/gr_wait_for_number_of_members.inc

  --dec $server_count
}

--echo #After recovery all members must have the data present in the donor.
--let $server_count=3
while ($server_count)
{
  --connection server$server_count
  --let $assert_text= On all members, the table should exist and have 3 elements
  --let $assert_cond= [select count(*) from t1] = 3;
  --source include/assert.inc
  --dec $server_count
}

--echo #
--echo # 2) Shut down all members until 0. Add some data in the process.
--echo #

--echo #Stop the member 3
--connection server3
--echo server3

--source include/stop_group_replication.inc

--echo #Add some data to future recoveries and ensure that every member has it
--connection server2
--echo server2
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);

--source include/rpl_sync.inc

--echo #Stop the member 2
--source include/stop_group_replication.inc

--echo #Add some data to future recoveries
--connection server1
--echo server1

INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);

--echo #Stop the member 1
--source include/stop_group_replication.inc

--echo #
--echo # 3) Bring up the group back to life. At the end, all data must be in
--echo #    all three members.
--echo #

--connection server1
--echo server1
--source ../inc/start_and_bootstrap_group_replication.inc

--connection server2
--echo server2
--source include/start_group_replication.inc

--connection server3
--echo server3
--source include/start_group_replication.inc

--echo #After recovery all members must see 3 other members
--let $server_count=3
while ($server_count)
{
  --connection server$server_count
  --let $group_replication_number_of_members= 3
  --source ../inc/gr_wait_for_number_of_members.inc

  --dec $server_count
}

--echo #After recovery all members must have the data present in the donor.
--let $server_count=3
while ($server_count)
{
  --connection server$server_count
  --let $assert_text= On all members, the table should exist and have 7 elements
  --let $assert_cond= [select count(*) from t1] = 7;
  --source include/assert.inc
  --dec $server_count
}

--echo #
--echo # Cleaning up
--echo #

DROP TABLE t1;

--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit