Server IP : 172.67.216.182 / Your IP : 172.70.189.33 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 : |
################################################################################ # Verify server behaviour when the same transaction is executed in parallel # in two servers. # # Test: # 0. The test requires two servers: M1 and M2. # 1. With both the members ONLINE. Create a 20 tables on M1. # 2. Executing the same insert transaction on both server (almost) in parallel, # one will be committed, the other will be aborted # 3. Validate servers state is equal by checking gtid_executed and table data. # 4. Clean up. ################################################################################ --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc --let $transactions= 1000 --let $i= 0 --let $tables= 20 --echo --echo ############################################################ --echo # 1. Create 20 tables on server1 and wait for group to be --echo # synchronized. while($i < $tables) { --eval CREATE TABLE t$i (c1 INT NOT NULL PRIMARY KEY) --inc $i } --source include/rpl_sync.inc --echo --echo ############################################################ --echo # 2. Executing the same transaction on both server (almost) --echo # in parallel, one will be committed, the other will be --echo # aborted. --let $t= 0 --disable_query_log while($t < $transactions) { --inc $t --let $index= `select MOD($t, $tables)` --connection server1 --send_eval INSERT INTO t$index VALUES ($t) --connection server2 --send_eval INSERT INTO t$index VALUES ($t) --connection server1 --error 0, ER_TRANSACTION_ROLLBACK_DURING_COMMIT, ER_ERROR_DURING_COMMIT, ER_DUP_ENTRY, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT --reap --connection server2 --error 0, ER_TRANSACTION_ROLLBACK_DURING_COMMIT, ER_ERROR_DURING_COMMIT, ER_DUP_ENTRY, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT --reap } --enable_query_log # Sync server1, server2 --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $sync_slave_connection= server2 --source include/sync_slave_sql_with_master.inc --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $sync_slave_connection= server1 --source include/sync_slave_sql_with_master.inc --echo ############################################################ --echo # 3. Validate servers state is equal. --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $server1_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED` --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $server2_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED` --let $assert_text= server1 GTID_EXECUTED must be equal to server2 GTID_EXECUTED --let $assert_cond= "$server1_gtid_executed" = "$server2_gtid_executed" --source include/assert.inc # Check that all tables has same data in server1, server2 --let $i=0 while($i < $tables) { --let $diff_tables= server1:t$i, server2:t$i --source include/diff_tables.inc --inc $i } --echo --echo ############################################################ --echo # 4. Clean up. --let $i= 0 while($i < $tables) { --eval DROP TABLE IF EXISTS t$i --inc $i } --source ../inc/group_replication_end.inc