Rate This Document
Findability
Accuracy
Completeness
Readability

Usage Description

Fix vulnerabilities as soon as possible based on the Common Vulnerabilities and Exposures (CVE) of MySQL 8.0.20 on the MySQL official website.

Release Notes

This feature is released with Kunpeng Computing DC Solution 20.0.3.

Application Scenarios

When there are many write operations (such as update, insert, and delete) in the OLTP workload, the global latch in the MySQL database may be the main factor that affects the throughput. If the Performance Schema shows that there is contention on lock_mutex while the CPU usage is low, this feature can be used to alleviate the contention and improve the system throughput.

The MySQL fine-grained lock tuning feature takes effect immediately after the patch is installed and the MySQL database is recompiled. You do not need to configure system variables.

Compilation and Installation Method

The MySQL fine-grained lock tuning feature is provided as a patch file. This patch is developed based on MySQL 8.0.20 and is open-sourced in the Gitee community. Before using this feature, apply the patch to the MySQL source code, and then compile and install MySQL.

  1. Download the MySQL 8.0.20 source package, upload it to the /home directory on the server and decompress it, and then go to the root directory of the MySQL source code.
    cd /home
    tar -zxvf mysql-boost-8.0.20.tar.gz
    cd mysql-8.0.20
  2. Download the MySQL fine-grained lock tuning patch and upload it to the root directory of the MySQL source code.
  3. Decompress the source package and go to the MySQL source code directory.
    tar -zxvf mysql-boost-8.0.20.tar.gz
    cd mysql-8.0.20
  4. In the root directory of the source code, run the git init command to create Git management information.
    git init
    git add -A
    git commit -m "Initial commit"
    • Generally, Git is provided by the system. If not, configure the Yum source by following instructions in MySQL Porting Guide and then install Git.
      1
      yum install git
      
    • If the Git commit user information is not configured, configure the user email and user name before running the git commit command.
      1
      2
      git config user.email "123@example.com"
      git config user.name "123"
      
  5. (Optional) If the Yum source is not configured, configure it. For details, see Configuring the Yum Source.
  6. (Optional) If dos2unix is not installed, run the following command to install it:
    yum install dos2unix
  7. Apply the MySQL fine-grained lock tuning patch.
    1
    2
    3
    dos2unix 0001-SHARDED-LOCK-SYS.patch
    git apply --check 0001-SHARDED-LOCK-SYS.patch
    git apply --whitespace=nowarn 0001-SHARDED-LOCK-SYS.patch
    

    If no error information is displayed, the patch is successfully installed.

  8. Compile and install the MySQL source code. For details, see MySQL Porting Guide.
  9. (Optional) Perform a TPC-C test to obtain the performance improvement data after the MySQL fine-grained lock tuning feature is used. For details about the test, see BenchMarkSQL Test Guide.

    This feature improves the comprehensive TPC-C performance by 10%.

    Figure 1 Performance comparison before and after MySQL fine-grained lock tuning is used