Server IP : 172.67.216.182 / Your IP : 162.158.108.161 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 will update in parallel, in the same member, N transactions # with N different clients. # # The success of this test is determined by its termination. Any failure # in the parallelism of a transaction shall make some transactions be # rollback. # # Test: # 0. The test requires one server. # 1. With member ONLINE, create 20 clients connections. Create initial data. # 2. Update the same row on server 1 in parallel by all clients. # 3. Assert that the row has the expected value, the total number of updates. # 4. Disconnect clients connections. # 5. Clean up. ################################################################################ --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc --let $clients= 20 --let $updates= 100 --echo --echo ################################################################ --echo # 1. Create clients connections. --let $clients_counter= $clients while($clients_counter > 0) { --connect(server1_$clients_counter, localhost,root,,,$MASTER_MYPORT) --dec $clients_counter } --echo --echo ################################################################ --echo # 2. Create initial data. --let $rpl_connection_name= server1 --source include/rpl_connection.inc CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 INT NOT NULL) ENGINE=InnoDB; INSERT INTO t1 (c1,c2) VALUES (0,0); --source include/rpl_sync.inc --echo --echo ################################################################ --echo # 3. Update the same row on server 1 in parallel by all clients. --disable_query_log --let $updates_counter= $updates while($updates_counter > 0) { --let $clients_counter= $clients while($clients_counter > 0) { --connection server1_$clients_counter --send UPDATE t1 SET c2=c2+1 WHERE c1=0 --dec $clients_counter } --let $clients_counter= $clients while($clients_counter > 0) { --connection server1_$clients_counter --reap --dec $clients_counter } --dec $updates_counter } --enable_query_log --echo --echo ################################################################ --echo # 4. Assert that the row has the expected value, the total --echo # number of updates. --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $assert_text= Table t1 must have 1 entry --let $assert_cond= [SELECT COUNT(*) AS count FROM t1, count, 1] = 1 --source include/assert.inc --let $_total_updates= `SELECT $clients * $updates` --let $assert_text= Table t1 entry must have total number of updates as c2 value --let $assert_cond= [SELECT c2 FROM t1 WHERE c1=0] = $_total_updates --source include/assert.inc --echo --echo ################################################################ --echo # 5. Disconnect clients connections. --let $clients_counter= $clients while($clients_counter > 0) { --disconnect server1_$clients_counter --dec $clients_counter } --echo --echo ################################################################ --echo # 6. Clean up, DROP TABLE t1; --source ../inc/group_replication_end.inc