Server IP : 104.21.38.3 / Your IP : 172.70.92.243 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 : |
################################################################################ # This test verifies that the slave server with binlog enabled is able to # replicate from a member which is part of a Group. # # Test: # 0. The test requires three servers: M1, M2 and M3. # 1. Bootstrap start a group on M1. Start GR on M2 and add some data. # 2. Connect the third server to one of the member of the group, establishing # an asynchronous replication connection (M1->M3). Start slave on M3. # 3. On the slave (M3), test that the data is properly replicated after the # start slave is completed. Diff check the table on M1 and M3, and, verify # binlog events on M3. # 4. Cleanup. ################################################################################ --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 the first member here --let $rpl_connection_name= server1 --source include/rpl_connection.inc --source ../inc/start_and_bootstrap_group_replication.inc # Start the second member. Add some data and sync it in the group. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --source include/start_group_replication.inc CREATE TABLE test.t1 (i INT PRIMARY KEY); INSERT INTO test.t1 VALUES(1); --source include/rpl_sync.inc # Establish an async connection between the third server and member 1 of # the group. --let $rpl_connection_name= server3 --source include/rpl_connection.inc SET SESSION sql_log_bin= 0; --source include/gtid_utils.inc SET SESSION sql_log_bin= 1; # Make this server the slave of the first server which belongs to the group. --disable_warnings --replace_result $MASTER_MYPORT MASTER_PORT --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_AUTO_POSITION=1 --enable_warnings --source include/start_slave.inc # Restart GR on M2 and add some data to the group. Verify that the same events are replicated to M3 later. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --source include/stop_group_replication.inc --source include/start_group_replication.inc INSERT INTO test.t1 VALUES(2); --source include/rpl_sync.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $sync_slave_connection= server3 --source include/sync_slave_sql_with_master.inc --echo # On the slave (server3), test that the data is properly replicated --echo # after the start slave is complete. --let $diff_tables= server1:test.t1, server3:test.t1 --source include/diff_tables.inc # The sequence of events that make up a View Change --let $vcle_seq= Gtid # Query/BEGIN # View_change # Query/COMMIT # View change (s1) # View change (s2) # Create table # Insert # View change (s2) # Insert --let $event_sequence= $vcle_seq # $vcle_seq # !Gtid_transaction # !Gtid_transaction # $vcle_seq # !Gtid_transaction --source include/assert_binlog_events.inc # Cleanup --let $rpl_connection_name= server1 --source include/rpl_connection.inc DROP TABLE test.t1; --let $sync_slave_connection= server3 --source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc CHANGE MASTER TO MASTER_AUTO_POSITION=0; SET SESSION sql_log_bin= 0; --source include/gtid_utils_end.inc SET SESSION sql_log_bin= 1; --source include/rpl_reset_slave_helper.inc --source ../inc/group_replication_end.inc