Server IP : 172.67.216.182 / Your IP : 162.158.106.12 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 : |
########################################################################################################## # Add a member to GR group and parallely insert data onto the donor # # 0. Start 3 servers, and add 2 among them to GR # 1. Add 3rd member to GR group # 2. Insert data into the donor member # 3. Validate the record counts on different tables # 4. Check the number of servers online and status of servers # 5. Cleanup ################################################################################ --source include/big_test.inc --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --let $rpl_server_count= 3 --source ../inc/group_replication.inc # Start group replication on two servers --echo --let $rpl_connection_name= server1 --source include/rpl_connection.inc SET sql_log_bin=0; CREATE TABLE test.t1 (a int primary key); SET sql_log_bin=1; --source ../inc/start_and_bootstrap_group_replication.inc --echo --let $rpl_connection_name= server2 --source include/rpl_connection.inc SET sql_log_bin=0; CREATE TABLE test.t1 (a int primary key); SET sql_log_bin=1; --source include/start_group_replication.inc # Extract the server_uuid --let $server2_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) # Connect to server1 and add some data --echo --let $rpl_connection_name= server1 --source include/rpl_connection.inc --disable_query_log --let $i=100 while($i) { --EVAL INSERT INTO t1 VALUES ($i) --dec $i } --enable_query_log # Start GR on server3 --echo --let $rpl_connection_name= server3 --source include/rpl_connection.inc SET sql_log_bin=0; CREATE TABLE test.t1 (a int primary key); SET sql_log_bin=1; LOCK TABLES t1 READ; connect(server3_2,localhost,root,,test,$SERVER_MYPORT_3,$SERVER_MYSOCK_3); --connection server3_2 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" --source include/start_group_replication_command.inc # Find the donor member --let $wait_timeout= 100 let $wait_condition=SELECT COUNT(*)=1 FROM performance_schema.replication_connection_status WHERE channel_name='group_replication_recovery' AND service_state='ON'; --source include/wait_condition.inc --let $donor_id= 1 if (`SELECT COUNT(*)=1 FROM performance_schema.replication_connection_status WHERE channel_name='group_replication_recovery' AND service_state='ON' AND source_uuid='$server2_uuid'`) { --let $donor_id= 2 } --disconnect server3_2 --echo --let $rpl_connection_name= server3 --source include/rpl_connection.inc UNLOCK TABLES; --echo --echo Add data onto the donor member --connection server$donor_id CREATE TABLE test.t2 (a int primary key); --disable_query_log --let $i=100 while($i) { --EVAL INSERT INTO t2 VALUES ($i) --dec $i } --enable_query_log # Make sure the servers are part of the group --let $wait_timeout= 300 let $wait_condition=SELECT COUNT(*)=3 FROM performance_schema.replication_group_members where MEMBER_STATE="ONLINE"; --source include/wait_condition.inc --echo --echo #Validating the records in server3# --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $wait_condition= SELECT COUNT(*)=100 FROM test.t1; --source include/wait_condition.inc --let $wait_condition= SELECT COUNT(*)=100 FROM test.t2; --source include/wait_condition.inc --source include/rpl_sync.inc # Drop the tables created --echo DROP TABLE test.t1; DROP TABLE test.t2; --source ../inc/group_replication_end.inc